Apache搭建創建完虛擬主機之后,搭建完成之后卻報錯,提示為:“apache AH01630: client denied by server configuration”,這個報錯是因為apache2.4與apache2.2的虛擬主機配置寫法不同所致,因為apache2.2的寫法是:
[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中使用以上寫法就會有apache AH01630: client denied by server configuration錯誤。解決方法如下:
[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>