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

I just edited the htaccess file to include:

AuthType Basic

AuthName "My Protected Area"

AuthUserFile /home/path/to/public_html/

Require valid-user

I then created a htpasswd file via the htpasswd command. I have enabled the module: LoadModule authn_file_module modules/ in the Apache configuration.

Now, when I load the page I now get a 500 error and apache log says "configuration error: couldn't check user. No user file?: /"

share|improve this question
What does your error_log say? – Niall Donegan Jan 6 '11 at 15:06
/path/to/public_html/.htaccess: Invalid command 'AuthUserFile', perhaps misspelled or defined by a module not included in the server configuration – bacord Jan 6 '11 at 15:17

The AuthUserFile command is provided by the mod_authn_file module. Make sure your Apache configuration includes something along the lines of:

LoadModule authn_file_module modules/

This would need to go into the main server configuration, not in a .htaccess file. If you don't have access to the main server configuration you'll need to contact your local administrator.

share|improve this answer
That allowed for for some progress.. I have edited my post to include the new apache error – bacord Jan 6 '11 at 15:29
If you're config really has AuthUserFile /home/path/to/public_html/ you've got a problem, because that's not a path to a file. The AuthUserFile directive specifies the path to an htpasswd-style file containing usernames and passwords. – larsks Jan 6 '11 at 15:34
No I have included the actual path to my directory I just didn't include it in the post – bacord Jan 6 '11 at 15:38
Right, it shouldn't be a path to a directory. It should be a path to a file. – larsks Jan 6 '11 at 16:27
You should also make sure that the webserver has read permissions on the AuthUserFile. Just a thought :) – TrueDuality Jan 6 '11 at 16:31

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.