• Adhost Webmail
    • Client Login

Support - Unix

Note: Regular Telnet access has been disabled for security reasons. You will need a program supporting the SSH2 protocol and a fixed IP address to connect to our UNIX servers.

You may protect the security of your Web pages by setting up username-password controlled directories within your Web site. When the user tries to browse to a protected page, she is asked for a username and password. Both must be correct to enable entry.

The below tutorial is how to set this up on one of our shared unix servers. If you are on an NT machine, or on a secure machine, please email your request to support@adhost.com.

To set up password protected directories in Unix:

Create the .htaccess file

Create a file called .htaccess within the directory you wish to protect. Note that all files in that directory, and all files in all subdirectories of that directory, are also protected.

Here is an example. Replace "fred" with the username you want to associate with the password. (Add additional "require" lines for any additional users). Replace "mydomain/.htpasswd" with your domain pathname on Adhost (and any subdirs) to make the path to your password file. NOTE! This is NOT your domain name, but probably IS your domain name WITHOUT the final 4 characters (.com .org .net). You may also edit the "Page Title" to make it more descriptive of what your password is protecting. If the "AuthName" entry is more than one word it MUST be in quotes. Don't edit anything else!

Copy this exactly and name it .htaccess
----------cut-here-----------

AuthUserFile /home/web/sites/mydomain/.htpasswd
AuthGroupFile /dev/null
AuthName "Page Title"
AuthType Basic


require user fred

----------cut-here-----------

 

Create the password file

From the Unix shell (to get to a Unix shell, use a telnet client program) in your Web site area run the htpasswd program to make a password file. You should put it in a directory other than your main Web directory, the protected directory itself is a good place. The "-c" argument creates a new password file. Leave that argument out to change the password.

For Example:

htpasswd -c .htpasswd fred

creates a password file in the current directory called ".htpasswd" and sets the username to "fred". To view the page the user must enter both the username fred and the correct password.

You may add additional passwords (for other users) by leaving out the "-c" argument (you have already created the file) and changing "fred" to the next name. Run "htpassword" once for each name/password combination.

Home   |   Articles   |   Site Map   |   Privacy Policy   |   Terms And Conditions   |   sales@adhost.com
Local Phone: (206) 404-9000 | Toll Free: (888) ADHOST-1 (234-6781)
Fisher Plaza, 140 4th Ave N Suite 360, Seattle, WA 98109
ADHOST © 1996-2008  |  Seattle Colocation  |  About Adhost  |  Newsletter Sign-up  |  Blog