×


Solving Apache error client denied by server configuration

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;

<Directory /var/www/domain.com>
Order allow,deny
Allow from all
</Directory>


to;

<Directory /var/www/domain.com>
Require all granted
</Directory>


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;

<Directory /var/www/domain.com>
Order deny,allow
Deny from all
</Directory>


Then, modify it to;

<Directory /var/www/domain.com>
Require all denied
</Directory>



Furthermore, where you have the configuration as below;

<Directory /var/www/domain.com>
Order Deny,Allow
Deny from all
Allow from domain.com
</Directory>


You should update it as;

<Directory /var/www/domain.com>
Require host domain.com
</Directory>


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.

Need support in solving Apache errors? Consult us today.


Conclusion

Are you facing "Apache error client denied by server configuration" web server issue? Let us solve it for you!