Using CGI in the SEDCON WWW Environment

The Common Gateway Interface (CGI) provides a standard interface between information server programs such as HTTP servers and other external programs. The CGI specification describes how to write a CGI external program but not how to invoke one because the method of invoking a CGI program is dependent not only on the type of information server involved but also on the policies of the site providing the information service.

CGI is one of a set of WWW technologies that involve some sort of work by the computer providing the WWW service beyond that needed to simply retrieve documents. Use of any of these technologies can substantially increase the amount of work done by a WWW server so, as explained in more detail elsewhere, CGI programs should be run on www2.vuse.vanderbilt.edu.

To invoke a CGI program on www2.vuse.vanderbilt.edu, you should construct a URL of the form

http://www2.vuse.vanderbilt.edu/cgi-bin/cgiuser/~username/cgi-program
where username is the username of the SEDCON user who has made the CGI program available, and cgi-program is the name of the CGI program. As in other URL references to one of the SEDCON WWW servers, the string ~username refers to the wwwfiles subdirectory of the home directory of the user with the SEDCON username username. Any CGI program to be invoked by this method should be readable and executable by the owner of the program and inaccessible by anyone else. Furthermore, the setuid bit of the file modes of the program must also be set. (For more information on file modes, the manual page for chmod in sections 1 or 2 of the UNIX Programmer's Manual.) If the file modes are not set correctly, the program will not be executed. When invoked as shown above, a CGI program will execute with the privileges associated with the account of the owner of the program.

An Example

Assume that John Q. Public has a SEDCON account with the username jqpublic and a home directory accessible as /home/jqpublic. If he wants to make available a CGI program called program.cgi, he could place the program in his wwwfiles directory with the full name /home/jqpublic/wwwfiles/program.cgi and invoke it via the WWW as

    http://www2.vuse.vanderbilt.edu/cgi-bin/cgiuser/~jqpublic/program.cgi
For the program to be invocable, J. Q. Public would need to set the file modes to an appropriate value by executing the command below (or something similar):
    chmod 4700 $HOME/wwwfiles/program.cgi


If you find the instructions above unclear or incomplete, please contact David Linn.
Last changed on January 17, 1997 by David R. Linn