SREhttp/2 Manual|| SREhttp/2 Addons

SREhttp/2 and CGI-BIN

SREhttp/2 supports CGI-BIN scripts. To run CGI-BIN scripts, you'll need to: SREhttp/2's implementation of CGI-BIN has one major improvment: the ability to send pieces of the output as they are created. That is, one can:
  1. wait for the CGI-BIN script to end, and then send all the output it generated
    ... or
  2. send output as it is generated
The second option is especially useful when large amounts of output are being generated (it avoids some troublesome server-timeout & client-impatience problems). For details see the discussion of the ENABLE_CGI_PIECES selector specific option.

SREhttp/2's implementation of CGI-BIN also includes a few minor modifications:


Using CGI-BIN scripts in other subdirectories

By default, CGI-BIN scripts are assumed to be in the CGI-BIN directory of SREHTTP2 (say D:\SRE\SREHTTP2\CGI-BIN). Obviously, this can become inconvenient once you acquire a greater-than-small set of scripts. The obvious solution is to place the script files in subdirectories.

Unfortunately, there does not seem to be a clearly specified method of doing this. Nevertheless... SREhttp/2 offers the following method of of specifying subdirectories containing your CGI-BIN scripts:

Notes:
  • Remember that the CGI-BIN in a selector is not used as directory information. Rather, it's a flag indicating that this is a request for CGI-BIN script

  • Requests for CGI-BIN scripts are often followed by extra path information This is typically used by the script (it does not point to the script).
  • If, for some reason, you want to change the flag used to indicate CGI-BIN scripts (say, from CGI-BIN to CGI), see the CGIBIN_FLAG variable in SREHTTP2.CFG
  • If, for some reason, you want to change the default CGI-BIN directory (say, from SREHTTP2\CGI-BIN to D:\SCRIPTS\CGI), see the SREHTTP2\CGI-BIN to SREHTTP2\CGISTUFF), see the cgi_bin_dir parameter in SREH2INI.RXX.
Examples:
/KIDSTORE/INVENTORY/CGI-BIN/TOYCT.CMD?toddler
This invokes the TOYCT.CMD program (with an argument of toddler),
which is (perhaps) located in \SRE\SREHTTP2\CGI-BIN\KIDSTORE\INVENTORY\

/EVENTS/JUNE/CGI-BIN/SHOWS.CMD?time=otters
If you've defined (in ATTRIBS.CFG):
   realm: Zoo1
   rule: /EVENTS/* 
   redirect: dir= !CGI F:\ZOO\ANIMALS\
then use F:\ZOO\ANIMALS\JUNE\SHOWS.CMD as the CGI-BIN script.

Notes on creating CGI-BIN scripts

Using PERL scripts with SREhttp/2

In order to take advantage of a broad spectrum of CGI-BIN scripts, SREhttp/2 can use "non-REXX" processors to interpert CGI-BIN scripts.

As long as you have the appropriate interepreter installed on your server, it's quite easy to do this. All that you need to do is set the INTERPRET_TYPES parameter in SREH2INI.RXX.

By default, INTERPRET_TYPES is set to associate the .PL extension to PERL scripts. These are ff particular interest,since there are good OS/2 PERL interpreters available, and since there are a slew of PERL scripts out there.

Please see PERL.TXT for the details.


Last updated on 6 July 2002