iTP Secure WebServer System Administrators Guide (Version 7.5+)
Figure 6 Generic-CGI Server class
HTTPD
Pathway CGI Main
Serverclass_send
Reply
stdin stdout
.cgi Program
generic_cgi
The generic-CGI execution environment has these characteristics and constraints:
• You can run as many simultaneous CGI processes as there are processes in the generic-CGI
server class.
• The .cgi programs are launched in the same processor in which the generic-CGI server is
running.
• As in standard CGI, a new process is created for each invocation.
Generic-CGI is the best choice for running an existing .cgi program or a program that will run
without change in various WebServer environments. For high-volume applications, you can achieve
better performance by using Pathway CGI, as described next.
Pathway CGI Server Classes
Pathway CGI server classes provides substantial improvement in performance by comparison with
conventional or generic-CGI, because the CGI program is implemented not as a separate process,
but as a user-written CGI_main procedure within a NonStop TS/MP server process.
NOTE: If your program must read environment variables, write a CGI_initialize routine so that
when CGI_main is invoked, the getenv() call will return the WebServer's environment variables.
See “Design Guidelines” (page 162) for more information.
To create a Pathway CGI server class, you use theCGI library:
• Use the following library routines, rather than the corresponding C library routines, for access
to the standard input, output, and error files:
◦ CGI_fread
◦ CGI_fwrite
◦ CGI_printf
140 Using Common Gateway Interface (CGI) Programs










