WebSpeed
Installation and
Configuration Guide


Configuring a CGI Messenger

Configuring a Messenger to access a CGI-compatible Web server requires only that you create a script file that the Web server uses to invoke the Messenger executable, cgiip. You do not have to change the configuration of your Web server. The script file performs these tasks:

You can find a sample file that you can use as the basis for a shell script to configure the script file at install-path/bin/wspd_cgi.sh.

Here is an edited version of install-path/bin/wspd_cgi.sh:

# Determine the correct directory where the Messenger
# is installed from either the tailored name or existing value of $DLC.
for what_dlc in "/usr1/pmccorma/wsrt" "$DLC"
do
    [ ! -f "${what_dlc}/bin/cgiip" ] && continue
    DLC=$what_dlc
    export DLC
    break
done
# Set PROMSGS (if not set)
PROMSGS=${PROMSGS-$DLC/promsgs};                export PROMSGS
# Set the user working directory - this is a tailored value
WRKDIR=${WRKDIR-"/usr1/pmccorma/wrk"};                export WRKDIR
# option 1 using host_name and port_num
# $DLC/bin/cgiip pegasus 5001
# option 2 using a service name defined in $DLC/ubroker.properties
$DLC/bin/cgiip -i wsbroker1
# option 3 the "defaultService" defined in $DLC/ubroker.properties
# $DLC/bin/cgiip
# option 4 using a specific properties file name
# $DLC/bin/cgiip -i wsbroker1 -f ./mybroker.properties
# option 5 using a specific properties file name with the "defaultService"
# $DLC/bin/cgiip -f ./mybroker.properties 

The wspd_cgi.sh script provides and documents additional options for invoking the Messenger executable. You can, for example, specify the default WebSpeed service or use the -f option to specify a named configuration file. Table 8–4 describes the various options.

Table 8–4: Options For Invoking the CGI Messenger 
Option
Description
cgiip  
The Messenger uses the Transaction Server that you defined as the Default Service in the ubroker.properties file.
cgiip host-name port-num 
The Messenger uses the Transaction Server whose host name and port number you specify.
cgiip -i WS-service 
The Messenger uses the Transaction Server service whose name you specify.
cgiip -f cnf-file 
The Messenger uses the configuration file that you specify. This option overrides the ubroker.properties setting.

NOTE: Specifying a WebSpeed service name in a URL overrides any settings in your Messenger script file.

You can edit the script if you would like to see what information cgiip is sending to the browser for debugging purposes (including HTTP headers). Here is a sample script that shows how you might do this:

# save CGI environment 
env >/tmp/webapp.env 
# save application ouput 
outfile=/tmp/webapp.out 
/usr/dlc/bin/cgiip -i WSbroker 2>&1 | tee $outfile 

This script works as follows: After a request from a Web browser initiates this script, the script saves all of the CGI environment information in a file named webapp.env. The script sends its output not only to the browser but also to a file named /tmp/webapp.out. You can look at /tmp/webapp.out to see what was sent to the browser. The technique is useful for pinpointing problems that might be related more to the server than to your application. A clue that this might be the case is if your browser receives no output from your application and instead displays server errors.

Remember that this script executes every time a browser makes a request. Thus, if multiple browsers make multiple simultaneous requests, the agents servicing the requests can overwrite each other’s output to the file. For this reason, you should use this technique only when you are debugging your application (typically with a controlled number of agents and browsers).

Where To Place the Messenger Script File

Typically, a Messenger script file, such as wspd_cgi.sh, resides in the cgi-bin or equivalent directory that contains your Web server’s scripts. When you configure your Web server, you can decide which directories can hold executable files. You can also designate whether the executable files require a specific extension (such as .cgi) or can use any extension. See your Web server documentation for details on how to configure a scripts directory and CGI programs.

Most UNIX Web servers map URLs leading with /cgi-bin to a cgi-bin subdirectory. This subdirectory is located either under or parallel to the document root directory. The cgi-bin directory typically contains only executable files. This is an appropriate location to place your Messenger script file.

Many UNIX Web servers allow CGI programs to reside in directories other than cgi-bin. However, some Web servers might require a specific extension. See your Web server documentation for more information.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095