Apache Error Client Denied By Server Configuration

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

‘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
  SuExecUserGroup user group

Restart apache:
# service httpd restart

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

15 comments… add one
  • Westend Nov 29, 2013 @ 18:45

    I have been getting these errors also but when I check them against my blocked IP addresses I found that they were all from IP that I had already blocked. So for me it looks like my IP filters are working.

  • susheel Jan 11, 2015 @ 12:21

    thx for providing all steps :)

  • Lakshmi Jan 23, 2015 @ 11:26

    Hai sir,

    i was as accessing login page of this url, 403 forbidden error was encounterd, evevn i change change permission for that file in cpanel and also while edit .htaccess file internal server error occur

    what i do plz help me


Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.