When setting up Apache from scratch on a new server, and you create a new DocumentRoot for a new VirtualHost, you’ll often find yourself running into:
Forbidden
You don't have permission to access / on this server.
This will generate following entry in your defined ErrorLog:
[Fri Dec 14 23:12:07.823744 2018] [authz_core:error] [pid xxx:tid xxx] [client x.x.x.x:59429] AH01630: client denied by server configuration: /var/www/websitename/
To fix this error, simply open up the corresponding file in /etc/apache2/sites-available and add the following lines anywhere in the file:
Apache 2.4
<Directory /var/www/websitename>
Require all granted
</Directory>
Apache 2.2
<Directory /var/www/websitename>
Order allow,deny
Allow from all
</Directory>
If you’re unsure of your Apache version, you can run the following command:
a2query -v
Leave a Reply