Apache2.2+Tomcat6集群配置

  1. httpd-2.2.22-win32-x86-openssl-0.9.8t.msi下载、安装。

  2. 修改apache/conf目录下httpd.conf文件。

    文件最后增加:

    #加载mod_jk模块,mod_jk-1.2.31-httpd-2.2.3.so可以去官方下载。

    LoadModule jk_module modules/mod_jk-1.2.31-httpd-2.2.3.so

    # Where to find workers.properties

    JkWorkersFile conf/workers.properties

    #增加虚拟机配置

    <VirtualHost *:80>

    JkMount /webapp server1

    JkMount /webapp/* server1

    </VirtualHost>

  3. 配置workers.properties

        worker.list=server1

        # Define a tomcat1 worker using ajp13

        worker.tomcat1.port=8009

        worker.tomcat1.host=ip地址

        worker.tomcat1.type=ajp13

        worker.tomcat1.lbfactor=1

        

        worker.tomcat2.port=8009

        worker.tomcat2.host=ip地址

        worker.tomcat2.type=ajp13

        worker.tomcat2.lbfactor=1

    

        # Define the server1 worker,使用粘性session

        worker.server1.type=lb

        worker.server1.balance_workers=tomcat1,tomcat2

        worker.server1.sticky_session=true

        worker.server1.sticky_session_force=false

    4.    配置tomcat 6 集群

         修改Tomcat/conf/server.xml打开以下两句,配置tomcat2相同

<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat1"> 

<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>


    5.启动,测试。



    


你可能感兴趣的:(apache,tomcat,集群,负载,mode_jk)