I have a question in apache 2.4. This is my setting in /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>
I got 403 Forbidden when open with http://www0.example.com/private/index.html
But if I took away RequireAll tag, like this
<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>
And then open with http://www0.example.com/private/index.html again, it's show my index content.
Who can tell me why? Or it's my setting have somewhere wrong?
Information in google say if I want use Require, should use with ReqiureAll tag Is that wrong?
Thank you very much, hope you have a good day :)
`Require local granted` i think you forgot to grant as in the rtm https://httpd.apache.org/docs/2.4/howto/access.html – djdomi Aug 22 '19 at 20:26