As part of our Server Support Services, we have helped numerous clients solve Apache related issues.
In this context, we shall look into what triggers this error and how to fix it.
Why does apache error client denied by server configuration occur?
Most Apache web server users experience this error after they upgrade their apache server to a higher version.
What this error signifies is that there is an issue in the Apache configuration file making access to the directory not accessible. When an upgrade of apache is done, some modification in the access control will take place which affects authentication and authorization processes.
How to solve apache error client denied by server configuration
Just recently, a customer contacted us that he is seeing an error message like;
client denied by server configuration: /var/www/domain.com/
To fix this error, initially we checked the apache configuration file "httpd.conf" and modified it with the following attributes from;
Allow from all
Require all granted
You will see that all access is granted in this case to fix the permission issue.
In other cases where the configuration file contains instruction to deny all request like this;
Deny from all
Then, modify it to;
Require all denied
Furthermore, where you have the configuration as below;
Deny from all
Allow from domain.com
You should update it as;
Require host domain.com
The bone of contention here is that the instruction "Deny from all" is replaced by "Require all denied" while "Allow from all" is replaced with "Require all granted".
Therefore, it is important to check the configuration file for directory permission instructions such as "Order deny,allow" as well as "Order allow,deny" and remove them if it exist.