Web Hosting on OS X

Setting up your own WordPress installation can be fun and easy, and you can even set it up on your own home computer! When doing so, there are sometimes some very strange errors or screens you’ll start to see that you didn’t see before… for instance, you’ll be asked for FTP information when uploading a plugin or theme, or when you update your version of WordPress. You also may experience strange URL errors or problems browsing to certain areas. Included in this post is information and general suggestions on setting up your own web hosting on your OS X machine.

Apple’s operating system uses the user “_www” when it comes to web pages. That means if you aren’t that user, the web page you’re visiting will ask you to verify that you have permission to do what you’re trying to do. The easiest way to get around this problem is to perform the following commands from Terminal. The commands below assume that you have your web site set up at /Library/WebServer/Documents/ folder. If you don’t, just change that information in the commands below to match your setup.

sudo chown -R _www /Library/WebServer/Documents/
sudo chmod -R g+w /Library/WebServer/Documents

Note: if you have OS X Server installed, your web site location will most likely be /Library/Server/Web/Data/Sites.

You’ll be asked to supply your password the first time you use “sudo”, so don’t be alarmed. After you perform these actions, your site should be error-free. 🙂

Additionally, you’ll want to make sure your files and directories have the correct permissions. For WordPress, you can run the following two commands to complete this:

sudo find /Library/WebServer/Documents -type d -exec chmod 755 {} \;
sudo find /Library/WebServer/Documents -type f -exec chmod 644 {} \;

If you have questions, feel free to post them here.

Leave a Reply

Your email address will not be published. Required fields are marked *