[问题已解决]stickysession=JSESSIONID 无效.. 这可怎么办啊.

这是 apache部分的配置

 

<Proxy balancer://proxy>
       BalancerMember ajp://127.0.0.1:8009/  loadfactor=1 route=tomcat1
       BalancerMember ajp://127.0.0.1:8010/  loadfactor=1 route=tomcat2
</Proxy>

 <VirtualHost   *:80>
 ServerName www.a.com
 ServerAlias   www.a.com
 ProxyPass / balancer://proxy/ stickysession=JSESSIONID nofailover=On lbmethod=bytraffic
        ProxyPassReverse / balancer://proxy/

  </VirtualHost> 

 

Server.xml分别是

 

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

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

 

我在两个的ROOT文件夹下都放一个 test.jsp 分别输出不同的标识.

但刷新的时候,就会发现apache把请求分别发给 tomcat1 tomcat2. stickysession失败了. .这是为什么呢??? 哪位帮忙看看...

 

===========================================

以下为正确配置

 

 <VirtualHost   *:80>
 
 ServerName www.a.com
 ServerAlias   www.a.com
 ProxyPass / balancer://proxy/ stickysession=JSESSIONID
 ProxyPassReverse / balancer://proxy/

 <Proxy balancer://proxy>
        BalancerMember http://192.168.1.192:8080/  loadfactor=1 route=tomcat1
        BalancerMember http://192.168.1.192:8081/  loadfactor=2 route=tomcat2
 </Proxy>

 </VirtualHost> 

你可能感兴趣的:(apache,jsp,xml)