apache mod proxy 负载均衡

LoadModule proxy_module libexec/apache22/mod_proxy.so
LoadModule proxy_http_module libexec/apache22/mod_proxy_http.so
LoadModule proxy_http_ libexec/apache22/mod_proxy_ajp.so
LoadModule proxy_http_module libexec/apache22/mod_proxy_balancer.so
LoadModule status_module libexec/apache22/mod_status.so

<Proxy *>
       Order deny,allow
       allow from all
</Proxy>

ProxyPass / balancer://proxy/   stickysession=JSESSIONID nofailover=On lbmethod=byrequests
ProxyPassReverse / balancer://proxy/
<Proxy balancer://proxy>
        BalancerMember ajp://218.193.237.23:8109/  loadfactor=50  route=worker1  #jvmRoute
        BalancerMember ajp://218.193.237.23:8209/  loadfactor=50  route=worker2
</Proxy>



千万别忘了jvmRoute 否则保存不了session,网站一直进入,登录

你可能感兴趣的:(apache)