I have setup a web site on CentOS 7 Apache server. With following configuration.
01 02 03 04 05 06 07 08 09 10 11 12 | <VirtualHost 127.0.0.1:80> DocumentRoot /home/hostonnet.in/public ServerName hostonnet.in ServerAdmin admin@Hostonnet.com CustomLog /var/log/httpd/hostonnet.in.log combined <Directory "/home/hostonnet.in/public/"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> |
When i visit the web site i get permission denied error. On checking apache error log, i found
1 2 | Thu Aug 28 04:22:58.645981 2014] [authz_core:error] [pid 1149] [client 59.98.136.70:35550] AH01630: client denied by server configuration: /home/hostonnet.in/public/ [Thu Aug 28 04:23:31.460111 2014] [authz_core:error] [pid 1151] [client 59.98.136.70:35568] AH01630: client denied by server configuration: /home/hostonnet.in/public/index.html |
This is because CentOS 7 use Apache 2.4 and it need “Require all granted” specified in VirtualHost entry.
http://httpd.apache.org/docs/2.4/upgrading.html
To fix, add
1 | Require all granted |
In Directory section of VirtualHost, updated VirtualHost configuration is
01 02 03 04 05 06 07 08 09 10 11 12 13 | <VirtualHost 127.0.0.1:80> DocumentRoot /home/hostonnet.in/public ServerName hostonnet.in ServerAdmin admin@Hostonnet.com CustomLog /var/log/httpd/hostonnet.in.log combined <Directory "/home/hostonnet.in/public/"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all Require all granted </Directory> </VirtualHost> |
Now restart Apache
1 | systemctl restart httpd |
6 Responses to CentOS 7 Apache Error AH01630: client denied by server configuration