Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


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

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.