Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment
Blinkenshell IRCd listen port?

Edit History Actions Discussion

Howto/Webpage/PasswordProtection

Howto: Password Protection

This howto will briefly explain how to set up a directory on your webpage that requires username/password authentication for access.

First, create a new directory in your public_html where you will put the files which you want to protect:

cd ~/public_html
mkdir secret

Create a file named .htaccess in the new directory with the following content (edit with: nano -w secret/.htaccess for example):

AuthUserFile /var/www/users/myusername/secret/.htpasswd
AuthName "Secret directory"
AuthType Basic
Require valid-user

Remember to replace myusername in the pathname with your username.

The last step is to create the file that will store your usernames and passwords:

/usr/sbin/htpasswd -c secret/.htpasswd username

The last parameter here (username) is the name of the user for which you want to create a new password. If you want to add more users remove -c (create new) from the argument list and issue the command again.


CategoryHowto