Page 1 of 1

Password protect directory with htaccess

Posted: Tue Nov 20, 2007 4:56 am
by shiznatix
I have setup password protected directories through htaccess several times but for some reason it is not working this time. I have a fresh install of Ubuntu and I have been trying to get my local install of apache to password protect the web root so basically you can't access my computers webserver without a password.

I have this in my /etc/apache2/apache2.conf file:
<Directory /var/www>
Options Indexes Includes FollowSymLinks MultiViews
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>
This in my .htaccess file located in /var/www/
AuthName "Bork Bork"
AuthType Basic
AuthUserFile /var/www/.htpasswd
Require user panda
This in my .htpasswd file located in /var/www/
panda:/feedpd9kra8E
But no matter what I do (yes, i restarted apache by sudo /etc/init.d/apache2 restart) but nothing. It won't prompt me for a password or anything. What in the world am I doing wrong here??

Posted: Tue Nov 20, 2007 8:10 am
by VladSun
Hm, strange ...
Check this line:

Code: Select all

AccessFileName .htaccess
in your httpd.conf

Posted: Tue Nov 20, 2007 8:56 am
by VladSun
Also, add:

Code: Select all

Satisfy All

in your .htaccess file.