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've set up my VPS, installed httpd under yum install httpd and restarted the server. When I've added a .htaccess to /var/www/html nothing works at all, which inside the htaccess file has an authentication required and does not show anything except gives me an access to the "protected" directory.

AuthType Basic
AuthName "Private"
AuthUserFile /var/www/html/.htpasswd
Require valid-user

The .htpasswd exists, but still nothing works at all. I've also tried a simple rewrite rule and that doesn't even work.

How do you get apache to work (or run properly)? Everything is just running and working fine except apache.

My server is running Centos 5 x86_64 Standard.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You need to allow overrides for htaccess to work.

See this http://httpd.apache.org/docs/2.0/mod/core.html Look at "AllowOverride"

share|improve this answer
    
Alright. But that isn't helping, do I have to edit the httpd.conf or put it in a .htaccess file on the root of /var/www/html? –  MacMac May 20 '11 at 11:45
    
In httpd.conf find "<Directory "/var/www/html">" Below that, look for "AllowOverride None" - now check out the docs I linked and change "None" to your preference. And reload apache for the changes to be applied. –  Frands Hansen May 20 '11 at 11:48
    
Thanks. It worked. –  MacMac May 20 '11 at 11:54

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.