0

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 :)

Okami
  • 1
  • 1
  • 1
    `Require all denied`
    `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
  • 1
    Hi, I try add granted in Require local, it's not work, too :( Thank's for your suggestion – Okami Aug 23 '19 at 04:22
  • Same issue there, `Permission denied: [client 127.0.0.1:51186] AH00035: access to denied because search permissions are missing on a component of the path` Issue with shared folder mounted from windows host to CentOS vm box – Den Sep 11 '19 at 17:00

0 Answers0