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

测试检查
Apache+Tomcat共享session proxy模块
session不会变化,说明已经共享了session

上一篇:【12c】OCP 062近期新出现的考试原题-第28题


下一篇:音频数字水印的算法实现(3)