PDA

View Full Version : [ubuntu] Password protecting a file - problem


R.Bucky
October 12th, 2008, 10:57 AM
I am attempting to password protect a php page on my server. I added the following code to my httpd.conf file and created a password file. No problem.

<Files filename.php>
AuthType Basic
AuthName "Protected Access"
AuthUserFile /var/www/access/htpasswd
Require valid-user
</Files>

The password dialog box pops up when I access my page, type in the password, and the dialog box comes back. Any ideas why I this is not letting me in?

My stats: Hosting my own web pages using Apache2, Ubuntu7.10, php5, mysql ( a standard LAMP)

bluefrog
October 12th, 2008, 03:36 PM
try
[CODE]
<Files filename.php>
AuthType Basic
AuthName "Protected Access"
AuthUserFile /var/www/access/htpasswd
<Limit GET>
Require valid-user
</Limit>
</Files>

lykwydchykyn
October 12th, 2008, 11:01 PM
Checkout /var/log/apache2/error.log. It usually gives a pretty explicit error about why login fails.