Create a
.htaccess file in the directory to which you want password control with these entries:
AuthUserFile /etc/httpd/conf/.htpasswd
AuthGroupFile /dev/null
AuthName EnterPassword
AuthType Basic
require user peter
Remember this password protects the directory and all its subdirectories. The
AuthUserFile tells Apache to use the
.htpasswd file. The
require user statement tells Apache that only user peter in the
.htpasswd file should have access. If you want all
.htpasswd users to have access, replace this line with
require valid-user. AuthType Basic instructs Apache to accept basic unencrypted passwords from the remote users' Web browser.