2009-03-09

Set an HTTP Basic Authentication Password

To set an HTTP Basic Authentication password on a sub-directory within the Apache document root directory tree:

  1. select the password file to use (this file can be created using the htpasswd command).
  2. Create the .htaccess in the directory that is to be protected.
  3. Within the .htaccess file, place Apache configuration directives similar to below.
  4. Create the username/password combination for login to the directory.

Ref: