Steps:
- Create a new folder which should be protected (Example: protected01).
- Create a .htaccess file in this folder.
- 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.
- Create your file which should be protected in the protected folder.
- Give permission to your file and .htaccess separately.
- Login to attila.
- For your first protected folder you have to create in your home a etc directory (mkdir /home/civil/akoch/etc).
- Give permission for this folder (chmod 755 /home/civil/akoch/etc).
- Write htpasswd -c /home/civil/akoch/etc/password username (name in the 4th line in the .htaccess file).
- 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.
|