Suso Logo suso
Support Site
main site     webmail    

Login to your account using SSH.

Then to create the file where the passwords will be kept run:

htpasswd -c /home/yourusername/www/.htpasswd userforwebauth

Replace 'userforwebauth' with the username you want to use for authentication. Running the above will prompt you for the password for the user you specified.

Now go to the directory of your website that you want to password protect. For example:

cd /home/yourusername/www/yourwebsitedirectory/protectedirectory

Use an editor, such as nano, emacs or vi to create and edit a file called .htaccess.

.htaccess

This file can be used to set settings for the Apache webserver. Add the following to the .htaccess file you create:

AuthUserFile /home/yourusername/www/.htpasswd AuthName 'Protected Directory' AuthType Basic require valid-user

Now save the file.

That should be all you need to do.