Apache2.4 虚拟主机(VirtualHost)的配置方法,用来解决client denied by server configuration

client denied by server configuration的解决方法

apache-2.4.x把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


一般虚拟主机的配置模板如下:

 
ServerAdmin [email protected]  
directoryIndex  index.html index.php index.htm index.shtml login.php  
ServerName 192.168.10.81  
DocumentRoot /var/www/vhosts/wwwroot  
 
    Options -Indexes  
    AllowOverride All  
    Order allow,deny  
    Allow from all  
 


你可能感兴趣的:(linux)