/my/paulfm:www-menet/public-html/share/passtest/.htauth/ as /homedirs/h/paulfm/public-html/share/passtest/.htauth//my/paulfm:www-menet/public-html/share/passtest/.htaccess as /homedirs/h/paulfm/public-html/share/passtest/.htaccess/my/paulfm:www-menet/public-html/ as /homedirs/h/paulfm/public-html/.
MORE COMPLETE PATH INFO | ||
| URL Path | Unix Client location | Real location on Web Server |
|---|---|---|
| http://www.me.umn.edu/ | /g/www-me/ | /data/me/ |
| http://www.menet.umn.edu/ | /g/www-menet/ | /data/menet/ |
| http://www.menet.umn.edu/~{user}/ | /my/{user}:www-menet/public-html/ | /homedirs/h/{user}/public-html/ |
NOTE: use relative paths in web pages or use the Real Location (references should never be made to /g, /home, /h, /my, or /stage).
Step 1: Create a .htaccess file
in the directory you wish to protect (make sure to use a unix text editor).
Example (Protect http://www.menet.umn.edu/~paulfm/share/passtest/ ):
vi /my/paulfm:www-menet/public-html/share/passtest/.htaccess
It should look something like the following:
AuthType Basic AuthUserFile /my/paulfm:www-menet/public-html/share/passtest/.htauth/htpasswd AuthGroupFile /my/paulfm:www-menet/public-html/share/passtest/.htauth/htgroup AuthName private <Limit GET POST> require group private order allow,deny allow from all </Limit>
htpasswd file with the
htpasswd command:
htpasswd {passwd_file} {user_name}
Example:
htpasswd -c /my/paulfm:www-menet/public-html/share/passtest/.htauth/htpasswd paulfm htpasswd /my/paulfm:www-menet/public-html/share/passtest/.htauth/htpasswd user1 htpasswd /my/paulfm:www-menet/public-html/share/passtest/.htauth/htpasswd user2 htpasswd /my/paulfm:www-menet/public-html/share/passtest/.htauth/htpasswd testIt should look something like the following:
paulfm:NmG46He.uBQAc user1:gNm36He9cBabc user2:6He9cBabcgNm3 test:zueokiL.oCm3M
htgroup file (with a unix text editor).vi /my/paulfm:www-menet/public-html/share/passtest/.htauth/htgroupIt should look something like:
private:paulfm user1 user2NOTE: The group name "private" needs to match the specified group name in the .htaccess file in the "require group private" line (case sensitive).