[Home]Password protect

HomePage | RecentChanges | Preferences | Newbie Help

Category HTML FAQ -:- Category Other FAQ

Mark Scott says on 21 May 2001 03:38:31: in alt.html --

If you want a single username and password for the site then you want the following:

1) Make sure your Apache configuration (usually /etc/httpd/conf/httpd.conf) has the line:

   AccessFileName .htaccess

2) Put a .htaccess file in the directory that contains the files and subdirectories you want protected containing:

   AuthName "Magic Website"
   AuthType Basic
   AuthUserFile /path/to/passwd        #(see below)
   Require valid-user

3) Use htpasswd to create a passwd file (preferably in a non-web accessible directory):

   htpasswd -c /path/to/passwd username

where username is the username you want to add a password for, e.g.

   htpasswd -c /path/to/passwd magic

(When adding further users, drop the '-c', and type 'htpasswd --help' or 'man htpasswd' for further help)

For a more in-depth discussion and clarification about some of the things I've done, have a read of this: http://www.apacheweek.com/issues/96-10-18#userauth

For CuteFTP 4.0 from the site manager, select the profile you're working with and click edit.

bottom of the options. You should be able to see and delete the .htaccess and .htpassword files now.
See also

htaccess tutorials --

specifically related to password protection --

See http://cgi.resourceindex.com/Programs_and_Scripts/Perl/Password_Protection/

I have use Account Manager LITE with very good results. -- Jerry Muelver

PHP tutorials and solutions at http://www.hotscripts.com/PHP/Tips_and_Tutorials/User_Authentication/

Comments --

Javascript workaround to the htaccess password pop-up:

HomePage | RecentChanges | Preferences | Newbie Help
This page is read-only | View other revisions
Last edited August 2, 2003 10:48 pm (diff)

This FAQ is happily hosted by Betadome Digital Media