Apache basic authentication

From Noah.org
Revision as of 18:53, 5 February 2008 by Root (talk | contribs) (New page: Category:Engineering Add a user to an <em>existing</em> .htpasswd file: <pre> htpasswd /var/www/htdocs/restricted_dir/.htpasswd staff </pre> Create a <em>new</em> .htpasswd file (note...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Add a user to an existing .htpasswd file:

htpasswd /var/www/htdocs/restricted_dir/.htpasswd staff

Create a new .htpasswd file (note the -c option):

htpasswd -c /var/www/htdocs/restricted_dir/.htpasswd staff

Create a .htaccess file:

AuthType Basic
AuthName "Restricted Area"
AuthUserFile /var/www/htdocs/restricted_dir/.htpasswd
Require valid-user