CGI, Common Gateway Interface, includes programs that run on the
server to enhance the quality and functionality of a web site. There
are many resources on-line that allow the downloading of free cgi
( For instance: http://www.worldwidemart.com/scripts/
Before a cgi script will work certain modifications must be made
to them. Certain paths must be specified in some scripts. After
the "#" in the first line of the perl script, the path to perl must
be specified. /usr/local/bin/perl should suffice for this path.
Below is a printout of a "whereis perl" from our system.
Another program that needs to be specified in many scripts
is sendmail. This is located at /usr/sbin/sendmail
Also, often you will need to know the exact physical path to your
root directory on the webserver your account exists upon. On our
Linux servers, the path to your root directory is: /home/username/
Obviously, substitute "username" with the login you were
assigned when you first received your account details. Also, keep
in mind that when you configure your CGI, that your /public_html
is included in your path. For instance, if you have a guestbook.pl
script in your /cgi-bin, the exact physical path to that file is:
The documentation of your program should tell you what lines
that you need to changed in order to get your script up and running.
When you have all your modifications made you will want to save
the file as a .pl or .cgi file. (Make sure to use a plain text format.)
When you upload the file DO NOT upload in binary mode, instead using
ASCII. Uploading in binary will cause the server not to recognize
the scripts as executables. Most FTP clients will upload .pl or
.cgi files in binary mode by default so you will need to change
this. You will need to upload the scripts into your cgi-bin directory
for security reasons, however they will execute from anywhere within
The last step is to set the file permissions. This is otherwise
known as chmoding and can be done from most FTP clients. For specifics
on chmoding you can refer to our "chmoding
files" help section.