Php – Apache vhost AH01630: client denied by server configuration

apache-2.4arch-linuxPHPWordpress

I know there are a ton of questions about this error and I have looked at all of the answers. I haven't found anything that fixes this for me.

In trying to migrate a WordPress site, I set up a vhost subdomain on the new host first, to test it. Right now I'm getting a 403 trying to hit the root. The logs shows the infamous error:

[authz_core:error] [pid 22538] [client (ip and port)] AH01630: client denied by server configuration: /home/apprunner/mysite

I have a few other vhost sites running without problems. They are all configured in the same httpd.conf file. The problem one is configured thusly:

<VirtualHost *:80>
        ServerName mysite.mydomain.com
        DocumentRoot /home/apprunner/mysite
        DirectoryIndex index.php
        <Directory /home/apprunner/mysite>
                AllowOverride All
                Options -MultiViews
                Require all granted
        </Directory>
</VirtualHost>

I am using an .htaccess file with this site:

# BEGIN WordPress

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

My environment:

  • Hosting provider: Linode
  • OS: Arch Linux
  • Apache 2.4.12
  • PHP 5.6.13

Although the Apache error specifies the configuration as the problem I have also double, triple, and quadruple-checked the file permissions too. They seem fine, and set up the same as the other vhost sites I have on this server, which work just fine.

I greatly appreciate any help you can provide, especially as this is a problem I know is common. Even so, the googles, and the serverfault searches, they no help me. (Or I'm not reading them right, who knows).

Best Answer

Well cripes. I spent all this time scratching my head only to find that I was missing one directory in the path for the Directory and ServerName statements. It was so close to the right path I completely overlooked it.

Maybe it will help somebody, though, to know that pointing a vhost to a non-existent directory will give this error, so it is not just restricted to how you set up your Directory permissions or options.