Q. I'm running Apache 2 Web sever under CentOS Linux and getting an error that read as follows:
[Wed Sep 17 21:53:49 2008] [error] [client 122.1xx.y9.zzz] client denied by server configuration: /var/www/examples.com/
How do I fix this error?
A. By default Apache is configured as restrictive server. It will not allow end users (client) to do anything on default DocumentRoot. To fix this issue you need to add following lines to your VirtualHost configuration directives:
<Directory "/var/www/example.com">
Options -Indexes FollowSymLinks
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
</Directory>'Order allow,deny' and 'Allow from all' will set appropriate permission for the directory. At the end it should look like as follows:
<VirtualHost *:80> ServerAdmin webmaster@example.com DocumentRoot "/var/www/example.com" ServerName example.com ServerAlias www.example.com ErrorLog "/var/logs/httpd/example.com/error.log" CustomLog "/var/logs/httpd/example.com/access.log" common ScriptAlias /cgi-bin/ "/var/suexec/example.com/cgi-bin/" <Directory "/var/www/example.com"> Options -Indexes FollowSymLinks AllowOverride AuthConfig FileInfo Order allow,deny Allow from all </Directory> SuExecUserGroup user group </VirtualHost>
Restart apache:
# service httpd restart
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- My 10 UNIX Command Line Mistakes
- Linux: 20 Iptables Examples For New SysAdmins

- 25 PHP Security Best Practices For Sys Admins
- The Novice Guide To Buying A Linux Laptop
- 10 Greatest Open Source Software Of 2009
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
Facebook it - Tweet it - Print it -


{ 10 comments… read them below or add one }
While I thought this was going to be the ticket I still ended up with errors I am going to try again using each of these inside each vhost config directive.
It turned out to be an invalid vhost config and not the allow directives, thanks for the stating place!
Something else worth noting for people turning up on this page;
I had this same issue (exactly the same error) – and it turned out to be that the person who reported the issue was repeatedly calling the same file in a non-stop loop, and http-Security.conf had been setup for DDOS protection ;)
Added the IP into whitelist, slapped a few wrists, and all is well again!
FingAZ
Hi FingAZ!
I’m having the exact same problem you stated, about people calling the same file non-stop. This has been a real problem for me, especially with scripts using AJAX. However, I am a newbie in Linux/CentOS. Could you please clarify about the http-Security.conf? Is it a file? I haven’t found it in my system.
Thanks in advance!
I finally discovered what the problem was: mod_evasive. Because of this I kept getting too many false positives, especially with AJAX. I disabled it and everything works fine now. :)
Hi
Thanks a lot I got useful information
Thanks a lot! This really helped!
thanks
thanks.
now my server run well
Thank you.. thank you so much! Did the trick nicely.
BTW, will it not compromise the site’s security since we used “Allow from All”?