Apache Error Client Denied By Server Configuration

by Vivek Gite [Last updated: September 19, 2008]

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

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Tagged as: , , , , , , , ,

Previous post: FreeBSD: Apache No such file or directory: Failed to enable the 'httpready' Accept Filter

Next post: Shell: How To Remove Duplicate Text Lines