Apache 2.2 + Tomcat 6 + mod_jk 1.2.23 + Session Clustering

Source: Internet
Author: User

 

 Here is my server.xml from tomcat 1>> <Server port="8005" shutdown="SHUTDOWN">>>   <!--APR library loader. Documentation at /docs/apr.html -->>   <Listener className="org.apache.catalina.core.AprLifecycleListener"> SSLEngine="on" />>   <!--Initialize Jasper prior to webapps are loaded. Documentation at> /docs/jasper-howto.html -->>   <Listener className="org.apache.catalina.core.JasperListener" />>   <!-- JMX Support for the Tomcat server. Documentation at> /docs/non-existent.html -->>   <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />>   <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"> />>>   <!-- Global JNDI resources -->>   <GlobalNamingResources>>     <Resource name="UserDatabase" auth="Container">               type="org.apache.catalina.UserDatabase">               description="User database that can be updated and saved">               factory="org.apache.catalina.users.MemoryUserDatabaseFactory">               pathname="conf/tomcat-users.xml" />>   </GlobalNamingResources>>>   <Service name="Catalina">>>     <!-- Define an HTTP/1.1 Connector on port 8080 -->>     <Connector port="8080" protocol="HTTP/1.1">                connectionTimeout="20000">                redirectPort="8443" />>>     <!-- Define an AJP 1.3 Connector on port 8009 -->>     <Connector port="8009" protocol="AJP/1.3" redirectPort="8443">             address="192.168.6.174">             backlog="20">             connectionTimeout="0">             maxThreads="100">             tcpNoDelay="true" />>>     <Engine name="Catalina" defaultHost="localhost" jvmRoute="jcpres1">>>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"> resourceName="UserDatabase"/>>>       <Host name="localhost"  appBase="webapps">             unpackWARs="true" autoDeploy="true">             xmlValidation="false" xmlNamespaceAware="false">>>>         <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs">                prefix="access." suffix=".log" pattern="common"> resolveHosts="false"/>>>>         <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster">                 channelSendOptions="4">>>                 <Manager className="org.apache.catalina.ha.session.DeltaManager">                         expireSessionsOnShutdown="false">                         notifyListenersOnReplication="true"/>>>                 <Channel className="org.apache.catalina.tribes.group.GroupChannel">>>                         <Membership> className="org.apache.catalina.tribes.membership.McastService">                                 address="228.0.0.4">                                 port="26816">                                 frequency="500">                                 dropTime="3000"/>>>                         <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver">                                 address="192.168.6.174">                                 port="4000">                                 autoBind="100">                                 selectorTimeout="5000">                                 maxThreads="6"/>>>                         <Sender> className="org.apache.catalina.tribes.transport.ReplicationTransmitter">>                                 <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender">                                         timeout="3000"/>>                         </Sender>>>                         <Interceptor> className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>>>                         <Interceptor> className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>>>                 </Channel>>>                 <Valve className="org.apache.catalina.ha.tcp.ReplicationValve">                         filter=".*/.gif;.*/.js;.*/.jpg;.*/.png;.*/.htm;.*/.html;.*/.css;.*/.txt;"/>>>                 <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>>>                 <ClusterListener> className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/>>                 <ClusterListener> className="org.apache.catalina.ha.session.ClusterSessionListener"/>>>         </Cluster>>>       </Host>>     </Engine>>   </Service>> </Server>>>> Tomcat 2's server.xml>> <Server port="8005" shutdown="SHUTDOWN">>>   <!--APR library loader. Documentation at /docs/apr.html -->>   <Listener className="org.apache.catalina.core.AprLifecycleListener"> SSLEngine="on" />>   <!--Initialize Jasper prior to webapps are loaded. Documentation at> /docs/jasper-howto.html -->>   <Listener className="org.apache.catalina.core.JasperListener" />>   <!-- JMX Support for the Tomcat server. Documentation at> /docs/non-existent.html -->>   <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />>   <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"> />>>   <!-- Global JNDI resources -->>   <GlobalNamingResources>>     <Resource name="UserDatabase" auth="Container">               type="org.apache.catalina.UserDatabase">               description="User database that can be updated and saved">               factory="org.apache.catalina.users.MemoryUserDatabaseFactory">               pathname="conf/tomcat-users.xml" />>   </GlobalNamingResources>>>   <Service name="Catalina">>>     <!-- Define an HTTP/1.1 Connector on port 8080 -->>     <Connector port="8080" protocol="HTTP/1.1">                connectionTimeout="20000">                redirectPort="8443" />>>     <!-- Define an AJP 1.3 Connector on port 8009 -->>     <Connector port="8009" protocol="AJP/1.3" redirectPort="8443">             address="192.168.6.174">             backlog="20">             connectionTimeout="0">             maxThreads="100">             tcpNoDelay="true" />>>     <Engine name="Catalina" defaultHost="localhost" jvmRoute="jcpres2">>>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"> resourceName="UserDatabase"/>>>       <Host name="localhost"  appBase="webapps">             unpackWARs="true" autoDeploy="true">             xmlValidation="false" xmlNamespaceAware="false">>>>         <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs">                prefix="access." suffix=".log" pattern="common"> resolveHosts="false"/>>>>         <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster">                 channelSendOptions="4">>>                 <Manager className="org.apache.catalina.ha.session.DeltaManager">                         expireSessionsOnShutdown="false">                         notifyListenersOnReplication="true"/>>>                 <Channel className="org.apache.catalina.tribes.group.GroupChannel">>>                         <Membership> className="org.apache.catalina.tribes.membership.McastService">                                 address="228.0.0.4">                                 port="26816">                                 frequency="500">                                 dropTime="3000"/>>>                         <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver">                                 address="192.168.6.174">                                 port="4000">                                 autoBind="100">                                 selectorTimeout="5000">                                 maxThreads="6"/>>>                         <Sender> className="org.apache.catalina.tribes.transport.ReplicationTransmitter">>                                 <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender">                                         timeout="3000"/>>                         </Sender>>>                         <Interceptor> className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>>>                         <Interceptor> className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>>>                 </Channel>>>                 <Valve className="org.apache.catalina.ha.tcp.ReplicationValve">                         filter=".*/.gif;.*/.js;.*/.jpg;.*/.png;.*/.htm;.*/.html;.*/.css;.*/.txt;"/>>>                 <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>>>                 <ClusterListener> className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/>>                 <ClusterListener> className="org.apache.catalina.ha.session.ClusterSessionListener"/>>>         </Cluster>>>       </Host>>     </Engine>>   </Service>> </Server>>> And my workers.properties..>>> # For full details abotu configuration options please visit> # http://tomcat.apache.org/connectors-doc/reference/workers.html>> # JK Status worker config>> worker.list=jkstatus> worker.jkstatus.type=status>> # Presentaton Load Balancer Config>> worker.list=preslb>> worker.preslb.type=lb> worker.preslb.balance_workers=jcpres1,jcpres2> worker.preslb.sticky_session=1>> worker.jcpres1.port=8009> worker.jcpres1.host=192.168.6.174> worker.jcpres1.type=ajp13> worker.jcpres1.lbfactor=1> worker.jcpres1.fail_on_status=404,503>> worker.jcpres2.port=8009> worker.jcpres2.host=192.168.6.171> worker.jcpres2.type=ajp13> worker.jcpres2.lbfactor=1> worker.jcpres2.fail_on_status=404,503>> # Core Load Balancer Config>> worker.list=corelb>> worker.corelb.type=lb> worker.corelb.balance_workers=worker3> worker.corelb.sticky_session=0>> worker.worker3.port=8010> worker.worker3.host=192.168.6.103> worker.worker3.type=ajp13> worker.worker3.lbfactor=1> worker.worker3.fail_on_status=404,503>

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.