Common Gateway Interface
The IBM HTTP Server for i5/OS supports Common Gateway Interfaces (CGI).
Information for this topic supports the latest PTF levels for HTTP Server for i5/OS . IBM recommends that you install the latest PTFs to upgrade to the latest level of the HTTP Server for i5/OS. Some of the topics documented here are not available prior to this update. See IBM Service for more information.
- Overview of CGI
This topic provides information about CGI. Common Gateway Interface (CGI) is a standard, supported by almost all web servers, that defines how information is exchanged between a web server and an external program (CGI program).
- Environment variables
Before you begin writing your CGI program, understand the format in which the server will pass the data. The server receives the URL-encoded information and, depending on the type of request, passes the information to the CGI program. The server does this by using environment variables, command line arguments, or standard input.
- Overview of High Availability CGI
High availability CGI programs use APIs to preserve the CGI’s state between successive client requests. A High availability CGI program stores its state data on the Web server and can retrieve its state even after a failure or switchover of the HTTP Server or system.
- Guidelines for writing high availability CGIs
By understanding the guidelines for writing cluster-enabled CGIs, you can avoid potential problems with your CGI code.
- Overview of Persistent CGI
Persistent CGI is an extension to the CGI interface that allows a CGI program to remain active across multiple browser requests and maintain a session with that browser client. This allows files to be left open, the state to be maintained, and long running database transactions to be committed or rolled-back based on end-user input.
- Common gateway interface (CGI) programs for the HTTP Server
In the IBM HTTP Server for i5/OS, Common Gateway Interface (CGI) is a standard that defines how information is exchanged between a Web server and an external program (CGI program).
- The CGI Process
Usually CGI programs are referred to from within HTML documents. In general, the HTML document format defines the environment variables that specify the passing of information. When you design the layout of your HTML document, keep in mind how a CGI program might affect the look of your document. Developing the CGI program along with the HTML document will help you avoid many design mistakes.
- CGI Program Interface
A Web server passes information to CGI programs using environment variables. If the HTTP Method is ″POST″ the CGI also obtains information from the Web Server through stdin. The CGI program uses stdout to send its response back to the Web server. The response consists of a set of headers (such as Content-Length and Content-Type) followed by the response body which is frequently HTML data.
- CGI Programs and Activation Groups
The following section is intended to give a brief overview of Activation Groups.
- Setting up CGI programs for HTTP Server (powered by Apache)
Use this topic to set up CGI programs for IBM HTTP Server for i5/OS.
- CGI in PASE for HTTP Server
In the IBM HTTP Server for i5/OS, CGI programs can be run in PASE.
- How to enable the server to run CGI programs
The iSeries™ server stores some CGI programs in QSYS.LIB. You can write the programs in C++, REXX, ILE C, ILE RPG, or ILE COBOL. If the UserID directive is not active, the server profile QTMHHTP1 needs access to the *PGM object and all objects the program accesses. If the UserID directive is active, the UserID profile needs access to the *PGM object and all objects the program accesses. The ScriptAlias directive is required in HTTP Server (powered by Apache) configuration to run a CGI program on the server.
- Troubleshooting your CGI programs
You can use the Work with Active Jobs (WRKACTJOB) command to check on the status of server jobs.
Parent topic:
Programming