Apache搭建創(chuàng)建完虛擬主機(jī)之后,搭建完成之后卻報(bào)錯(cuò),提示為:“apache AH01630: client denied by server configuration”,這個(gè)報(bào)錯(cuò)是因?yàn)閍pache2.4與apache2.2的虛擬主機(jī)配置寫(xiě)法不同所致,因?yàn)閍pache2.2的寫(xiě)法是:
[plain] view plain copy 在CODE上查看代碼片派生到我的代碼片
<VirtualHost *:80>
ServerName fdipzone.demo.com
DocumentRoot "/home/fdipzone/sites/www"
DirectoryIndex index.html index.php
<Directory "/home/fdipzone/sites/www">
Options -Indexes +FollowSymlinks
AllowOverride All
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
所以在2.4中使用以上寫(xiě)法就會(huì)有apache AH01630: client denied by server configuration錯(cuò)誤。解決方法如下:
[plain] view plain copy 在CODE上查看代碼片派生到我的代碼片
Order deny,allow
Allow from all
Allow from host ip
修改為
[plain] view plain copy 在CODE上查看代碼片派生到我的代碼片
Require all granted
Require host ip
修改后的配置如下:
[plain] view plain copy 在CODE上查看代碼片派生到我的代碼片
<VirtualHost *:80>
ServerName fdipzone.demo.com
DocumentRoot "/home/fdipzone/sites/www"
DirectoryIndex index.html index.php
<Directory "/home/fdipzone/sites/www">
Options -Indexes +FollowSymlinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>