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

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 15 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
15 comments… add one
  • TrueColorTech Apr 8, 2009 @ 17:29

    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.

  • TrueColorTech Apr 8, 2009 @ 18:26

    It turned out to be an invalid vhost config and not the allow directives, thanks for the stating place!

  • FingAZ Sep 17, 2010 @ 11:08

    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!


    • Galgon Oct 13, 2010 @ 18:28

      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!

      • Galgon Oct 14, 2010 @ 12:39

        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. :)

  • krishna Dec 6, 2010 @ 9:09

    Thanks a lot I got useful information

  • Alex Apr 9, 2011 @ 15:39

    Thanks a lot! This really helped!

  • sdsds Apr 20, 2011 @ 12:46


  • sinyo Jul 6, 2011 @ 5:34

    now my server run well

  • Gary Jul 15, 2011 @ 4:31

    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”?

  • Dharmi Jan 8, 2013 @ 0:33

    exactly what I was looking for…thx

  • Edgars Zagorskis Oct 17, 2013 @ 12:42

    Hi. Thanks for the tip, but it still didnt work when i tried accessing a server located on a local machine
    So i found this article which also mentions ACL and it solved by adding this to the section which you had above.
    Allow from ::1/128

  • 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.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum