Airweb How-To's
Here you will find a variety of useful walk throughs regarding
some of the more commonly asked about topics. If you find any
topic lacking or unclear, or if you would like to see another
section added, please send us an email to let us know.
Most commonly requested How-To guides:
Use email forms on your website
Secure your website using password protected areas
Upload your webpage - FTP
Upload your webpage - Frontpage
Add a counter to your page
Other topics:
Upload and use your own custom CGI scripts
Make and use custom error documents
Stream Real Audio from your site
Use SSL encryption
Telnet into the server Decommissioned
Get around in the UNIX OS on Airweb Decommissioned
Check your disk space quota Decommissioned
Q: How do I use email forms on your website?
Many companies need a way for their clients or prospective clients to contact them.
Using web based questionnaire's is a great way to get the information you need!
This tutorial will create a web-based form and scripts, in three easy steps.
Q: How do I password protect a directory?
Password protecting a directory or entire site is easiest done
by using a .htaccess file. This is the standard way
to control access on the UNIX Apache web server. This method actually
requires two files, .htaccess, which specifies the
usernames that are allowed to access the directory, and .htpasswd,
which contains the encrypted passwords for each username. The .htaccess
file must be placed in the directory you want to protect. The .htpasswd
can be placed in any directory, but you may wish to keep it in the
same directory as the .htaccess file for easier file
management. The web server will not allow visitors to access either
of these files, so they are secure wherever you put them (as long
as you name them .htaccess and .htpasswd!).
A word about the filenames: you will notice that these
files have an extension, but no filename. This is perfectly acceptable
on a UNIX computer, and on some Mac operating systems, but is not
valid in Windows. Later on we will show you how to change them to
the correct filenames, but for now, if you are using Windows, you
can name the files whatever you like. (htaccess.txt
and htpasswd.txt are good choices.) It is imperative
that the filenames are changed to the correct names once on the
server, though, so please read through this entire tutorial.
The first thing you want to do is create the encrypted password
file. There are a few ways to do this. You can use this form
to fill in the username and password you want, and simply
copy and paste the one line output into a textfile and upload it
to the server, then rename it to .htpasswd
The other method involves downloading an executable and use it on
your Windows computer. It is called htpw-dos.exe.
You can find that program
here.
To make things simple, you will probably want to download the file
to the root directory of your C: drive. Once downloaded,
open up a command-line prompt. The easiest way to do this is from
the Start -> Run dialog. Click on Start, and then choose Run.
In the dialog box, type in command if you are running
Windows 95, 98 or ME, or cmd if you are running Windows
NT, 2000 or XP. Click Okay, or press the enter key. You will be
presented with a window, with a command prompt. If you downloaded
the htpw-dos.exe file into the root directory of your C:
drive, then type in:
cd \
and press Enter. This will change you into the root directory.
If you downloaded the file into a different directory, change to
that directory using the cd command. Now you are ready
to create the htpasswd.txt file, which will later be
named .htpasswd on the web server. To create the file,
type:
htpw-dos.exe -c htpasswd.txt username
And replace username with the username you want to
create a password for. The program will come back with:
Adding password for username.
New password:
At this point, type in a password. Remember that the password is
case-sensitive. The program will hide the text you are typing, so
it asks you to confirm the password:
Re-type new password:
Type the password in again, and you are done! The program will
create the file called htpasswd.txt, which will contain
the username you specified, and then some garbled text, which is
the encrypted password. Be warned that the -c tag in
the command is telling htpw-dos.exe to create a new
file! To add user/password pairs to this file, simply type:
htpw-dos.exe htpasswd.txt newusername
Replace newusername with the username you want to
add, and it will prompt you, again, twice for the password. Now
the new username is added to the password file. You must do this
with every new user that you want to add. If you accidentally use
-c, it will create a new, blank file with your new
username, and all your old usernames and passwords will be lost.
In this case, they are unrecoverable, and you will have to add them
all back in by hand.
Next you will need to create the .htaccess file. This
is a simple text file, that contains the following:
AuthUserFile /airweb/username/www/docs/secret/.htpasswd
AuthGroupFile /dev/null
AuthName Restricted
AuthType Basic
<Limit GET>
require valid-user
</Limit>
Feel free to copy and paste that into a new text document in Notepad.
Notice the first line. This line points to the location of the .htpasswd
file on the server. You will want to replace username
with the username you use to access the site via FTP, and you will
want to replace secret with the name of the directory
you want to protect. The username in this file must be your FTP
username - not the username you added to the password file.
You may replace Restricted with any one word that you
would like the password window to display when your visitor tries
to access the protected section of your site. Save this file as
a text file called htaccess.txt.
Now you are ready to upload your files. Connect to your site with
an FTP program such as WS_FTP_LE (instructions
here), and change to the directory on the server that you wish
to password protect. Upload both the htpasswd.txt and
htaccess.txt files into this directory. Now you will
need to rename the files to make them active, and also ensure that
no unscrupulous visitors may access the files. Click on the htpasswd.txt
file on the right-hand side of your screen, then click the Rename
button in WS_FTP. Rename it to .htpasswd and click
Okay. It is very important to have the period at the beginning of
the filename. Next, rename the htaccess.txt file in
the same way: click on the filename on the right-hand side of your
display, and then click the Rename button, rename it to .htaccess
and click Okay. Depending on your version of FTP program, the files
may disappear when you rename them. Once the filenames are changed,
the directory is protected. Try pulling it up in a webbrowser, and
you will be presented with a username and password window. Type
in the proper username and password pair, and the server will allow
you to see the requested files. If you do not have a valid username
and password, you will not be allowed access to the directory.
.htaccess has many other uses such as restricting
by domain, IP range, or changing how your visitors see the site,
but those are beyond the scope of this document. To see how to use
.htaccess to show your users a custom 404 error page
(the page that displays when the visitor requests a file that isn't
there), see this page. For more
information on the capabilities of .htaccess, you may
wish to start with this
page.
|