Install & Configure LB on Apache (Steps usin

系统 1665 0

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]

  1. Use OpenSSL from the system (already installed)

  2. Download bits from: http://archive.apache.org/dist/httpd/binaries/win32/apache_2.0.59-win32-x86-openssl-0.9.7j.msi <download-dir>

  3. Double click the msi file for installation [ Remember to give the fully qualified machine name for ServerName

  4. Backup httpd.conf & ssl.conf from <apache-install>/conf

  5. Uncomment LoadModule ssl_module modules/mod_ssl.so in httpd.conf

  6. Remove the <IfDefine SSL> and matching </IfDefine> lines in ssl.conf

  7. Creating Security Certificate

    1. Download openssl.cnf to <download-dir> from http://tud.at/programm/openssl.cnf

    2. 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}

    3. mkdir <apache-install>/conf/ssl.crt and <apache-install>/conf/ssl.key

    4. Create the the certificate file as <apache-install>/conf/ssl.crt/server.crt copying from BEGIN CERTIFICATE to END CERTIFICATE from newreq.pem

    5. openssl rsa -in newreq.pem -out <apache-install>/conf/ssl.key/server.key

    6. Edit <apache-install>/conf/ssl.conf

      1. set the virtual host name to fully qualified m/c name [replace "_default_" with fully qualified m/c name ]

      2. Change server name to the fully qualified machine name followed by port number

Start Apache in secure mode

  1. <apache-install>/bin/Apache -k stop  & <apache-install>/bin/Apache -k startssl 

  2. Make sure the localhost:80 & localhost:443 are accessible in a browser

  3. 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.

  1. Download bits from http://www.java.net/download/javaee5/v2ur1/promoted/Windows/glassfish-installer-v2ur1-b09d-windows.jar

  2. java -Xmx256m -jar glassfish-installer-v2ur1-b09d-windows.jar - to unbundle glassfish.

  3. cd glassfish

  4. chmod -R +x lib/ant/bin

  5. lib/ant/bin/ant -f setup-cluster.xml  [You might need to set the ANT_HOME to glassfish/lib/ant]

Install LB Plugin.

  1. Download latest LB plugin from http://download.java.net/javaee5/external/WINNT/aslb/jars/ [e.g aslb-9.1.1-b6.jar]

  2. Extract jar to get SUNWaspx.zip SUNWaslb.zip

  3. mkdir glassfish/lib/plugin

  4. cp the zips from step 2 and unzip it in glassfish/lib/plugin [ make sure to remove the zip files from this directory]

  5. chmod -R 755 glassfish/lib/plugin/lib

Configure LB Plugin for Apache.

  1. Create sub-directories in <Apache-install>/modules directory as - resource  and errorpages

  2. Create sub-directory in <Apache-install> directory as - sec_db_files

  3. cp <glassfish>/lib/plugin/lib/webserver-plugin/windows/apache2/LBPlugin*.res <Apache-install>/modules/resource/

  4. cp <glassfish>/lib/plugin/lib/webserver-plugin/windows/apache2/mod_loadbalancer.dll <Apache-install>/modules/

  5. cp <glassfish>/lib/plugin/lib/webserver-plugin/windows/apache2/errorpages/* <Apache-install>/modules/errorpages/

  6. cp <glassfish>/lib/plugin/lib/install/templates/loadbalancer.xml.example <Apache-install>/conf/

  7. cp <glassfish>/lib/plugin/lib/dtds/sun-loadbalancer* <Apache-install>/conf/

  8. 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
          
  9. Double-check apache-install location and the fully qualified machine name for ServerName in httpd.conf

  10. cp <glassfish>lib/plugin/lib/webserver-plugin/windows/apache2/*.db <Apache-install>/sec_db_files/

  11. 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元等您想捐的金额吧,狠狠点击下面给点支持吧,站长非常感激您!手机微信长按不能支付解决办法:请将微信支付二维码保存到相册,切换到微信,然后点击微信右上角扫一扫功能,选择支付二维码完成支付。

【本文对您有帮助就好】

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描上面二维码支持博主2元、5元、10元、自定义金额等您想捐的金额吧,站长会非常 感谢您的哦!!!

发表我的评论
最新评论 总共0条评论