Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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'm trying to add a .htaccess file to a directory, everything works, the path to .htpasswd is working fine.

My contents are:

AuthUserFile /root/passwords/apache2/.htpasswd
AuthGroupFile /dev/null
AuthName "VNstats"
AuthType Basic

<Limit GET POST>
require valid-user

The directory /root/passwords/apache2 is chowned to www-data.

However it still refuses to show an authentication box.

I started troubleshooting, and found some tutorials to edit httpd.conf or apache2.conf and add AllowOverride All. But everytime I do that, I get an error when reloading Apache2 that AllowOverride All is not allowed there.

It is a clean apache2 install, do I need to enable some mods? Where can I add AllowOverride All? What am I overlooking?

EDIT: I added this to httpd.conf:

<Directory /var/www/>
AllowOverride All
share|improve this question
up vote 1 down vote accepted

just curious "The directory /root/passwords/apache2 is chowned to www-data." <= okay, but what is /root permissions ? 700 ?

share|improve this answer
yes indeed you are correct – Lucas Kauffman Aug 18 '11 at 16:49
I moved the folder to /etc/apache2 and now it is working fine :p thanks for reminding me :) – Lucas Kauffman Aug 18 '11 at 16:53

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.