我对 apache 2.4 有一个疑问。这是我在 /etc/httpd/conf.d/vhost-www0.conf 中的设置
<VirtualHost *:80>
DocumentRoot "/var/www/virtual"
ServerName www0.example.com
<Directory "/var/www/virtual">
<RequireAll>
Require all granted
</RequireAll>
</Directory>
<Directory "/var/www/virtual/private">
<RequireAll>
Require all denied
Require local
</RequireAll>
</Directory>
</VirtualHost>
我打开时出现 403 Forbiddenhttp://www0.example.com/private/index.html
但如果我去掉 RequireAll 标签,就像这样
<VirtualHost *:80>
DocumentRoot "/var/www/virtual"
ServerName www0.example.com
<Directory "/var/www/virtual">
<RequireAll>
Require all granted
</RequireAll>
</Directory>
<Directory "/var/www/virtual/private">
Require all denied
Require local
</Directory>
</VirtualHost>
然后打开http://www0.example.com/private/index.html再次,它显示我的索引内容。
谁能告诉我为什么?还是我的设置有问题?
谷歌中的信息说如果我想使用 Require,应该使用 ReqiureAll 标签,这是错误的吗?
非常感谢,祝你度过愉快的一天:)