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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with htaccess and htpassw

Status
Not open for further replies.

HuggerFanta

Technical User
Apr 22, 2002
87
SE
Hello Group, it´s me again!
I have some problems to protect some of my directorys and hope some one cold help me!!!

Here is my problem!

I´ve got a URL like this: This URL gets to a directory thats placed outside the server root. It works fine. But becourse of limited knowlegde I don´t get my password to work and dont´t know how to set it up.

I quite new to apache and wold like some helt with this. Is there any kind person that could guide me to get this working.

I´m running my server on a Windows 98, Apache 1.32 (i think)

Pleas help me!!! --------------------------------------
Kind regards;
HuggerFanta
 
Hi mate,

Firstly, open notepad and enter the following but change the AuthUserFile path to reflect where you are going to place your htpasswd file. (It does not have to be within the protected directory). Click File > Save As > .htaccess
Make sure that the bottom dropdown on the save as dialog is set to all files.


AuthUserFile /AuthGroupFile /dev/null
AuthName "Restricted Area"
AuthType Basic

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



Next open a command prompt. Start > Run > Command and then cd to your Apache/bin directory..

Eg. cd c:\apache\bin

Now type htpasswd and you should get a list of options..

The encryption that I mention here may or may not work for you, if it doesn't try other combinations of the bold part..

htpasswd -cmb .htpasswd username password

I have to use different encrytion methods on some machines..

Now place the htaccess in the directory that you want to protect and place the htpasswd in the directory that you specifed in the htaccess.

Now open your httpd.conf and look for the AllowOverride option, change this to

AllowOverride AuthConfig

Restart apache and that should be you set up..

If you have any problems, post full details of what your error logs say etc..

Hope this helps Wullie

 
OK!
I´ll try this a bit later, and get back to you!!!

Thanx again!!! --------------------------------------
Kind regards;
HuggerFanta
 
Thanx!!!
That realy worked!!!!

I have never done it without you help!!!

But just a question about the .htpasswd file.

This is my user and password:
hugger:$apr1$T./.....$ASXR0n/fnXXwMJ7IlEb2M/

how do I sign in more users???
I don´t know how to type the pass for another user, how do I do???

I have mowe the .htpasswd file to another location!!!

--------------------------------------
Kind regards;
HuggerFanta
 
Hi mate,

You can do that by using the same method as before..

When you open htaccess in the command prompt there is an option to add more users, instead of entering just .htaccess in the prompt, just include the full path to the file..

The other, and maybe easier for you would be to create another file the same as before and just copy and paste the new user into the existing file..

The format should be as follows:

username:password
username:password
username:password
and so on..

Hope this helps Wullie

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top