UNIX CGI FAQ
Where should I place cgi
scripts?
If you have a custom CGI script that you need
to use, simply upload it to your personal cgibin.
You can utilize any directory except "cgi-bin"
for your own scripts.
What kind of scripts may I
use?
Our servers have the capability to run CGI
scripts based on Perl, Unix SH, BASH, KSH, CSH,
and C/C++ languages. Perl is a our language of
choice for most applications as it is a world
standard and is well suited to CGI. In addition,
Perl code does not require manual compilations
whereas C/C++ code must be compiled on our web
servers prior to use.
When uploading my scripts via
FTP, what mode should I use?
Upload in ASCII transfer mode (and NOT BINARY
mode)
Those using Fetch should use Text mode (not Raw
Data)
What should my first line
read?
The first line of each script should read: #!
/usr/local/bin/perl
What extension should I use?
Use .cgi
extensions for all scripts
If a script needs to call
another script without a URL, how do I do this?
If a script calls another file within your
account, but the script does NOT require a URL,
you need to use the system path.
If the file needs to be placed in your root
directory according to the scripts instructions:
/web/guide/yourdomainnameprefix/
If the file needs to be placed in your cgibin
directory according to the scripts instructions:
/web/guide/yourdomainnameprefix/cgibin
What scripts are available
with my UNIX account?
There are three scripts available, cgiemail,
formmail.cgi, and webform.cgi. If you wish to
configure a URL in your html code to use one of
these scripts instead of a script in your own
cgibin the URL will look like http://YOURDOMAIN.com/cgi-bin/yourchoice.cgi.
A ScriptAlias in your servers configuration file
will notice the hyphen in the name of the cgibin
and reference the servers cgi-bin for you.
What should I do if I want to
customize these scripts?
You can access the servers cgi-bin if telnet
access is enabled for your site or use an ftp
application to access the directory path /mnt/web/cgi-bin
on your server to make copies for transfer to your
local cgibin. You may have to check and make sure
permissions are set properly after the copy.
Can I use server side
includes?
Server Side Includes only works in files with
the .shtml extension. The cgi file must have its
execute and read public bits on to be run from a
browser. The file that contains the include only
needs to be readable. Try these commands in a
telnet session to change permissions on those
files if needed.
chmod 755 yourfilename.cgi
chmod 644 yourfilename.shtml