The load balancer plug-in installation program makes a few modifications to the web server’s configuration files. The changes made depend upon the web server.
The load balancer plug-in can be installed either along with Sun Java System Application Server Enterprise Edition, or separately, on a machine running the supported web server. For complete details on the installation procedure, see Chapter 1, Installing Application Server Software, in Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Installation Guide (if using the standalone Application Server) or Sun Java Enterprise System 2005Q5 Installation Guide (if using Java Enterprise System).
The installation program adds the following entries to the Sun Java System Web Server’s configuration files:
To the web server instance’s magnus.conf file, it adds:
##EE lb-pluginInit fn="load-modules" shlib="web_server_install_dir/plugins/lbplugin/bin/libpassthrough.so" funcs="init-passthrough,service-passthrough,name-trans-passthrough" Thread="no" Init fn="init-passthrough" ##end addition for EE lb-plugin
To the web server instance’s obj.conf file, it adds:
<Object name=default> NameTrans fn="name-trans-passthrough" name="lbplugin" config-file="web_server_install_dir/web_server_instance/config/loadbalancer.xml" <Object name="lbplugin"> ObjectType fn="force-type" type="magnus-internal/lbplugin" PathCheck fn="deny-existence" path="*/WEB-INF/*" Service type="magnus-internal/lbplugin" fn="service-passthrough" Error reason="Bad Gateway" fn="send-error" uri="$docroot/badgateway.html" </object>
In the above code, lbplugin is a name that uniquely identifies the Object, and web_server_install_dir/ web_server_instance/config/loadbalancer.xml is the location of the XML configuration file for the virtual server on which the load balancer is configured to run.
After installing, configure the load balancer as described in Setting Up HTTP Load Balancing
To use Apache Web Server, you must perform certain configuration steps before installing the load balancer plug-in. The load balancer plug-in installation also makes additional modifications to the Apache Web Server. After the plug-in is installed, you must perform additional configuration steps.
On Apache 1.3, when more than one Apache child processes runs, each process has its own load balancing round robin sequence. For example, if there are two Apache child processes running, and the load balancer plug-in load balances on to two application server instances, the first request is sent to instance #1 and the second request is also sent to instance #1. The third request is sent to instance #2 and the fourth request is sent to instance #2 again. This pattern is repeated (instance1, instance1, instance2, instance2, etc.)This behavior is different from what you might expect, that is, instance1, instance2, instance1, instance2, etc. In Sun Java System Application Server, the load balancer plug-in for Apache instantiates a load balancer instance for each Apache process, creating an independent load balancing sequence.
Apache 2.0 has multithreaded behavior if compiled with the --with-mpm=worker option.
For the Apache Web Server, your installation must meet the minimum requirements, depending on the version of Apache.
With Apache 1.3, the load balancer plug-in requires:
openssl-0.9.7e (source)
mod_ssl-2.8.16-1.3.x (source), where x represents the version of Apache. The mod_ssl version must match the Apache version.
gcc-3.3-sol9-sparc-local packages (for Solaris SPARC)
gcc-3.3-sol9-intel-local packages (for Solaris x86)
flex-2.5.4a-sol9-sparc-local packages (for Solaris SPARC)
flex-2.5.4a-sol9-intel-local packages (for Solaris x86)
The software sources are available at http://www.sunfreeware.com
In addition, before compiling Apache:
On the Linux platform, install Sun Java System Application Server on the same machine.
On the Solaris operating system, ensure that gcc version 3.3 and make are in the PATH, and flex is installed.
On the Solaris 10 operating system, before running make for OpenSSL, run mkheaders, located in /usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3/install-tools on Solaris SPARC or /usr/local/lib/gcc-lib/i386-pc-solaris2.9/3.3/install-tools on Solaris x86.
If you are using gcc on Red Hat Enterprise Linux Advanced Server 2.1, the version must be later than gcc 3.0.
To use C compiler other than gcc, set the path of the C compiler and make utility in the PATH environment variable. For example, with the sh shell: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:appserver_installdir/lib
With Apache 2.0, the load balancer plug-in requires:
openssl-0.9.7e (source)
httpd-2.0.49 (source)
gcc-3.3-sol9-sparc-local packages (for Solaris SPARC).
gcc-3.3-sol9-intel-local packages (for Solaris x86)
flex-2.5.4a-sol9-sparc-local packages (for Solaris SPARC)
flex-2.5.4a-sol9-intel-local packages (for Solaris x86)
The software sources are available at http://www.sunfreeware.com
In addition, before compiling Apache:
On the Linux platform, install Sun Java System Application Server on the same machine.
On the Solaris operating system, ensure that gcc version 3.3 and make are in the PATH, and flex is installed.
On the Solaris 10 operating system, before running make for OpenSSL, run mkheaders, located in /usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3/install-tools on Solaris SPARC or /usr/local/lib/gcc-lib/i386-pc-solaris2.9/3.3/install-tools on Solaris x86.
If you are using gcc on Red Hat Enterprise Linux Advanced Server 2.1, the version must be later than gcc 3.0.
To use a C compiler other than gcc, set the path of the C compiler and make utility in the PATH environment variable. For example, with the sh shell:export LD_LIBRARY_PATH= app_server_install_dir/lib:$LD_LIBRARY_PATH.
Before installing the load balancer plug-in for Apache, install the Apache Web Server. The Apache source must be compiled and built to run with SSL. This section describes the minimum requirements and high-level steps needed to successfully compile Apache Web Server to run the load balancer plug-in. These requirements and steps only apply to the Solaris and Linux versions of the software. For information on the Windows version of Apache, see the Apache web site.
You must have already downloaded and uncompressed the Apache software.
Download and unpack the OpenSSL source.
Compile and build OpenSSL.
This step is not required on the Linux platform if OpenSSL 0.9.7.e is installed.
Enter these commands:
cd openssl-0.9.7e make make install |
For more information about OpenSSL, see the http://www.openssl.org/.
Follow one of these procedures, depending on the version of Apache:
For Apache 1.3, configure Apache with mod_ssl with the following steps:
Unpack the mod_ssl source.
cd mod_ssl-2.8.14–1.3.x
./configure –with-apache=../apache_1.3.x --with-ssl=../openssl-0.9.7e --prefix=install_path --enable-module=ssl --enable-shared=ssl --enable-rule=SHARED_CORE --enable-module=so
In the above commands, x is the Apache version number, and install_path is the directory in which to install Apache.
For more information on mod_ssl, see http://www.modssl.org.
For Apache 2.0, configure the source tree:
For Apache on Linux 2.1, before compiling:
Open src/MakeFile and find the end of the automatically generated section.
Add the following lines after the first four lines after the automatically generated section:
LIBS+= -licuuc -licui18n -lnspr4 -lpthread -lxerces-c -lsupport -lnsprwrap -lns-httpd40 LDFLAGS+= -L/appserver_installdir/lib -L/opt/sun/private/lib
Note that -L/opt/sun/private/lib is only required if you installed Application Server as part of a Java Enterprise System installation.
For example:
## (End of automatically generated section) ## CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) LIBS=$(EXTRA_LIBS) $(LIBS1) INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) "LIBS+= -licuuc -licui18n -lnspr4 -lpthread -lxerces-c -lsupport -lnsprwrap -lns-httpd40 LDFLAGS+= -L/appserver_installdir /lib -L/opt/sun/private/lib
Set environment variable LD_LIBRARY_PATH.
With all installations, set it to: appserver_install_dir/lib
With Java Enterprise System Installations, set it to appserver_install_dir/lib:opt/sun/private/lib .
Compile Apache as described in the installation instructions for the version you are using.
For more information, see the http://httpd.apache.org/
In general the steps are:
Configure Apache for your environment.
The load balancer plug-in installation program extracts the necessary files to a directory in the web server’s root directory:
For Apache 1.3, the directory is libexec.
For Apache 2.0, the directory is modules .
It adds the following entries to the web server instance’s httpd.conf file:
<VirtualHost machine_name:443> ##Addition for EE lb-plugin LoadFile /usr/lib/libCstd.so.1 LoadModule apachelbplugin_module libexec/mod_loadbalancer.so #AddModule mod_apachelbplugin.cpp <IfModule mod_apachelbplugin.cpp> config-file webserver_instance/conf/loadbalancer.xml locale en </IfModule> <VirtualHost machine_ip_address> DocumentRoot "webserver_instance/htdocs" ServerName server_name </VirtualHost> ##END EE LB Plugin ParametersVersion 7
Apache Web Server must have the correct security files to work well with the load balancer plug-in.
Create a directory called sec_db_files under apache_install_dir.
Copy application_server_domain_dir /config/*.db to apache_install_dir /sec_db_files.
Depending on the platform, perform additional configuration.
On the Solaris platform:
Add the path /usr/lib/mps/secv1 to LD_LIBRARY_PATH in the apache_install_dir/bin/apachectl script. The path must be added before /usr/lib/mps.
On Linux:
Add the path /opt/sun/private/lib to LD_LIBRARY_PATH in the apache_install_dir/bin/apachectl script. The path must be added before /usr/lib.
On Microsoft Windows:
Add a new path to the Path environment variable.
Click Start->Settings->Control Panel->System->Advanced->Environment Variables->System Variables.
Add application_server_install_dir /bin to the Path environment variable.
Set the environment variable NSPR_NATIVE_THREADS_ONLY to 1.
In the Environment Variables window, under System Variables, click New. Enter Variable name of NSPR_NATIVE_THREADS_ONLY and Variable value of 1.
Restart the machine.
To configure Microsoft Internet Information Services (IIS) to use the load balancer plug-in, modify certain properties in Windows Internet Services Manager. The Internet Services Manager is located in the Administrative Tools folder in the Control Panel folder.
Make these modifications after installing the Sun Java System Application Server.
Open the Internet Services Manager.
Select the web site for which you want to enable the plug-in.
This web site is typically named the Default Web Site.
Right click on the web site and select Properties to open the Properties notebook.
Add a new ISAPI filter, following these steps:
Create and configure a new virtual directory:
Right click on the default web site, select New, and then Virtual Directory.
The Virtual Directory Creation Wizard opens.
In the Alias field, type sun-passthrough .
In the Directory field, type C:\Inetpub\wwwroot\sun-passthrough.
Check the Execute Permission checkbox.
Leave all other permission-related check boxes are left unchecked.
Click Finish.
Add the path of sun-passthrough.dll file and application_server_install_dir /bin to the system’s PATH environment variable.
Restart the machine.
Stop and start the web server for the new settings to take effect.
To stop the web server, right click on the web site and select Stop . To start the web server, right click on the web site and select Start.
Verify that the web server, load balancer plug-in, and Application Server are operating correctly.
Type the following in a web browser to access the web application context root: http://webserver_name/web_application, where webserver_name is the host name or IP address of the web server and web_application is the context root that you listed in the C:\Inetpub\wwwroot\sun-passthrough\sun-passthrough.properties file.
The installer automatically configures the following properties in sun-passthrough.properties. You can change the default values.
Property |
Definition |
Default Value |
---|---|---|
lb-config-file |
Path to the load balancer configuration file |
IIS_www_root\sun-passthrough\loadbalancer.xml |
log-file |
Path to the load balancer log file |
IIS_www_root\sun-passthrough\lb.log |
log-level |
Log level for the web server |
INFO |
The Sun Java System Application Server installer does not allow the installation of multiple load balancer plug-ins on a single machine. To have multiple web servers with the load balancer plug-in on a single machine, in either a single cluster or multiple clusters, a few manual steps are required to configure the load balancer plug-in.
Configure the new web server instance to use the load balancer plug-in.
Follow the steps in Modifications to Sun Java System Web Server or Using Apache Web Server , or Installation
Copy the DTD file.
Copy sun-loadbalancer_1_1.dtd from the existing web server instance’s config directory to the new instance’s config directory.
Set up the load balancer configuration file. Either:
Copy the existing load balancer configuration.
Use an existing load balancer configuration, copy the loadbalancer.xml file from the existing web server instance’s config directory to the new instance’s config directory.
Create a new load balancer configuration:
Use asadmin create-http-lb-config to create a new load balancer configuration.
Export the new configuration to a loadbalancer.xml file using asadmin export http-lb-config.
Copy that loadbalancer.xml file to the new web server’s config directory.
For information on creating a load balancer configuration and exporting it to a loadbalancer.xml file, see Creating an HTTP Load Balancer Configuration