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 be 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