×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

.htaccess

How to set up .htaccess authentication on Windows. by Wullie
Posted: 25 Apr 02 (Edited 23 Jun 02)

The following is a step by step guide on how to set up htaccess password protection on Windows with Apache.

Firstly, open notepad or another text editor 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).


AuthUserFile /www/domain/directory/.htpasswd
AuthGroupFile /dev/null
AuthName "Restricted Area"
AuthType Basic

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


Click  File > Save As

Make sure that the bottom dropdown on the save as dialog is set to all files.

Now save this file as .htaccess


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 all available options..

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

htpasswd -cmb .htpasswd username password

You should be alerted that the file was created.

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 now try to access the protected directory..

If you have any problems, check your error logs..

Hope this helps

Wullie

sales@freshlookdesign.co.uk
www.freshlookdesign.co.uk

Back to Linux (server) FAQ Index
Back to Linux (server) Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close