[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: apache2 directory protection

On 09-12-04 11:14:38, vr wrote:
> I am having trouble getting apache2 recognizing directory protection.
> I've created a directory /var/www/mydir and created .htaccess &
> .htpasswd files in there but am never prompted for login.
> .htaccess
> AuthUserFile /var/www/mydir/.htpasswd
> AuthType Basic
> AuthName "test"
> require valid-user
> .htpasswd
> mytestuser:<hashedScramble>
> I understand that .htpasswd should reside someplace else and even
> moved it to rule this out but is the above not enough on a default 
> installation of apache2 under lenny to protect a directory?

Your httpd.conf must "AllowOverride AuthConfig" for /var/www/mydir:

#Password-protected access to mydir.
<Directory "/var/www/mydir">
    AllowOverride AuthConfig

The httpd docs at <http://httpd.apache.org/docs/2.2/> are useful for 
this sort of thing.  You might want to look at the tutorials.

TonyN.:'                       <mailto:tonynelson@georgeanelson.com>
      '                              <http://www.georgeanelson.com/>

Reply to: