Using CGI Scripts at the Purdue CS Department

Overview

The Purdue University Department of Computer Sciences provides a method where those with accounts on CS machines can create Common Gateway Interface (CGI) scripts for use with the World Wide Web. CGI scripts provide a mechanism that allows programs you create to be executed by others using the WWW. This includes, but is not limited to, processing forms output, dynamically generating images or audio, dynamically generating HTML, etc.

For security, performance, and privacy reasons, CGI scripts cannot be installed for execution on www.cs.purdue.edu by general CS users. A different machine, www-cgi.cs.purdue.edu, has been configured to act as the CGI script server machine. All of your HTML documents, images, audio, etc. will continue to be accessed via www.cs.purdue.edu, but CGI scripts you create will be accessed through and executed on www-cgi.cs.purdue.edu.

Policies

There are enough issues related to the use of CGI scripts that a few policies are in effect. Failure to comply with these policies can result in the loss of WWW privileges or even the loss of your account.

  1. None of the CGI scripts or support files you create reside in your normal account space, but are on a disk that is shared by all others in the Department wanting to use CGI scripts. For this reason, we require that you place nothing in your CGI script directory that is not required by your CGI scripts. Images, audio, text files, HTML files, etc. should all go in ~/.www as always. Do not use your cgi-bin directory to store files that are not required by your CGI scripts. Watch the disk space you use closely. Abuse will result in the loss of privileges.
  2. All scripts run as the user nobody on www-cgi.cs.purdue.edu. Any attempt to use this fact to grant access to CS machines to others, to forge documents, or to perform other mischief will result in the loss of WWW privileges and/or of your account.
  3. Long running server push animations (more than a few seconds) or other continuous output programs are forbidden due to their intensive network requirements.

How to make your own CGI scripts

For security reasons, we have tried to isolate www-cgi.cs.purdue.edu from the rest of the Department as much as possible. It doesn't mount disks containing user files, for example, but mounts only selected package directories. You won't be able to log into this machine, but you can install your CGI scripts in a directory you can create on one if its disks. To create this directory, you should type /usr/local/www/setup-cgi. This will create the directory /p/www-cgi/cgi-bin/your_loginid, which is where you will place your CGI scripts.

The URL to the scripts you create will be http://www-cgi.cs.purdue.edu/cgi-bin/your_loginid/your_script, where your_loginid is your login id, and your_script is the name of the script you created in the /p/www-cgi/cgi-bin/your_loginid directory.

Typically, CGI scripts are shell scripts or perl scripts, but they can also be executable binary files compiled from C, Fortran, etc. The current Operating System used by www-cgi.cs.purdue.edu is SPARC Solaris 2.4. Be sure to build any executable binary CGI programs for use under this OS.

[Say something about debugging].

[Say something about killing runaway processes].

Please read the Common Gateway Interface documentation for more information on creating CGI scripts. Submit a trouble report if you have any problems.