Install & Configure LB on Apache (Steps using Glassfish v2ur1 & Apache 2.0.59 on
Install & Configure LB on Apache (Steps using Glassfish v2ur1 & Apache 2.0.59 on Windows)In Glassfish 9.1.1, LB installation was done using the AS installer.
The installer would edit the Apache config files as well. But,
Glassfish v2 ur1 does not have LB bundled with it. The users will have
to download the LB and manually configure it. Hence this blog, which
gives you detailed steps to install LB and configure it with Apache. If
you are using the Sun WebServer, the steps are available here
Install Apache with SSL
Install Glassfish v2ur1
Install LB Plugin
Configure LB
Plugin for Apache
Install Apache with SSL
[http://appserver-sqe.red.iplanet.com/twiki/pub/TWiki/TWikiDocGraphics/help.gif
http://www.neilstuff.com/apache/apache2-ssl-windows.htm]
[*]
Use OpenSSL from the system
(already installed)
[*]
Download bits from: http://archive.apache.org/dist/httpd/binaries/win32/apache_2.0.59-win32-x86-openssl-0.9.7j.msi
<download-dir>
[*]
Double click the msi file for
installation [ Remember to give the fully qualified machine name for
ServerName
[*]
Backup httpd.conf & ssl.conf
from <apache-install>/conf
[*]
Uncomment LoadModule ssl_module
modules/mod_ssl.so in httpd.conf
[*]
Remove the <IfDefine SSL>
and matching </IfDefine> lines in ssl.conf
[*]
Creating Security Certificate
[*]
Download openssl.cnf to
<download-dir> from http://tud.at/programm/openssl.cnf
[*]
openssl req -config
<download-dir>/openssl.cnf -new -x509 -keyout newreq.pem -out
newreq.pem -days 365 {Make sure WS instance-name/lb
device-host/common-name for certificate are the same}
[*]
mkdir
<apache-install>/conf/ssl.crt and
<apache-install>/conf/ssl.key
[*]
Create the the certificate file
as <apache-install>/conf/ssl.crt/server.crt copying from
BEGIN CERTIFICATE to END CERTIFICATE from newreq.pem
[*]
openssl rsa -in newreq.pem -out
<apache-install>/conf/ssl.key/server.key
[*]
Edit
<apache-install>/conf/ssl.conf
[*]
set the virtual host name to
fully qualified m/c name [replace "_default_" with fully
qualified m/c name ]
[*] Change server name to the fully qualified machine name
followed by port number
Start Apache in secure
mode
[*]
<apache-install>/bin/Apache
-k stop & <apache-install>/bin/Apache
-k startssl
[*]
Make sure the localhost:80 &
localhost:443 are accessible in a browser
[*] check the <apache-install>/logs/errors to make sure
there are no errors. {File does not exist:
<apache-install>/htdocs/favicon.ico Is a harmless error if it
appears in the log .}
Install Glassfish v2ur1.
[*]
Download bits from
http://www.java.net/download/javaee5/v2ur1/promoted/Windows/glassfish-installer-v2ur1-b09d-windows.jar
[*]
java -Xmx256m -jar
glassfish-installer-v2ur1-b09d-windows.jar - to unbundle glassfish.
[*]
cd glassfish
[*]
chmod -R +x lib/ant/bin
[*] lib/ant/bin/ant -f setup-cluster.xml
Install
LB Plugin.
[*]
Download latest LB plugin from
http://download.java.net/javaee5/external/WINNT/aslb/jars/
[*]
Extract jar to get SUNWaspx.zip
SUNWaslb.zip
[*]
mkdir glassfish/lib/plugin
[*]
cp the zips from step 2 and unzip
it in glassfish/lib/plugin [ make sure to remove the zip files from
this directory]
[*] chmod -R 755 glassfish/lib/plugin/lib
Configure LB Plugin for Apache.
[*]
Create sub-directories in
<Apache-install>/modules directory as - resource and errorpages
[*]
Create sub-directory in
<Apache-install> directory as - sec_db_files
[*]
cp
<glassfish>/lib/plugin/lib/webserver-plugin/windows/apache2/LBPlugin*.res
<Apache-install>/modules/resource/
[*]
cp
<glassfish>/lib/plugin/lib/webserver-plugin/windows/apache2/mod_loadbalancer.dll
<Apache-install>/modules/
[*]
cp
<glassfish>/lib/plugin/lib/webserver-plugin/windows/apache2/errorpages/*
<Apache-install>/modules/errorpages/
[*]
cp
<glassfish>/lib/plugin/lib/install/templates/loadbalancer.xml.example
<Apache-install>/conf/
[*]
cp
<glassfish>/lib/plugin/lib/dtds/sun-loadbalancer*
<Apache-install>/conf/
[*] Append httpd.conf file with:
##BEGIN EE LB Plugin Parameters
LoadModule apachelbplugin_module modules/mod_loadbalancer.dll
<IfModule mod_apache2lbplugin.cpp>
config-file "C:/Program Files/Apache Group/Apache2/conf/loadbalancer.xml"
locale en
</IfModule>
<VirtualHost 10.12.8.107>
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
ServerName vm07
</VirtualHost>
##END EE LB Plugin Parameters
[*]
Double-check apache-install
location and the fully qualified machine name for ServerName in
httpd.conf
[*]
cp
<glassfish>lib/plugin/lib/webserver-plugin/windows/apache2/*.db
<Apache-install>/sec_db_files/
[*] Start Apache and make sure you are able to access the port 80
& 443. The error logs will have errors till the loadbalancer.xml
is setup.
Steps on How to Configure Loadbalancer.xml are here
.
页:
[1]