| If you need to secure or password protect sections
or your entire
website requiring User authentication with a username and password access to the content,
then the creation of a .htaccess file for the Linux hosting platform
will perform this task for you. Step 1
Create a file name:
.htaccess in any text editor such as Windows Notepad. (That is dot
htaccess with no extension)
Include the following information in this file, changing the
AuthUserFile pathname to reflect the directory that you wish to
secure:
Arachnet Member Home Page Version Example:
AuthType Basic
AuthName "Secure Area"
AuthUserFile /home/username/htdocs/secure_directory/.htpasswd
require valid-user
Arachnet Hosted Domain Version Example:
AuthType Basic
AuthName "Secure Area"
AuthUserFile /home/domain.com.au/htdocs/secure_directory/.htpasswd
require valid-user
Note: In the above examples secure_directory would be the name of
the folder that you wanted to make secure.
Step 2
Create a file name: .htpasswd in any text editor such as Windows
Notepad. (That is dot htpasswd with no extension)
Step 3
To create your encrypted password file click on the following
link and copy the resulting information into your .htpasswd file.:
http://www.arach.net.au/cgi-bin/htaccess_generation.cgi
For example if I want to have the password set to "password":
Result of crypt password
A crypted version of password is: EjdESLi5YXgXQ
Example of a line in a password file for web authentication (colon
separated):
username:EjdESLi5YXgXQ
So if I wanted the following:
username: myname
password: password
The line in the .htpasswd file would be: myname:EjdESLi5YXgXQ
Examples For You to Use
To view examples of these files, please click below:
Note: If you are going
to use these files they must have their filename saved as .htaccess
or .htpasswd and adjust as required. A zipped file with the correct
file names is
supplied here.
Upload The Files
Then simply upload your
.htaccess and .htpasswd files using FTP into the directory that you
want to password protect - once uploaded, test the access out in
your Internet browser.
Additional Customising
The incorrect password
attempt error page can be customised by yourself by adding into the
.htaccess file, the following line:
ErrorDocument 401
/error401.html
Where /error401.html is
the path to the customised error page that you have created and
provided on your website.
Tip: Do not
actually put this file inside your password protected directory or
the user will be kept in a never ending loop.
SSH & Telnet Access
Due to security and technical reasons we do not allow access via SSH or Telnet to the
Arachnet server. |