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
[ 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? [You might need to set the ANT_HOME to glassfish/lib/ant]
Install LB Plugin.
-
Download latest LB plugin from http://download.java.net/javaee5/external/WINNT/aslb/jars/ [e.g aslb-9.1.1-b6.jar]
-
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 .
Install & Configure LB on Apache (Steps using Glassfish v2ur1 & Apache 2.0.59 on
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
