Apache client denied by server configuration after mac OS X upgrade to Yosemite

Solution 1:

In your user .conf (douglas.conf) replace:

Order allow,deny
Allow from all

With:

Require all granted

The difference is how apache 2.4 handles permissions

http://httpd.apache.org/docs/2.4/upgrading.html

Solution 2:

I had the same issue and I fixed it by doing so:

  1. Load the userdir module: edit httpd.conf (/etc/apache2/httpd.conf on macbook) and uncomment these lines:

    LoadModule userdir_module libexec/apache2/mod_userdir.so
    

    and

    Include /private/etc/apache2/extra/httpd-userdir.conf
    
  2. Edit httpd-userdir.conf (at /etc/apache2/extra/httpd-userdir.conf), find and uncomment the following line:

    Include /private/etc/apache2/users/*.conf
    
  3. Edit your config file at users/*.conf, add Require local and + (or -) character before all options in the options line:

    <Directory "/Users/user/Sites/">
        Options +Indexes +MultiViews +FollowSymLinks +SymLinksIfOwnerMatch +ExecCGI
        AllowOverride All
        Require local
        Order allow,deny
        Allow from all
    </Directory>
    

Solution 3:

I experienced the same thing but on Mavericks after applying the security update from a couple days ago. Mavericks is still using Apache 2.2 so it wasn't the config issue chrisMc mentioned, though it looks like he's right and you'll need to change that as well.

In my case, I first resolved the core problem by commenting out the Homebrew PHP 5.4 module line I had previously added. In the httpd.conf:

#LoadModule php5_module /usr/local/opt/php54/libexec/apache2/libphp5.so

And instead opting for the default PHP module which I had commented out before:

LoadModule php5_module libexec/apache2/libphp5.so

That fixed it, but as for why the Homebrew version broke, I think maybe a system library it was compiled against was updated in the security update. When I ran php -v I got a warning about an icu4c library that wasn't loaded.

So, I just recompiled PHP and it worked again. In my case, I just did

brew uninstall php54
brew install php54

Then the Homebrew module could be enabled again.

Solution 4:

Since I have never used homebrew I ended up following this guide. Setup for personal development.

I did see that the permissions that the first poster was talking about as being part of the problem, but I still have a permissions issue with personal setup using a user.conf file. This setup used virtual hosts. I have no idea what homebrew did that solved the problem. I guess I would call this a work around because it did not fix my original issue, which is that I cannot access anything on the web server using a user.conf file.

Solution 5:

The answers above do work, on a stock install. If not, a few things that might help:

  1. On your filesystem, the folder needs to be exactly Sites with a capital S (the folder name is hardcoded in the userdir module, it can't be any different) Its permissions must be:

    drwxr-xr-x   2 username staff    68 29 mar 11:26 Sites
    
  2. The <Directory…> configuration is applied on top of it, so it needs to match the folder name exactly, including the case (we're coming from Linux…).

    Permissions of the /etc/apache2/users/username.conf file:

    -rw-r--r--  1 root  wheel  189 29 mar 11:42 username.conf
    

So make sure that the line <Directory "/Users/user/Sites/"> refers exactly to the right folder with the right username (with user matching the name of the configuration file), case included, and the Sites folder does exist exactly as is, case included.