apache AH01630: client denied by server configura

  • 来源:
  • 更新日期:2018-05-15

摘要:apache AH01630: client denied by server configuration错误解决方法 出现这个错误的原因是,apache2.4 与 apache2.2 的虚拟主机配置写法不同导致。 apache2.2的写法:  ServerName fdipzone.demo.com  DocumentRoot \"/home/fdipz

apache AH01630: client denied by server configuration错误解决方法

002UASMrzy7605pjKJv15&690.jpg

出现这个错误的原因是,apache2.4与apache2.2的虚拟主机配置写法不同导致。

apache2.2的写法:

<VirtualHost*:80> ServerNamefdipzone.demo.com DocumentRoot"/home/fdipzone/sites/www" DirectoryIndexindex.htmlindex.php <Directory"/home/fdipzone/sites/www"> Options-Indexes+FollowSymlinks AllowOverrideAll Orderdeny,allow Allowfromall </Directory> </VirtualHost>

如果在2.4中使用以上写法就会有apache AH01630: client denied by server configuration错误。
解决方法,apache2.4中

Orderdeny,allow Allowfromall Allowfromhostip

修改为:

Requireallgranted Requirehostip

修改后的配置如下:

<VirtualHost*:80> ServerNamefdipzone.demo.com DocumentRoot"/home/fdipzone/sites/www" DirectoryIndexindex.htmlindex.php <Directory"/home/fdipzone/sites/www"> Options-Indexes+FollowSymlinks AllowOverrideAll Requireallgranted </Directory> </VirtualHost>

 

apache-2.4.x把NameVirtualHost给取消,现在配置虚拟主机不需要再配置NameVirtualHost了.
删除了 Order deny,allow 和 Order allow,deny
把 Deny from all 替换成了 Require all denied
把Allow from all 替换成了 Require all granted
然后还把 Allow from 192.168.10.21 这样的语句给替换成了 Require host 192.168.10.21