Cookie Consent by Free Privacy Policy Generator Apache2: AH01630: client denied by server configuration | Igor Moiseev

Igor Moiseev Applied mathematician, Web Developer

Apache2: AH01630: client denied by server configurationedit

The Apache web server of the version 2.4 introduces a new style for <VirtualHost> configuration, in particular the <Directory> syntax is not compatible anymore with the previous one 2.2.

The old styled configuration valid in the Apache <= 2.2 version

<VirtualHost *:80>

    ...

    <Directory "/var/www/html/example.com/public">
        Options MultiViews FollowSymLinks
        AllowOverride all
        Order allow,deny
        Allow from all
    </Directory>

    ...

</VirtualHost>

the modification is introduced in the part

Order allow,deny
Allow from all

the new way to describe the access permitions is reduced to just one line

Require all granted

finally the correct <VirtualHost> configuration will look like the following

<VirtualHost *:80>
    ServerName  www.example.com
    ServerAlias example.com

    DirectoryIndex index.html index.php index.htm
    DocumentRoot /var/www/html/example.com/public

    <Directory "/var/www/html/example.com/public">
        Options MultiViews FollowSymLinks
        AllowOverride all
        Require all granted
    </Directory>

    # Logfiles
    ErrorLog  /var/log/apache2/example.com/error.log
    CustomLog /var/log/apache2/example.com/access.log combined
</VirtualHost>

moiseevigor.github.io is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means to earn fees when linking to Amazon.com and affiliated sites.