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

          常用鏈接

          留言簿(14)

          隨筆檔案(6)

          文章分類(467)

          文章檔案(423)

          相冊

          收藏夾(18)

          JAVA

          搜索

          •  

          積分與排名

          • 積分 - 827218
          • 排名 - 49

          最新評論

          閱讀排行榜

          評論排行榜

          一、下載軟件

          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.直接默認下一步安裝完成。(默認目錄:$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三個文件。
          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.如果是同一臺電腦上測試,則需要修改其中之一的server.xml文件中的端口

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

          (3) Session復制

          具體見%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 閱讀(1258) 評論(0)  編輯  收藏 所屬分類: tomcat
          主站蜘蛛池模板: 天等县| 西乡县| 来安县| 扬中市| 长子县| 涞水县| 庐江县| 佛坪县| 西乌珠穆沁旗| 金乡县| 都江堰市| 益阳市| 庐江县| 乐亭县| 页游| 扶风县| 惠东县| 平顶山市| 中牟县| 汉阴县| 奉节县| 西乌珠穆沁旗| 上高县| 莎车县| 西峡县| 任丘市| 张家界市| 英德市| 富锦市| 桃江县| 宁夏| 庐江县| 白河县| 玛纳斯县| 平度市| 胶南市| 名山县| 卢龙县| 镇原县| 贵阳市| 安陆市|