Advanced Password Protection (Unix only)For easy-to-use password protection, click on Password Protection in myCP. Detailed instructions here. Basic Site Password Protection (recommended for a 100 or less total users) DBM-based Password Protection (recommended for over a 100 users/high volume sites) HTAccess Basic Site Password Protection You can password protect directories of your web site, so only users with a given username and password can access that directory and files within it. The most popular method used is HTAccess, as described below. Single User Protection:
Keep in mind that all files should have a blank line at the bottom and to always use the full path to your configuration files. For further details, please refer to the Authentication Tutorial from NCSA.
DBM-based Site Password Protection If you will have more than a hundred users, we recommend that you use DBM-based authentification, to speed up user login process. DBM Authentification Set-Up: 1. create your password-protected directory inside public_html (eg. cd public_html ; mkdir directory). 2. create the directory where the password files will be stored inside your ROOT directory (NOT public_html for security purposes; eg. cd ~ ; mkdir access). 3. in the protected (in public_html) directory, create an .htaccess
file. AuthDBMUserFile /home3/yourdomain/access/.htpasswd 4. In the access (not in public_html) directory, do 5. Then use dbmm program (/usr/local/bin/dbmm). If you would like to use group-based access control as well (the above is plain user based, though you can add as many users as you wish), please follow the further Apache instructions (create a group db file, or combine then as in the instructions there). Keep in mind that all files should have a blank line at the bottom and
to always use the full path to your config files. 1. Create the directory you want to protect access to based on referrers your public_html (example: restricted) 2. Create a file .htaccess in that directory that looks similar to: AuthUserFile /dev/null where yourdomain.com is your domain and authorizedlinksite.com is a site that can link to your restricted directory. There can be no, or multiple, such authorized link sites. Note that the trailing slashes (/) are important and must be included. 3. Now try to access the authorized directory from a link on your site, from a link on the authorized site(s), if any, and, if possible, from a link from an unauthorized site (to ensure that it is restricting access properly). The latter test can be conducted using a link from a sub-directory of your site (eg. http://www.yourdomain.com/somedirectory/) that is not listed as a valid referrer as well.
|