Author |
|
Steebin
Joined: 05 Mar 2007 Posts: 3
|
Posted: Mon 05 Mar '07 23:39 Post subject: htaccess problems |
|
|
Hi, I tried to setup an .htaccess file on my server to protect a directory and it seems to work on the protection part but the login promt just keeps refreshing and then eventually gives me a 401 error. Anyone have any idea why this happens? I am running windows server 2003. Thanks |
|
Back to top |
|
VoodooMill
Joined: 11 Jan 2007 Posts: 60
|
Posted: Tue 06 Mar '07 2:35 Post subject: |
|
|
This happens when the authentication information provided by the user doesn't match the information in the authentication source.
Start by making sure you are authenticating against the correct AuthUserFile. If you are using AuthGroupFile make sure it is correct also.
Next, be sure you created the appropriate entries in your AuthUserFile location.
So if you have AuthUserFile C:/Auth/.htpasswd make sure you've run htpasswd from your Apache22\bin folder to get the username/password into the file you are pointing to with AuthUserFile.
<drive>:\...\Apache22\bin>> htpasswd -b C:\Auth\.htpasswd <username> <password>
That is a good start. Confirm the above is good to go and let us know. If it doesn't fixy we can go from there.
Also, please post the contents of your .htaccess file. That'll keep us from having to guess what you may have left out of your config. |
|
Back to top |
|
Steebin
Joined: 05 Mar 2007 Posts: 3
|
Posted: Tue 06 Mar '07 17:59 Post subject: |
|
|
Here is my .htaccess file, I created the password file using the dos commands and its a simple login and pw nothing special, so im not typing the username and pw wrong
Code: |
AuthType Basic
AuthName "My Private Area"
AuthUserFile /www/HF/xd/arch/htpasswd.txt
<Limit GET POST>
Require valid-user
</Limit> |
Thanks for the help |
|
Back to top |
|
VoodooMill
Joined: 11 Jan 2007 Posts: 60
|
Posted: Tue 06 Mar '07 19:04 Post subject: |
|
|
Hi again Steebin,
Try an absolute path for the AuthUserFile instead of a relative path.
AuthUserFile <drive>:/.../www/HF/xd/arch/htpasswd.txt |
|
Back to top |
|
Steebin
Joined: 05 Mar 2007 Posts: 3
|
Posted: Tue 06 Mar '07 21:08 Post subject: |
|
|
ahh thx, that did the trick, figures it was something simple, thanks again |
|
Back to top |
|
htmldad
Joined: 06 Mar 2007 Posts: 5 Location: US
|
Posted: Tue 06 Mar '07 22:14 Post subject: 2.2.4 problems |
|
|
I too downloaded the 2.2.4 binary version of Apache. I'm usings windows xp os.
I think my problem is in windows because I cannot telnet localhost 80. I have posted and emailed everywhere with no response. This forum included.
I am a green horn and would like to get an answer so I continue to learn PHP. Sorry I can't help. Just wanted to offer some sympathy. |
|
Back to top |
|
htmldad
Joined: 06 Mar 2007 Posts: 5 Location: US
|
Posted: Tue 06 Mar '07 22:32 Post subject: sorry |
|
|
Sorry, you had to listen to my sob story. I replied to the wrong message. |
|
Back to top |
|