CGI Installation

The following are instructions for setting up your account to be able to use cgiwrap to execute cgi scripts. It is assumed that you are familiar with writing CGI scripts and writing HTML documents for the WWW.

In the following instructions, the following information is assumed:

  • UserID: joe
  • Home Directory: /users/joe
  • CGI Directory: /users/joe/public_html/cgi-bin
  • Name of Script: script.pl
  • Web Server: www.domain.com
  • If you do not already have a cgi-bin directory set up, create one:

  • cd ~joe
  • mkdir public_html
  • mkdir public_html/cgi-bin

    If you are using AFS, you will need to set the AFS permissions on the directories. See Use of CGIwrap with AFS for details on the necessary permissions.

    Install the script into the cgi-bin directory, and set the proper execution permissions on the file.

    cp script.pl ~joe/public_html/cgi-bin/script.pl chmod 755 ~joe/public_html/cgi-bin/script.pl

    The script is executed using the following URL:

    http://www.domain.com/cgi-bin/cgiwrap/joe/script.pl

    If you wish to see debugging output for your CGI, specify cgiwrapd instead of cgiwrap, as in the following URL:

    http://www.domain.com/cgi-bin/cgiwrapd/joe/script.pl

    If the script is an nph- style script, you will need to run it using the following URL's:

    http://www.domain.com/cgi-bin/nph-cgiwrap/joe/script.pl http://www.domain.com/cgi-bin/nph-cgiwrapd/joe/script.pl

    In all of the below examples, replace SERVER with the hostname and port of your webserver. Replace USER with your userid, and replace SCRIPT with the name of the script that is located in your cgi-bin directory.

    In the below URLs you can replace "cgiwrap" according to the following:

    cgiwrap Normal script execution

    cgiwrapd Executes script, but returns debugging information, also is returned preformatted, so you can see the source that the script is outputting.

    nph-cgiwrap

    nph-cgiwrapd

    Same as above, except you sometimes need to use this if your script outputs binary data, such as an image counter script. Standard Installation of CGIWrap

    Place your scripts in your ~/public_html/cgi-bin/ directory

    http://SERVER/cgi-bin/cgiwrap/USER/SCRIPT
    http://SERVER/cgi-bin/cgiwrap/~USER/SCRIPT
    http://SERVER/cgi-bin/cgiwrap?user=USER&script=SCRIPT
    Password Protected Installation of CGIWrap

    Place your scripts in your ~/public_html/auth-cgi-bin/ directory


    http://SERVER/auth-cgi-bin/cgiwrap/USER/SCRIPT
    http://SERVER/auth-cgi-bin/cgiwrap/~USER/SCRIPT
    http://SERVER/auth-cgi-bin/cgiwrap?user=USER&script=SCRIPT

    Notes

    The syntax examples above using user= and script= are carryovers from the original versions of CGIwrap, and are not really needed. I highly reccomend you don't use them, the other examples are much clearer and easier to use.

    -----------------------------------------------------------------

    Tech support may be reached at (317) 876-6000, please leave a voice mail for us after hours. You may reach us by e-mail at helpdesk@on-net.net.