.htaccess on Apache/Win XP (help!)
Hello:)
I have Apache 2.0 for Win32 installed on my XP box along with ActiveState's Perl , Sendmail, etc and it all works great. I could'nt be happier!. However, I have tried to get .htaccess working until I am blue in the face and while this is *supposed* to be a simple thing, it has proven to be very problematic for me. What am I doing wrong here please?.
Ok, here's the scoop...
I have my .htpasswd file installed in:
"C:Program Files\Apache Group\Apache2\".
The .htpasswd file contains exactly the following:
shoefly:greenman
I have my .htaccess file installed in the folder I want to password protect. That folder is here:
"C:Program Files\Apache Group\Apache2\htdocs\private".
The .htaccess file contains exactly the following (but I've tried a number of variations):
AuthUserFile /Apache2/.htpasswd
AuthGroupFile /dev/null
AuthName "Sound Effects Library"
AuthType Basic
require valid-user
The only other thing I've done is to change the "AllowOverride" directive in the Apache /conf/httpd file from "None" to "All" (I've also tried others).
My problem is that while the login screen comes up with no problem when I attempt to enter the protected folder, it will not accept the username/password I used in the .htpasswd file. I've tried it encrypted and plain text.
Finally, is that little utility in Apache's bin folder (htpasswd.exe) really necessary in order to create password-protected folders and use .htaccess or can I just do this manually with a few simple text files in NotePad.
Well, Hope I've explained this ok. Thank's in advance for any help on this perplexing issue (I'm getting desparate now!)
mairving posted this at 18:40 — 5th April 2004.
They have: 2,256 posts
Joined: Feb 2001
You need to create the password using the .htpassword utility.
Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states
CheeseMan posted this at 19:20 — 5th April 2004.
They have: 12 posts
Joined: Apr 2004
I just want to say that I really appreciate your help. I can change the name of the .htaccess file to something like "secure.htaccess" (since I've heard that Windows does'nt like files without a prefix) if you think it would work better. I tried the htpasswd.exe tool but when I ran it (by simply double-clicking it) it brought a DOS screen up for about 2 seconds and then it dissapeared before I was able to read it. Does the password have to be encrypted?. I tried it earlier using an .htaccess online encryption tool but it still did'nt work.
mairving posted this at 19:28 — 5th April 2004.
They have: 2,256 posts
Joined: Feb 2001
Run it from the command line, Start/Run/cmd...
Welcome to WMF.
CheeseMan posted this at 19:42 — 5th April 2004.
They have: 12 posts
Joined: Apr 2004
Thank's for the welcome!. Ok, so in my .htpasswd file, located at...
"C:Program Files\Apache Group\Apache2\"
I have the following...
shoefly:greenman
Now, based on this, what path do I use in the following command I was given earlier? (I don't have a "/usr/local/apache/passwd/passwords" path anywhere on my machine)...
htpasswd -c /usr/local/apache/passwd/passwords username
I assume the "-c" tells Apache that I am using drive c and that the "username" is the username I wish to use, correct?
Thank's again for helping out an .htaccess newbie:)
mairving posted this at 19:58 — 5th April 2004.
They have: 2,256 posts
Joined: Feb 2001
Actually you are going to have to change things a little since Windows deals with paths differently:
htpasswd -c "C:\program files\apache group\apache2...\rest of path"
You have to use backslashes and put quotes around it since some of the directories contain spaces.
Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states
CheeseMan posted this at 20:20 — 5th April 2004.
They have: 12 posts
Joined: Apr 2004
Well, I managed to bring up the CMD/DOS screen and run the Apache htpasswd utility but I need to be absolutely sure of the path and understand what I'm about to do here. Is the path I am specifying one which goes to the .htpasswd file itself and do I need to include it's name in the path like this...
htpasswd -c "C:\program files\apache group\apache2\.htpasswd"
or like this...
htpasswd -c "C:\program files\apache group\apache2\"
Does the cAsE of the path matter?. Should I give the .htpasswd file a prefix first (ie; secure.htpasswd) because I'm running WinXP?. Finally, after I do this, will I be able to go into this folder and see that the password has been encrypted?.
Sorry for all the questions btw...ahhh!!
Thank's
CheeseMan posted this at 20:33 — 5th April 2004.
They have: 12 posts
Joined: Apr 2004
It worked!!...it worked!!!. I'm in seventh heaven!. Thank you everyone:). I've been fighting with this thing for days now!!.
mairving posted this at 21:11 — 5th April 2004.
They have: 2,256 posts
Joined: Feb 2001
Glad you got it working. As an FYI, the case doesn't matter in Windows but does in 'Nix (Linux, BSD, Unix, Mac).
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.