htaccess
What do I have to put in an .htaccess file and .htpasswd file so that it asks me for my username and password to access a directory?
I know it's got to be something simple, but the more I looked at apache.org the more I got turned around clicking on different links for directives and what not. Can someone tell me what it is I have to do to make that work. And if in my .conf file for the virtual host I have Code:
<Directory "/srv/blah blah blah - path to the virtual hosts root directory> Thank you for your help, I want to password protect the clients log and webalizer files as well as be able to put it in my faqs for future clients. Much appreciated. |
First you have to change Allowoverride to AuthConfig
Then create a .htaccess file in the directory you want to protect, with something lke this: Code:
AuthName "Protected Area" |
So you have to create a new <directory> </directory> file for every folder I want to password protect for each virtual host that wants to password protect one or more of their directories. Man, this is really turning out to be some work lately.
|
You can do this, or you can change the Allowoveride for the whole DocumentRoot which then makes apache a little slower because for every request to different directories it has to search if there is a .htaccess file
|
I dont think my servers apache was configured with this ability because when I replaced Allowoverride None with AuthConfig then restarted apache and it said that line was no good. Im gonna start looking for a specialist in my area that makes home/office calls, and get him to install the mail server proerly so that clients can get their email, right now they can send out, but not receive anything, and take care of the little things like this I'll watch over him like a hawk with notebook in hand taking full notes of what he's doing in case I have to do it again. Im getting it (the information from books and forums, but things are moving way too slow), I need a fully running server with webmin or some inexpensive control panel lastweek so I can start hitting up th esmall business's in my area and get their business.
Thanks for the try, P.S. It's SuSE 9.3 PRO. |
All times are GMT -5. The time now is 10:34 AM. |