IT Services

Faculty & Staff CGI Instructions

Faculty and Staff

CGI scripts can be run on your webpage by using WS_FTP to ftp a CGI program into your public_html/cgi-bin sub-directory.

There are three areas of detail that will affect whether or not your script(s) work correctly. Please read the instructions for each of these areas carefully before attempting to use the cgi-bin for the first time.

  • Transfer of cgi scripts
  • Permissions on cgi scripts
  • Calling the cgi script from an html page

Transferring CGI Scripts

Follow the standard FTP Instructions to connect to the webserver. Once you have established a connection, switch to the "cgi-bin" directory before uploading your script and make sure that all CGI files are transferred in ASCII MODE
NOTE: If you are using FileZilla make sure to turn off file compression

Permissions for CGI Scripts

Before a cgi script can run, you need to change it's file permissions so that it is executable by both the owner of the file and the group they belong to.

  1. Click the right mouse button on the file that you have just uploaded, a pop-up menu will appear
  2. Select chmod (UNIX) from the pop-up menu, a window labeled "Remote File Permissions" will open
  3. Under "Owner" and "Group" click the check boxes labeled execute, do not change anything else
  4. When you have finished the previous step the following boxes should be checked - under "Owner" - read, write, and execute, under "Group" - read and execute, and under "Other" - read
  5. Click OK to finish.

Calling Your CGI Script

We are running a program called cgiwrap on our server to guard against "unsafe" cgi scipts. This will affect how you call your cgi script from an html document because you also need to call cgiwrap.

To call your cgi script correctly, please use this path:
http://seattlecentral.edu/cgi-bin/cgiwrap/[LOGIN]/[SCRIPTNAME]

Example
Your username is
jdoe

You have a script
htdocs/cgi-bin/test.cgi

You can call your script with this URL
http://seattlecentral.edu/cgi-bin/cgiwrap/jdoe/test.cgi

(Your script can have any name, and does not need to end in .cgi)