Difference between revisions of "Password Protect"
From John Freier
(2 intermediate revisions by the same user not shown) | |||
Line 9: | Line 9: | ||
require valid-user | require valid-user | ||
</Limit> | </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 | ||
+ | |||
+ | To add another user type, | ||
+ | htpasswd .htpasswd foo | ||
+ | |||
+ | To delete a user, just vi to the file and delete the line. |
Latest revision as of 15:08, 27 April 2010
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
To add another user type,
htpasswd .htpasswd foo
To delete a user, just vi to the file and delete the line.