iTP Secure WebServer System Administrator's Guide (iTPWebSvr 5.1+)

iTP Secure WebServer System Administrators Guide522659-001
8-1
8
Using Common Gateway Interface
(CGI) Programs
This section introduces you to using Common Gateway Interface (CGI) programs with
the iTP Secure WebServer. Web servers use CGI programs to interpret and process the
information they receive from clients. CGI programs also interact with other programs
and resources.
For example, if a web client wishes to search a database, a CGI program would receive
the search criteria (for example, keywords) from the web client as input and would then
interact with the proper search mechanism to gather the information desired. The CGI
program then would process this information for passing back to the web client through
the server.
CGI programs can be written in several languages; the languages most often used are:
Perl, Tcl, shell scripts (Korn or Bourne shell), C, and COBOL. Of these, Compaq offers
C, C++, and Korn shell (through OSS) as supported products. The iTP Secure
WebServer also lets you use Java servlets in a CGI execution environment.
When a server receives a request from a web client, the server runs the CGI program to
process the request and uses either environment variables or standard input to pass
request data to the program. The data passes to the CGI program through the Common
Gateway Interface. After processing the request data, the CGI program uses standard
output to pass requested objects or data to the server, which, in turn, passes the output to
the web client. Figure 8-1
shows the relationships among the web client, a web server,
the CGI, and a CGI program.