How to create a protected directory in Attila

by A. Koch (18 June 2003)

Steps:
  1. Create a new folder which should be protected (Example: protected01).
  2. Create a .htaccess file in this folder.
  3. Write in the .htaccess file:
    • Line 1: AuthType Basic.
    • Line 2: AuthName "Protected No. 1".
    • Line 3: AuthUserFile /home/civil/akoch/etc/passwd.
    • Line 4: Require user username.
  4. Create your file which should be protected in the protected folder.
  5. Give permission to your file and .htaccess separately.
  6. Login to attila.
  7. For your first protected folder you have to create in your home a etc directory (mkdir /home/civil/akoch/etc).
  8. Give permission for this folder (chmod 755 /home/civil/akoch/etc).
  9. Write htpasswd -c /home/civil/akoch/etc/password username (name in the 4th line in the .htaccess file).
  10. If you have already a etc directory and at least one password in the etc directory, the steps #7 and 8 are not necessary, and in step #9 write the command without -c.