Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do htpasswd in apache w winXP

Status
Not open for further replies.

jt101

Programmer
Mar 15, 2002
4
0
0
US
How can i make an htpasswd file using apache in Windows XP?
Also i used a working htpasswd file from my linux
partitions and it STILL didnt work. It asked for the user name and pass bout wouldnt accept it.
PLEASE dont tell me this cant be done :/

Thanks
 
Hi mate,

If you look in your Apache/bin folder you will see a htpasswd app to do this for you..

Using the command line, call the file and it will give you the options.

The way I do it is to use

htpasswd -cmb filename username password

This creates a file with the user and pass you supply..

If you have any problems, just ask..

Hope this helps
Wullie

 
Thank you. And I actualy did find it before you replyed.
Now a new one. Ive made the passwords but apache cant FIND em. Here is my code in thre conf file:

<Directory &quot;G:/Program Files/Apache/Apache/htdocs/winmember&quot;>
AuthName &quot;Dream Team&quot;
AuthType BASIC
AuthUserFile &quot;G:/Program Files/Apache/Apache/bin/passwords&quot;
require valid_user
</Directory>
And all diectories and file names are correct.
it will ask for the user and pass but wont accept it :/

And thanks again
 
I don't think the forward-slash path syntax is the issue. Since you and ifincham helped me get mine running, I've been successful with the following format for .htaccess:

AuthUserFile &quot;D:/Apache Group/Apache/htdocs/domain/protectdir/.htpasswd&quot;
AuthGroupFile /null
AuthName &quot;Restricted Area&quot;
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>

Make sure the password file is in the directory to which you point. Also, someone in this forum noted that only *unencrypted* password files work in Windows. Haven't verified that myself, only that unencrypted does work for me. Make sure you create your password file unencrypted; then if it works, test it encrypted. Syntax for .htpassword is:

username:password

and you can create it in Notepad.
 
Hi all,

I use encrypted passwords by following the directions in my previous post on this thread..

I am not sure if this is the correct way to do this but it works fine for me..

Try copying this into your .htaccess

test:$apr1$pP/.....$pV5k7s44mezFhG7cSb170.

Enter using test for both user and pass and see if that works..

If it does, follow my previous post and create one of your own..

Hope this helps Wullie

 
Hi,

I don't use win32 more than I realy have to but the default encryption has worked for me out of the box :

(first cd to ... Program Files/Apache Group/Apache/bin )

htpasswd -cb .htpasswd user1 pass1
(use 'c' to create the file first time)
htpasswd -b .htpasswd user2 pass2
htpasswd -b .htpasswd user2 pass3

After that move the .htpasswd to your preferred location - as pointed to by AuthUserFile. Or use the full path instead of '.htpasswd' if you prefer.


Regards

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top