Skip to end of metadata
Go to start of metadata

Features

  • Used to provide additional functionality on web pages within the albany.edu domain

Instructions

  1. To create your CGI directory, type startcgi at the command prompt from your home directory in your Unix account. This script creates a public_cgi subdirectory where your CGIs will be stored. (You need only to run this command once.)
  2. Write your CGI script. All CGI scripts must be placed in your public_cgi directory and named with a ".cgi" file extension.  In the example below, you will create a very basic script called "hello.cgi". Using the "pico" text editor, you will create a script which will simply print the words "Hello World!" in your browser window.

Type pico public_cgi/hello.cgi at the command prompt. Type in the script as shown below: #!/bin/sh 

You should now be back to the Unix command line prompt.

    3. Type setcgi to allow web browsers to view your CGI.

    4. Link to your scripts from a web browser by using the following address format:

        cgi.albany.edu/~your_userid/script_name.cgi

        For example: cgi.albany.edu/~ab1234/hello.cgi

Icon

Any CGI scripts that you create outside of your Unix account must be moved to your account via an SFTP-enabled file transfer client such as Filezilla or Putty. You will need to upload these files to the public_cgi directory on your account and then set the permissions by using the setcgi command.

Support is not provided beyond basic setup questions provided in this article.