Apache htaccess

Apache htaccess New User and file


Make a new user name on .htacApache, htaccesscess (see below)

At the command Line Type:

htpasswd .htpasswd username

to add a new usere to the .htpasswd NOTE: Only us the -c (htpasswd -c .htpasswd username)to create the file DON"T use -c if File exist it will erase all the other users. The program will initially prompt you for a password and then ask you to verify it.

The .htaccess file below must contain

AuthUserFile /kunden/homepages/http/website/foldertoprotect/.htpasswd AuthGroupFile /dev/null AuthName "Download Area" AuthType Basic <limit get="" post=""> require valid-user </limit>

Note the AuthUserFile must be from root and end with the password file name. AuthName is the name in the password popup window change as needed. IN ADDITION verify you are using the correct path - telnet in and type pwd, use the path that echo's back

note CHMOD to 644 for both files


Restart Apache service use the command below

sudo /etc/init.d/apache2 restart