School of Ocean and Earth Science and Technology
Univ. of Hawaii at Manoa RCF
 

How To Password Protect a Website:
---------------------------------

  

In the directory you would like to give limited access, create a file 
called .htaccess.  Make sure it is world readable.

In the file, type the following:

  AuthUserFile    /home/doo/scooby/.htpasswd	-- Location of passwd file.
  AuthGroupFile   /dev/null
  AuthName        ByPassword
  AuthType        Basic

  
  require user scrappy
  


The AuthUserFile is where the passwords will held.  Make sure it is in 
an accessible directory, but a different directory than the one you 
want to limit access.

The Limit command can limit access via "GET, POST and PUT".  POST is 
mainly used for CGI scripts.

Next, create the passwords using htpasswd located on Imina in the 
following directory /httpd/bin.

Here's the command:

	/httpd/bin/htpasswd -c /full-directory-where
		password-file-is/.htpasswd username
		
It will prompt you for a password which is stored in the /directory/.htpasswd 
file.  Make sure this file is also world readable.


Add additional passwords with the following command:
	/httpd/bin/htpasswd /directory/.htpasswd username
	
	
For full details, please visit the following URL:
	http://apache-server.com/tutorials/ATusing-htaccess.html