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.

When I add an empty .htaccess file to server root (touch .htaccess) I get a 403 error. The samme error appears no matter what I put in the file (I've tried specifying <LIMIT> directives etc).

Example of auth directive I've tried:

<Limit GET POST>
  Order deny,allow
  AuthType Basic
  AuthUserFile /path/to/file
  AuthName "Tits for Haiti etc"
  Require valid-user
</Limit>

Whats the deal?

share|improve this question
1  
whats the access rights on the file? –  Trozz Apr 19 '11 at 14:54
    
@Trozz 600, -rw------- –  o01 Apr 19 '11 at 15:01
1  
that is the problem :) give read rights to the webserver :) –  Trozz Apr 19 '11 at 15:04
    
Thanks @Trozz. Still unsure what permission setting I should set. Id mark your suggestion as the answer if you'd create one :) –  o01 Apr 19 '11 at 15:06
add comment

1 Answer 1

up vote 7 down vote accepted

If the webserver cannot read the file you will get this problem. Make sure that the webserver can read the file by setting the ownership and permissions on the .htaccess appropriately.

share|improve this answer
    
Ok, thanks. What is the appropriate permission setting? 700? 755? –  o01 Apr 19 '11 at 15:04
1  
It depends on what the ownership of the file is. If you can, set the ownership to the user that the webserver runs as then 400 would be sufficient once it's configured how you want it. Other wise 644 should do it. –  Iain Apr 19 '11 at 15:07
    
Excellent:D It totally worked with 644. Thanks again! –  o01 Apr 19 '11 at 15:13
add comment

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.