`
yangzb
  • 浏览: 3500481 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Install & Configure LB on Apache (Steps using Glassfish v2ur1 & Apache 2.0.59 on

    博客分类:
  • Java
阅读更多

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

[HELP 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 .

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics