San Diego State University



Guide to CGI on ROHAN

Welcome to the CGI HowTo on ROHAN. This guide will show you how to find, set-up, and run CGI Scripts on your ROHAN-based web page. We will start with a general overview of CGI and it's features.
Table Of Contents
What is CGI?
Why Use CGI?
How do I Setup a CGI Script on ROHAN?
Where Can I Find Free CGI Scripts on the Web?
How do I Upload a CGI Script to ROHAN?
How do I Configure a Script to Run on ROHAN?
How do I call My Script from My Web Page?
Why Doesn't My Script Work?

Some Common Error Codes
Some Sample Scripts
Where Can I Find Additional Resources?



What is CGI?    [
top | table of contents ]

Essentially, CGI is a gateway that can communicate between a web page and a program on the web server. CGI is behind most interactive web sites, allowing visitors to interact with and change the content of a web page. The most common uses of CGI include guestbooks, counters, and surveys. Almost any time you hit a "submit" button on the Web, you are starting a CGI script.

CGI stands for Common Gateway Interface. Technically, it is a set of rules that allows communication between web forms and a server program. CGI in itself is not a language. A CGI script can be written in any language that can read from Standard Input (STDIN), write to Standard Output (STDOUT) and use environmental variables. The most common language used with CGI is Perl, although C, Java, or even shell scripts can be used just as easily. For the purposes of this guide we will assume you are using a PERL script. The basic steps that all CGI scripts go through are:



Why Use CGI?    [
top | table of contents ]

The first word in the CGI acronym will answer this question for you: Common. Just about every web browser and server in existence supports CGI, and that means that your programs and web pages will work the same for everyone who wants to use them. You will never have to worry about rewriting code to make it work on another platform.

In addition to being portable, CGI scripts are very versatile. They can be very powerful yet simple. This means that it should be easy for a novice web programmer to write the HTML to interface with even a complex CGI script. Scripts for many purposes already exist and are free to whoever wants them. Most premade CGI scripts will run on ROHAN's Apache web server with little or no modification.

Lastly, the most popular reason for using CGI in your web page is it allows ordinarily static and premade HTML to become dynamic and interactive. For example, you can use a Perl script to add a guestbook where visitors can add new content and life to your page, or create a form where they can critique your page and send a review.

In this guide we will discuss the steps necessary get a CGI program functioning on ROHAN, and how to make it work with your web page.

Ok, sounds like fun, so...



How do I Set Up a CGI Script on ROHAN?


© 2000