Doing CGI on Fargo
Fargo is running a version of the Apache web server which allows for a particular kind of CGI execution called
su-Exec. This makes for several crucial differences from traditional CGI execution:
- When a CGI script is called by a URL is it executed by a "wrapper" program which checks for certain
conditions before the script actually runs. This is designed to prevent people from running scripts which
do nasty things.
- If you obey the rules your scripts can run from your own web directory instead of from the CGI-BIN
directory.
Create an .htaccess file.
This is an essential step for getting CGI working on fargo. Because of the way our server is set up, this file needs to be present for CGI
to work from your home directory. The web server program looks for a file of this name in any directory from which it serves pages, and the
file gives specific configuration information. Your .htaccess file will look something like this:
Options +ExecCGI
AddHandler cgi-script cgi
AddHandler server-parsed shtml
These lines will be in a text file in your scripts or public_html directory on fargo. You can either create the file with a text editor like PICO,
or copy someone else's file on the server.
If you want more documentation, you'll need to read a bit of documentation about configuring your scripts, helpfully written
by Tom Igoe. This information is a useful reference, but it was created a while ago. For up-to-date information, talk to someone in the CGI class, or post a message with your question to the
ITP-Students mailing list.
Building Web Sites - ITP Fall 2000 - Mike Cosaboom, Instructor
mc39@acf2.nyu.edu