Password Protect Apache Directories
Last Updated 8th December 2007
This page describes how to password protect a directory on an apache web server. Only a user with the correct username and password will be able to view the contents of that particular folder. You can decide what the username and password is.
As you can see above there are 2 files of interest:
- .htaccess
- .htpasswd
.htpasswd
This file contains something like..
username:|PaSSwoRD
The username is the literal username and the password is an encrypted version of the password
.htaccess
This file contains something like..
AuthName "Please Login"
AuthType Basic
AuthUserFile /home/mywebserver/.htpasswd
Require valid-user
The first line dictates what the prompt will be
Previous Comments For This Page
No comments yet, be the first !
Add your own comment below and let others know what you think: