设为首页 收藏本站
查看: 367|回复: 0

[经验分享] Install & Configure LB on Apache (Steps using Glassfish v2ur1 & Apache 2.0.59 on

[复制链接]

尚未签到

发表于 2017-1-4 11:34:27 | 显示全部楼层 |阅读模式
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  [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
.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-323819-1-1.html 上篇帖子: 利用apache的proxy-ajp做apache与tomcat的结合(转载) jackey 下篇帖子: Apache FlexJS 0.0.1 和 Apache Flex FalconJX 0.0.1发布
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表