2

I need to restrict access to x number of folders with a password, this much i have working.

However i now need to add a folder that's called "public" that is accessible without a password. this needs to be at the same level as the other folders. I cant change the layout of the folders as this would damage existing links.

OSX 10.4.11 Apache 1.3.41

Here is my config, so far it will show the root of the site without needing a password but it is still asking for password for the public folder. I would prefer not to use .htaccess files but if its my only option i will.

<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot "/Library/WebServer/example.com/www/"
CustomLog "/var/log/httpd/access_log" "%h %l %u %t \"%r\" %>s %b"
ErrorLog "/var/log/httpd/error_log"
    <Directory "/Library/WebServer/example.com/www/">
            Options All +Indexes -ExecCGI +Includes +MultiViews
            AllowOverride None
            IndexOptions NameWidth=*
            Order Deny,Allow
            Allow from all                         
    </Directory>
    <Directory "/Library/WebServer/example.com/www/public/">
            Options All +Indexes -ExecCGI +Includes +MultiViews
            AllowOverride None
            IndexOptions NameWidth=*
            Order Deny,Allow
            Allow from all
    </Directory>
    <Directory "/Library/WebServer/example.com/www/*/">
            Options All +Indexes -ExecCGI +Includes +MultiViews
            AllowOverride None
            IndexOptions NameWidth=*
            AuthName "Restricted Area"
            AuthType Basic
            AuthUserFile /Library/WebServer/example.com/.htpasswd
            require valid-user
    </Directory>
</VirtualHost>

Im aware of the problems with AuthType Basic, also aware of the problems with running a very old version of Apache.

1 Answer 1

3

Add a Satisfy Any to the end of your Directory directive:

<Directory "/Library/WebServer/example.com/www/public/">
        Options All +Indexes -ExecCGI +Includes +MultiViews
        AllowOverride None
        IndexOptions NameWidth=*
        Order Deny,Allow
        Allow from all
        Satisfy Any
</Directory>

client will be granted access without prompting for a password.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .