Contained WithinFind More DocumentationFeatured Support Resources | Download this book in PDF (1536 KB)
Using Apache Web ServerThe load balancer plug-in bundled with Application Server 9.1 supports Apache Web Server 2.0.x. To use Apache Web Server, you must perform certain configuration steps before and after 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. Note – Apache 2 has multithreaded behavior if compiled with the --with-mpm=worker option.
Requirements for Using Apache Web ServerFor the Apache Web Server, your installation must meet the minimum requirements. With Apache, the load balancer plug-in requires:
The software sources are available at http://www.sunfreeware.com In addition, before compiling Apache:
Note – To use a C compiler other than gcc, set the path of the C compiler and make utility in the PATH environment variable. Applying the Apache Web Server PatchBefore installing the load balancer plug-in for Apache, apply the patch for the Apache Web Server issue 12355. More details about this issue are available at http://issues.apache.org/bugzilla/show_bug.cgi?id=12355. This patch is required for the Auto Apply feature to work. To apply the patch, follow these steps.
Configuring Apache before Installing the Load Balancer Plug-inThe 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. Note – The instructions included here are adapted from the instructions at http://httpd.apache.org/docs. For detailed instructions on installing SSL-aware Apache, please see that web site.
|
[warn] RSA server certificate CommonName (CN) hostname does NOT match server name! |
For more information on installing certificates for Apache, see To Create a Security Certificate for Apache .
In httpd.conf, for ServerName www.example.com:80, replace www.example.com with the hostname of the local system where Apache is installed.
Without this change, you see warnings when you start Apache that the system could not determine the server's fully qualified domain name, and that there are overlapping VirtualHost entries.
Ensure that the Apache user has the required access permissions to the apache-install-location/conf/ directory and files in this directory.
The Apache user is the UNIX user under which the Apache server responds to requests. This user is defined in the file httpd.conf.
If you installed Apache as a root user, read the note about configuring the Apache user and group in apache-install-location/conf/httpd.conf.
Ensure that your configuration of users and groups meets the security requirements for this directory. For example, to restrict access to this directory, add the Apache user to the same user group as the owner of the directory.
To ensure that the Auto Apply feature operates correctly, grant the Apache user read access, write access, and execute access to the apache-install-location/conf/ directory.
To ensure that the load balancer plug-in is initialized when Apache is started, grant the Apache user read access and write access to the following files:
apache-install-location/conf/loadbalancer.xml
apache-install-location/conf/sun-loadbalancer_1_2.dtd
You must manually export the DAS certificate using the following command:
appserver-install-dir/lib/upgrade/certutil -L -d appserver-instance-dir/config -n s1as -a -o sjsas.crt
This certificate will be required at the time of installing the load balancer plug-in.
The Application Server 9.1 installation program performs the following tasks for you.
Imports the DAS certificate by copying sjsas.crt to the apache-install-dir/conf/ssl.crt directory.
Appends the following lines to httpd.conf.
<Location /lbconfigupdate>
SSLVerifyClient require
SSLVerifyDepth 1
SSLRequireSSL
SSLCACertificateFile apache-install-dir//conf/ssl.crt/sjsas.crt
SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)-/ \
and %{SSL_CLIENT_S_DN_O} eq "Sun Microsystems" \
and %{SSL_CLIENT_S_DN_OU} eq "Sun Java System Application Server" \
and %{SSL_CLIENT_M_SERIAL} eq "<*serial number*>" )
</Location>
<Location /getmonitordata>
SSLVerifyClient require
SSLVerifyDepth 1
SSLRequireSSL
SSLCACertificateFile apache-install-dir/conf/ssl.crt/sjsas.crt
SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)-/ \
and %{SSL_CLIENT_S_DN_O} eq "Sun Microsystems" \
and %{SSL_CLIENT_S_DN_OU} eq "Sun Java System Application Server" \
and %{SSL_CLIENT_M_SERIAL} eq "<*serial number*>" )
</Location>
The load balancer plug-in installation program extracts the necessary files to the modules directory in the web server’s root directory:
It adds the following entries to the web server instance’s httpd.conf file:
##BEGIN EE LB Plugin Parameters LoadModule apachelbplugin_module modules/mod_loadbalancer.so #AddModule mod_apache2lbplugin.cpp <IfModule mod_apache2lbplugin.cpp> config-file webserver-instance/httpd/conf/loadbalancer.xml locale en </IfModule> <VirtualHost machine-ip-address DocumentRoot "webserver-instance/httpd/htdocs" ServerName server-name </VirtualHost> ##END EE LB Plugin Parameters
Apache Web Server must have the correct security files to work with the load balancer plug-in. The load balancer depends on the NSS (Network Security Service) library, which requires these security database files. You need to get these security database files from Application Server, so an installation of Application Server must be available in a location accessible by the Web Server.
To configure Apache security files to work with the load balancer, do the following:
Append /usr/lib/mps to LD_LIBRARY_PATH in the Apache-install-dir/bin/apachectl script.
These steps are required to support HTTPS requests on Apache.
For detailed information on setting up a security certificate on Apache, see the instructions on http://httpd.apache.org/docs/2.2/ssl/ssl_faq.html and http://www.modssl.org/docs/2.8/ssl_faq.html. The following procedure is adapted from those web sites.
Set up the following environment variable:
OPENSSL_CONF=OpenSSL-installation-directory/apps/openssl.cnf.
Create the server certificate and key by executing the following command:
openssl req -new -x509 -keyout newreq.pem -out newreq.pem -days 365
When asked for a common name, give the host name on which you plan to run Apache. For all other prompts, enter values that meet any specific requirements you have.
This command creates newreq.pem.
Open the newly-created newreq.pem from the location where the openssl command was run.
Copy the lines beginning with BEGIN CERTIFICATE and ending with END CERTIFICATE and paste them in Apache-install-dir/conf/ssl.crt/server.crt. For example:
-----BEGIN CERTIFICATE----- .... ... -----END CERTIFICATE----- |
Copy the lines beginning with BEGIN RSA PRIVATE KEY and END RSA PRIVATE KEY and paste them in Apache-install-dir/conf/ssl.key/server.key. For example:
-----BEGIN RSA PRIVATE KEY----- ... ... ... -----END RSA PRIVATE KEY----- |
Make sure that the variables SSLCertificateKeyFileand SSLCertificateFile in Apache-install-dir/conf/ssl.conf have the correct values.
Ensure that the ServerName is not www.example.com. The ServerName should be the actual host name where Apache will run, matching the Common Name you entered when creating the server certificate and key.
For the sticky round robin feature to work, in the httpd.conf file, under the section prefork MPM, ensure that the values of the parameters StartServers and maxclients are set to 1. Otherwise, every new session request will spawn a new Apache process and the load balancer plug-in will be initialized resulting in requests landing in the same instance.
In general, you should start Apache with the same user that installed the Application Server. You must start Apache as root under the following circumstances:
If you are a Java Enterprise System user.
If you've used port numbers which are less than 1024.
If Apache runs as a different user from the user that starts it.
To start Apache in SSL mode, use one of the following commands:
apachetl startssl or apachetl -k start -DSSL
If needed, check the Apache web site for the latest information on starting the Apache server.
Install the load balancer plug-in. For detailed steps to install the plug-in, see Sun Java System Application Server 9.1 Installation Guide. During the installation, provide the path to the DAS certificate.
Log in to the Application Server Admin Console and create a new cluster. For steps to create a new cluster, refer to the Admin Console Online Help.
Create a new HTTP Load Balancer. While creating the load balancer, specify the FQDN of the web server host as the device host name, web server SSL Port as the device port and select the cluster you created in the previous step as the target. For detailed steps to create a new HTTP Load Balancer, refer to the Admin Console Online Help.
To verify that the communication between the DAS and the web server is working properly, in the Admin Console, navigate to the HTTP Load Balancers node and click the HTTP Load Balancer. In the Load Balancer Device Settings page that appears, press the Test Connection button.
If you have not enabled the Automatically Apply Changes option while creating a load balancer, then you must manually export the load balancer configuration by going to the Export tab and clicking Apply Changes now.
If the test connection fails, be sure to check the Application Server domain logs and the web server logs to troubleshoot the problem. Also check if all the configuration steps have been performed correctly.