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.

Categorized as Server

By Sharon

Hello there! I'm a web developer in Louisville, Kentucky. I started on this career path by purchasing an O’Reilly PHP book from Barnes & Noble in 1999. Since then, my desire to learn as much as I can about web site building and server maintenance has grown. I love technology and what it can do to simplify our lives and make it more interesting all at the same time. Seeing a creative design come to life and bringing it into the web world is my favorite puzzle to solve. My server experience is based around launching WordPress-friendly servers — Linux (Ubuntu and Centos flavors), Apache, MySQL, and PHP. I have worked with various modules, extensions, installs such as ImageMagick, LetsEncrypt, Sass, LESS, and the Homebrew family of extension. My main love has been with PHP, and my CMS of choice has been WordPress since its inception in 2003. I find it flexible, secure, easy to design around, and so customizable. My strengths are in developing from-scratch plugins and themes for the WordPress CMS with a strong background in PHP and MySQL development.

Leave a comment

Your email address will not be published.