Connecting to external web servers

After you install and configure JRun, you can connect it to an external web server so that requests made to Apache, for example, are examined by the JRun filter, processed, and then sent back through the Apache web server to the requesting client.

Be aware that each JRun server is by default connected to an instance of the JRun Web Server (JWS). If you want a more robust environment, you can connect an external web server, such as Apache, Netscape iPlanet, or Microsoft IIS, to the JRun server. You can have any number of web servers connected to a single JRun server.

To connect JRun to your customer's external web server, you use the included Web Server Configuration tool. You can use this tool in the following ways, depending on what you want your customer's user-experience to be:

Silently running the Web Server Configuration tool

With the command-line version of the tool, you can supply all the options on the command line or you can use a property file to supply the responses using file redirection. The property file contains tags that are equivalents of command-line options. This is commonly used by OEMs and ISVs that do not want to expose JRun to their customers.

On the command line, the Web Server Configuration tool uses the following syntax:

%> java -jar jrun_root/lib/wsconfig.jar [options]

To use a property file for options, use the following syntax:

%> java -jar jrun_root/lib/wsconfig.jar -f property-file

For more information on using the Web Server Configuration tool command-line options, see Installing JRun.

Including the Web Server Configuration tool in the installer

To set up the Web Server Configuration tool to configure the connection without requiring your users to run it, you can supply its settings and run it from the command line during the installation process.

You can insert the following example into your installation scripts. It prompts the user for the type of web server and invokes the wsconfig.jar file with command line options:

# JRun Web Server Configuration tool installation
# This is generally run after the JRun and application installation. JRun servers need to be available for this to run.
#
WEBSERV="$WEBSERVER$"
echo "Running the connector installer"
COUNT=6
while [ "$DOLLAR${COUNT}" -gt "0" ]; do 
if [ "$DOLLAR$WEBSERV" = "Apache 1.3.x - 2.x" ]; then
WEBSERVER="Apache"
echo "Running $DOLLAR$WEBSERVER connector wizard..." 
Sleep 6
OUTPUT=`LD_ASSUME_KERNEL=2.2.9; export LD_ASSUME_KERNEL; $JAVA_EXECUTABLE$ -jar $USER_INSTALL_DIR$/runtime/lib/wsconfig.jar -ws Apache -dir $APACHECONF$ 2>&1`  
elif [ "$DOLLAR$WEBSERV" = "Netscape/IPlanet" ]; then
WEBSERVER="Netscape"
echo "Running $DOLLAR$WEBSERVER connector wizard..."
OUTPUT=`LD_ASSUME_KERNEL=2.2.9; export LD_ASSUME_KERNEL; $JAVA_EXECUTABLE$ -jar $USER_INSTALL_DIR$/runtime/lib/wsconfig.jar -ws nes -dir $NETSCAPE_CONF$ 2>&1`
else 
break
fi
echo $DOLLAR$OUTPUT
echo $DOLLAR$OUTPUT | grep -w "Could not connect to any JRun servers" > /dev/null 2>&1 || break
echo "Jrun not started, will retry $DOLLAR$COUNT more time(s)"                
COUNT=`expr $DOLLAR$COUNT - 1`
sleep 2  
[ "$DOLLAR$COUNT" -eq "0" ] && {
echo "The connector wizard has not been able to contact the app server, connector installation aborted."
exit 1
}
done
exit 0

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/jrun/4/JRun_SDK_Guide/embedding2.htm