Apache2.4 解决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

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

<VirtualHost 192.168.10.81:80>
ServerAdmin rocdk890@gmail.com
directoryIndex  index.html index.php index.htm index.shtml login.php
ServerName 192.168.10.81
DocumentRoot /var/www/vhosts/wwwroot
<Directory "/var/www/vhosts/wwwroot">
Options -Indexes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

点赞

发表回复

电子邮件地址不会被公开。必填项已用 * 标注