其他分享
首页 > 其他分享> > Apache+Tomcat共享session proxy模块

Apache+Tomcat共享session proxy模块

作者:互联网

vim /application/apache/conf/extra/httpd-proxy.conf

ProxyRequests Off
<proxy balancer://lbcluster1>
  BalancerMember ajp://10.125.192.2:8009 loadfactor=1
  BalancerMember ajp://10.125.192.3:8009 loadfactor=1
  ProxySet lbmethod=bytraffic
</proxy>


<VirtualHost *:80>
  ServerName localhost
  ProxyVia On
  ProxyPass / balancer://lbcluster1/  stickysession=JSESSIONID|jsessionid nofailover=On
  ProxyPassReverse / balancer://lbcluster1/
  <Location /balancer-manager>
    SetHandler balancer-manager
    Proxypass !
    Require all granted
  </Location>
  <Proxy *>
    Require all granted
  </Proxy>
  <Location  / >
    Require all granted
  </Location>
</VirtualHost>

检查语法
/application/apache/bin/apachectl -t
/application/apache/bin/apachectl graceful

测试检查
在这里插入图片描述
session不会变化,说明已经共享了session

标签:Tomcat,Require,balancer,application,session,proxy,apache,granted
来源: https://blog.csdn.net/bjgaocp/article/details/88319920