CGI
stands for "Common Gateway Interface," a
fancy name meaning computer programs running on the
webserver that can be invoked from a www page at the
browser. The "bin" part alludes to the binary
executables that result from compiled or assembled
programs. It is a bit misleading because cgi's can
also be Unix shell scripts or interpreted languages
like Perl. CGI scripts need to be saved in ASCII format
and uploaded to your server's cgi-bin in ASCII or
text format. This is very important.
A
typical use for cgi is the processing of online forms.
When the user fills in the boxes on the form and hits
the SUBMIT button, the cgi program specified in the
html will be run at the server, and the information
in the boxes become available to the program as parameters.
The program can then do anything the programmer wanted
it to do.
"FormMail.pl", for example, is a canned
program that gathers up the contents of the boxes
on the form and emails them to a specified destination,
then sends a WWW page confirming the action.
"imagemap"
is another common use for cgi. Here, the X-Y coordinates
of the pointer on an image are correlated with a specification
table, so that clicking on different parts of the
image will result in different links being followed.
Other
cgis might ask for a password, check the password,
then access a database for requested information.
What it does is up to the programmer, but we do ask
that the cgis are reasonable in their usage of CPU
time and memory. While we do not require that they
be submitted for approval first, out of control programs
that hog the CPU will be hunted down and killed by
our death robot.
Standard
cgis reside in the Colossus cgi-bin subdirectory.
Your cgis reside in a web subdirectory named cgi-bin
directory under your www directory. If your domain
is named company.com, you would then access your scripts
as /cgi-company/
Put
your cgi-bin scripts in the www subdirectory named
"cgi-bin". If you have given full POP/FTP/Telnet
accounts to other people, each of them will have there
own separate cgi-bin inside the main cgi-bin. When
they login with their username and password, they
will only have access to their own cgi-bin.