Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Apache Error Client Denied By Server Configuration  (Read 1243 times)

0 Members and 1 Guest are viewing this topic.

joseletk

  • Guest
Apache Error Client Denied By Server Configuration
« on: June 09, 2018, 07:13:31 pm »
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:

Code: [Select]
<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:

Code: [Select]
<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
==========================================================================