PreviousNextHome

APPENDIX A - Protect your website with a password

How to protect a directory on your website with a password.

  1. Telnet to your UNIX Web Server
  2. Change directory to the directory you wish to protect.
  3. Enter the following command:
    1. htpasswd -c .htpasswd username

      where "username" is the name of the user who will have access to your files. You will be prompted (twice) for the password you would like to use.
      You now have a file named ".htpasswd". It contains an encoded version of the password.
       

  4.  In that same directory, create a file named:
    1. .htaccess
  5.  Write the following text in the .htaccess file:
    1. AuthUserFile /users/yourname/html/cgi-bin/arcount/admin/.htpasswd
      AuthGroupFile /dev/null
      AuthName Name
      AuthType Basic

      <Limit GET POST PUT>
      require user username
      </Limit>

The labels "AuthUserFile", "AuthGroupFile", "AuthName" and "AuthType" must remain in this file. Keep the lines "AuthGroupFile /dev/null" and "AuthType Basic" just as they are in the example, but you must change the text in blue as follows.

The AuthUserFile is the pathname to the .htpasswd file you created. Keep the label "AuthUserFile" but replace the dummy pathname /users/yourname/html/cgi-bin/arcount/admin/.htpasswd'
after it with the actual pathname to your .htpasswd file.

The AuthName is the name of the web site that will be displayed when the system asks for a password. Keep the label "AuthName" but replace the name 'Name' with the actual name you want to use for your site.

For 'username' substitute the user name for which you created a password. Case is sensitive.


http://www.argala.com PreviousNextHome
Copyright(C) 2000 Argala.com All rights reserved.