Try OpenEdge Now
skip to main content
Administration
WebSpeed Administration : Configuring WebSpeed on UNIX : Setting up WebSpeed on the Web server machine : Restarting the Netscape Web server : Configuring a CGI Messenger
 
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 sets WebSpeed environment variables and invokes the Messenger executable, cgiip.
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.
The following 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. The following table describes the various options.
Table 56. 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). The following is a sample script that shows how you might do this:
# save CGI environment
env >/tmp/webapp.env
# save application output
outfile=/tmp/webapp.out
/usr/dlc/bin/cgiip -i WSbroker 2>&1 | tee $outfile
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 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).