Password Protect

From John Freier
Revision as of 16:07, 27 April 2010 by Jfreier (Talk | contribs)

Jump to: navigation, search

Create new .htaccess file, and use the following example below.

AuthUserFile /var/www/html/private/.htpasswd
AuthGroupFile /dev/null
AuthName "My Private Directory"
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>


AuthUserFile: The location of the .htpasswd file. AuthGroupFile: Set to null. AuthName: Title of login. AuthType: Auth Type basic


To create the .htpasswd file, cd to the directory you pointed to above, and use the htpasswd command.

htpasswd -c .htpasswd username