How to password protect a webdirectory on Leland

ITSS says:
http://www.stanford.edu/services/web/userauth-tutorial.html


Short version:

1. create content of .htaccess file:

AuthUserFile /afs/ir/...[add_the_complete_path_here].../.htpasswd
AuthName MyProtectedStuff(thats optional)
AuthType Basic
require valid-user

2. run:

htpasswd -c /afs/ir/...[add_the_complete_path_here]../.htpasswd myUser
and enter password when prompted
(myUser is the username you pick and so is the password)

Notes:
Make sure the files are rw for you only, for example:
chmod 600 .htaccess
This all goes under the dir you want to protect, obviously.


Posted by cengel at September 15, 2005