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.

Password protecting a directory seems like a chore using .htaccess file. Is there no simpler way to do this?

share|improve this question
2  
What is the problem you are trying to solve? –  Mircea Vutcovici Sep 14 '11 at 18:59
    
I have a directory with some personal info that only I should be able to access via a browser. –  raheel Sep 14 '11 at 20:02
    
Well no. That problem you have is already solved with .htaccess, as you wrote. Do you have a specific .htaccess that is too complicated? Can you provide a sample of it? –  Mircea Vutcovici Sep 14 '11 at 20:11
add comment

2 Answers

up vote 5 down vote accepted

Nope, that is almost dead simple once you understand it. Most of the other options are far more complex.

Keep in mind that you don't actually have to use an htaccess file if you have access to the Apache configuration. Just put the same settings in a your main configuration. But that really isn't any simpler, you are just modifying a different file.

share|improve this answer
    
Wouldn't changing the setting in the main apache configuration provide an additional layer of security? –  JMC Sep 14 '11 at 19:16
    
Not sure how it should make a big deal one way or the other. Assuming the filesystem permissions are setup properly, you place the password database outside the web root and you have the standard <Files ~ "^\.ht"> ... Deny from all</Files> block in place in your main config. –  Zoredache Sep 14 '11 at 19:49
add comment

No, using mod_auth and a .htaccess file is pretty much as simple as it gets if you want password protection.

share|improve this answer
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.