Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.


AuthType Basic
AuthName "restricted area"
AuthUserFile /var/www/.htpasswd
require valid-user



upon logging in, it keeps asking for loggin credentials.

share|improve this question
Are you testing on local network? Are you sure there are no proxies or other things in the way that may be confusing things? –  Zoredache Oct 15 '09 at 21:41

1 Answer 1

The .htpasswd file needs to contain the password for the user in the correct encoded format.

user:<encoded password>

You can use the following command to generate the file

htpasswd -c .htpasswd user
share|improve this answer
it doesn't work. –  asdfasdf Oct 15 '09 at 22:19
What doesn't work? The command I gave? The original problem? Is there any activity appearing in the access log for the server? –  emills Oct 16 '09 at 0:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.