隨筆 - 6  文章 - 129  trackbacks - 0
          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(14)

          隨筆檔案(6)

          文章分類(467)

          文章檔案(423)

          相冊(cè)

          收藏夾(18)

          JAVA

          搜索

          •  

          積分與排名

          • 積分 - 827240
          • 排名 - 49

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          一、下載軟件

          1.Apache 2.2.19

          http://mirror.bjtu.edu.cn/apache//httpd/binaries/win32/httpd-2.2.19-win32-x86-no_ssl.msi

          2.Tomcat 6.0.32

          http://mirror.bjtu.edu.cn/apache/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32-windows-x86.zip

          3.Apache Tomcat Connector(mod_jk 1.2.31)

          http://apache.etoak.com//tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.31/mod_jk-1.2.31-httpd-2.2.3.so

          二、安裝配置

          (1) Apache

          1.直接默認(rèn)下一步安裝完成。(默認(rèn)目錄:$APACHE_HOME=C:\Program Files\Apache Software Foundation\Apache2.2\)

          2.將下載好的mod_jk-1.2.31-httpd-2.2.3.so拷貝至$APACHE_HOME\modules,并重命名為:mod_jk.so。

          3.編輯Apache目錄下的conf/httpd.conf文件,在末尾添加:
          # include mod_jk  
          Include conf/jk/mod_jk.conf
          4.在$APACHE_HOME\conf目錄下建立jk目錄,并新建mod_jk.conf,uriworkermap.properties,workers.properties三個(gè)文件。
          5.編輯mod_jk.conf并增加:
          LoadModule jk_module modules/mod_jk.so
          JkWorkersFile conf/jk/workers.properties
          JkMountFile conf/jk/uriworkermap.properties
          JkLogFile logs/mod_jk.log
          JkShmFile logs/mod_jk.shm
          JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
          JkRequestLogFormat "%w %V %T"
          JkMount /* controller

          6.編輯workers.properties并增加:
          worker.list = controller,status,tomcat1,tomcat2

          worker.template.type=ajp13
          worker.template.ping_mode=A
          worker.template.ping_timeout=20000
          worker.template.connection_pool_size=1024
          worker.template.socket_keepalive=true
          worker.template.socket_connect_timeout=20000

          worker.tomcat1.reference=worker.template
          worker.tomcat1.port=8009
          worker.tomcat1.host=localhost

          worker.tomcat2.reference=worker.template
          worker.tomcat2.port=9009
          worker.tomcat2.host=localhost

          worker.controller.type=lb
          worker.controller.balanced_workers=tomcat1,tomcat2
          worker.controller.sticky_session=false

          worker.status.type=status
          worker.status.read_only=true

          7.編輯uriworkermap.properties并增加:
          /*=controller
          #!/*.gif=controller
          #!/*.jpg=controller
          #!/*.png=controller
          #!/*.css=controller
          #!/*.js=controller
          #!/*.htm=controller
          #!/*.html=controller

          /jkstatus=status

          (2) TOMCAT

          1.解壓兩次apache-tomcat-6.0.32-windows-x86.zip,文件夾分別命名:tomcat1,tomcat2

          2.如果是同一臺(tái)電腦上測(cè)試,則需要修改其中之一的server.xml文件中的端口

          其它
          在Apache Momitor 中添加或者刪除Service,
          使用httpd -k install 或者 httpd -k uninstall (在$APACHE_HOME\bin目錄下執(zhí)行)

          (3) Session復(fù)制

          具體見(jiàn)%Tomcat_home%/webapps/docs/cluster-howto.html

          To run session replication in your Tomcat 6.0 container, the following steps should be completed:

          • All your session attributes must implement java.io.Serializable
          • Uncomment the Cluster element in server.xml
          • If you have defined custom cluster valves, make sure you have the ReplicationValve defined as well under the Cluster element in server.xml
          • If your Tomcat instances are running on the same machine, make sure the tcpListenPort attribute is unique for each instance, in most cases Tomcat is smart enough to resolve this on it's own by autodetecting available ports in the range 4000-4100
          • Make sure your web.xml has the <distributable/> element or set at your <Context distributable="true" />
          • If you are using mod_jk, make sure that jvmRoute attribute is set at your Engine <Engine name="Catalina" jvmRoute="node01" > and that the jvmRoute attribute value matches your worker name in workers.properties
          • Make sure that all nodes have the same time and sync with NTP service!
          • Make sure that your loadbalancer is configured for sticky session mode.


          posted on 2011-06-16 12:02 Ke 閱讀(1259) 評(píng)論(0)  編輯  收藏 所屬分類: tomcat
          主站蜘蛛池模板: 晋中市| 莱西市| 阆中市| 湘阴县| 自贡市| 神农架林区| 梓潼县| 吐鲁番市| 龙岩市| 米易县| 错那县| 桑日县| 抚远县| 绍兴市| 潍坊市| 惠安县| 梁山县| 龙川县| 宜春市| 上饶市| 呼玛县| 九龙城区| 荃湾区| 黔西县| 宁海县| 延边| 德江县| 启东市| 龙里县| 闸北区| 南江县| 宜兰市| 稷山县| 青神县| 石河子市| 和林格尔县| 河池市| 陇南市| 富锦市| 滁州市| 安义县|