You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Juan Jesús Cremades Monserrat <re...@gmail.com> on 2011/01/26 12:16:33 UTC

[users@httpd] Allow & Deny Access to Directories

Hi,

I have a Server (server1) with the next directories:

   - /var/www/html/dir1
   - /var/www/html/dir2
   - /var/www/html/dir3
   - /var/www/html/dir4

And I want redirect an external URL across a Proxy (proxy1) to 'dir1'

I tried this meaning in the "httpd.conf" at proxy1:

<VirtualHost *>
  ServerName external_url
  ProxyPass /  http://server1/
  ProxyPassReverse /  http://server1/
  ProxyRequests Off
  ProxyPreserveHost On
    <Location /dir2>
      order deny,allow
      deny from all
    </Location>
    <Location /dir3>
      order deny,allow
      deny from all
    </Location>
    <Location /dir4>
      order deny,allow
      deny from all
    </Location>
    <Location /dir1>
      order deny,allow
      allow from all
    </Location>
</VirtualHost>

It works, but I would like some brief and efficient meaning . Thanks

Re: [users@httpd] Allow & Deny Access to Directories

Posted by Tom Evans <te...@googlemail.com>.
2011/1/26 Juan Jesús Cremades Monserrat <re...@gmail.com>:
> Hi,
> I have a Server (server1) with the next directories:
>
> /var/www/html/dir1
> /var/www/html/dir2
> /var/www/html/dir3
> /var/www/html/dir4
>
> And I want redirect an external URL across a Proxy (proxy1) to 'dir1'
> I tried this meaning in the "httpd.conf" at proxy1:
> <VirtualHost *>
>   ServerName external_url
>   ProxyPass /  http://server1/
>   ProxyPassReverse /  http://server1/
>   ProxyRequests Off
>   ProxyPreserveHost On
>     <Location /dir2>
>       order deny,allow
>       deny from all
>     </Location>
>     <Location /dir3>
>       order deny,allow
>       deny from all
>     </Location>
>     <Location /dir4>
>       order deny,allow
>       deny from all
>     </Location>
>     <Location /dir1>
>       order deny,allow
>       allow from all
>     </Location>
> </VirtualHost>
> It works, but I would like some brief and efficient meaning . Thanks

<Location />
  Order allow,deny
  Allow from all
</Location>

<LocationMatch ^/dir(?!1/)>
  Deny from all
</LocationMatch>

Cheers

Tom

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org