Skip to content

Instantly share code, notes, and snippets.

@symmetriq
Last active November 8, 2015 01:09
Show Gist options
  • Save symmetriq/49d5786578c979999ceb to your computer and use it in GitHub Desktop.
Save symmetriq/49d5786578c979999ceb to your computer and use it in GitHub Desktop.
Get Apache working in OS X 10.10 "Yosemite"

In OS X 10.10 (Yosemite), Apache has been upgraded from 2.2 to 2.4, which includes some significant changes, and the default config file has changed quite a bit. When you install Yosemite, it renames your old config to httpd.conf~previous, and unfortunately your old one won't work anymore.

To get Apache working again, edit the following files:

/etc/apache2/httpd.conf

Uncomment:

LoadModule userdir_module libexec/apache2/mod_userdir.so
LoadModule php5_module libexec/apache2/libphp5.so
Include /private/etc/apache2/extra/httpd-userdir.conf
/etc/apache2/extra/httpd-userdir.conf

Uncomment:

Include /private/etc/apache2/users/*.conf
/etc/apache2/users/[username].conf

Replace every occurrence of these lines:

Order allow,deny
Allow from all

...with this:

Require all granted

If you have multiple users (or any other config file that contains those lines), you'll need to do this for each one.

I believe the latter change is due to an auth-related module that's now disabled by default. You could probably just re-enable the old one, but unless you have a specific reason for using it, it makes more sense to just get with the new program than have to enable the old auth module on every machine.

When setting up Apache for the first time on a new Mac, you also need to start the launchd service:

sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment