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

I have a Ubuntu running an Apache 2.2 webserver, and I'd like to password protect a directory that I'm serving, with all of its files and subdirectories, and be given a security prompt

Here's what I have in the virtual server web directory I'd like to protect:

AuthName "Dialog prompt"
AuthType Basic
AuthUserFile /home/dev/.htpasswd
Require valid-user

I also have a valid .htpasswd file in /home/dev. After researching a bit on serverfault, I learned that it may be necessary to give file and directory ownership to the owner of the apache process, which I did.

But at every time I try this, the website in this directory has loaded.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Without showing us your complete apache configuration, it will be difficult to determine exactly the cause of your problem.

Anyway, I think you need to look at AllowOverride directive. You need to allow at least AuthConfig. You can for simplicity allow ALL. Don't forget to reload/restart your apache server after the changes.

share|improve this answer
    
Correct, to use .htaccess I would have had to use the AllowOverride directive from within http.conf. Thanks, this helped me get to the answer –  jarede May 22 '12 at 17:25
    
@jarede: If you find this useful, you can mark the answer as accepted :) –  Khaled May 23 '12 at 7:27

Your Answer

 
discard

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.