You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tonu Mikk <tm...@umn.edu> on 2007/12/17 18:05:05 UTC

[users@httpd] restricting a subdirectory in virtual host

I would like to make a document root folder of a virtual host open to 
public, but restrict access to root/admin folder to certain IP ranges 
only.  Below is what I have currently.  I have restricted the 
survey/admin folder, but everyone can still view pages.  Any suggestions 
on what I am doing wrong?  Thank you,

DocumentRoot /var/www/survey
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/survey>
        Options FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>
    <Directory /var/www/survey/admin>
        Options FollowSymLinks MultiViews
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from localhost
    </Directory>

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


Re: [users@httpd] restricting a subdirectory in virtual host

Posted by Tonu Mikk <tm...@umn.edu>.
Joshua Slive wrote:
> The configuration is basically correct, so the problem is likely
> either you aren't editing the correct config file, you are reloading
> the configuration after editing, of you have an Allow directive
> someplace else in the config (perhaps in a <Location> section)
> overriding this config. (AllowOverride restricts only .htaccess files,
> not other sections of httpd.conf and related.
>   
Thanks Joshua for looking at the directives.  I must have not saved the 
file or not re-started Apache.  It is working as expected now.

Tonu

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


Re: [users@httpd] restricting a subdirectory in virtual host

Posted by Joshua Slive <jo...@slive.ca>.
On Dec 17, 2007 12:05 PM, Tonu Mikk <tm...@umn.edu> wrote:
> I would like to make a document root folder of a virtual host open to
> public, but restrict access to root/admin folder to certain IP ranges
> only.  Below is what I have currently.  I have restricted the
> survey/admin folder, but everyone can still view pages.  Any suggestions
> on what I am doing wrong?  Thank you,
>
> DocumentRoot /var/www/survey
>     <Directory />
>         Options FollowSymLinks
>         AllowOverride None
>     </Directory>
>     <Directory /var/www/survey>
>         Options FollowSymLinks MultiViews
>         AllowOverride None
>         Order allow,deny
>         allow from all
>     </Directory>
>     <Directory /var/www/survey/admin>
>         Options FollowSymLinks MultiViews
>         AllowOverride None
>         Order deny,allow
>         Deny from all
>         Allow from localhost
>     </Directory>

The configuration is basically correct, so the problem is likely
either you aren't editing the correct config file, you are reloading
the configuration after editing, of you have an Allow directive
someplace else in the config (perhaps in a <Location> section)
overriding this config. (AllowOverride restricts only .htaccess files,
not other sections of httpd.conf and related.

Joshua.

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