The Linux Page

Apache log says: client denied by server configuration

I work with Apache a lot. It is a really good web server that has many options and features. Unfortunately, maybe it has too many of them!

I ran in a problem where a notification from one server to another would fail with the following error:

[Fri Oct 11 19:43:50 2013] [error] [client 162.226.130.121] client denied by server configuration: <path to file>

Looking at the error, I was first thinking that my script was generating the error. The fact is that my script does not generate error 403. It has a 400 and 500 but not 403.

So looking at the error I thought, maybe that's an actual Apache error. Sure enough, they have a wiki page explaining some things about it... and sure enough that was the error I was having. My server IP address changed not too long ago and I had to change that in an Allow statement. Only I did not remember that I had a hidden .htaccess file all the way down there. I stared at the main settings and could not see a problem.

Order Deny,Allow
Deny from all
Allow from m2osw.com

Then I read in another post that the .htaccess could be the culprit. Looked for that file and found one that was wrong. Fixed that now everything works as expected again. Note that the example uses a name instead of an IP address. This is good if you change the IP all the time, otherwise using the IP address is better because that way you avoid a name lookup (after thousands or million of lookups... you definitively save some time.)

Source: Client denied by server configuration