IBM Books

Administration and Programming Guide for OS/400


Configuring the Web Server

The Common Gateway Interface (CGI) is an industry-standard interface that enables a Web server to invoke an application program such as Net.Data. Net.Data's support for CGI lets you use Net.Data with your favorite Web server.

Configure the Web server to invoke Net.Data by adding Map, Exec, and Pass directives to the HTTP configuration file so that Net.Data gets invoked.

For example, assuming the Net.Data program object resides in library CGI, then the following directives redirect Net.Data requests to /QSYS.LIB/CGI.LIB/DB2WWW.PGM:

Map /cgi-bin/db2www/* /QSYS.LIB/CGI.LIB/DB2WWW.PGM/*
Map /CGI-BIN/DB2WWW/* /QSYS.LIB/CGI.LIB/DB2WWW.PGM/*
Exec /QSYS.LIB/CGI.LIB/* 

Recommendation: Organize the directives in the following order within the HTTP configuration file to prevent directives from being ignored: Map, Exec, Pass. For example, if the following Pass directive precedes a Map or Exec directive, the Map and Exec directives are ignored:

Pass /*

Map directives
The Map directives map entries using the format /cgi-bin/db2www/* to the library where the Net.Data program resides on your system. (The asterisk (*) at the end of the string refers to anything that follows the string.) Both upper- and lower-case map statements are included, because the directives are case sensitive. In this example, both Map statements point to the same location.

Exec directives
The Exec directive enables the Web server to execute any CGI programs in the CGI library. Specify the library where the program resides (not the program itself) on the directive.

Pass directives

If you want to use large objects (LOBs) with the SQL language environment, create a Pass directive to specify the directory where the SQL language environment stores the LOBs files. For example:

Pass /tmplobs/* /html_path/*

Where html_path is the directory name specified in the HTML_PATH configuration variable that specifies the default directory where LOBs are stored. See HTML_PATH for more information.

Pass directives are not used by Net.Data. If you want to simplify your URL, then use the MACRO_PATH statement in a Net.Data initialization file, discussed in MACRO_PATH.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]