码迷,mamicode.com
首页 > 数据库 > 详细

apache 2.4 配置loadbalance

时间:2019-10-29 15:26:27      阅读:282      评论:0      收藏:0      [点我收藏+]

标签:one   cpp   usr   failover   tlsv1   ajp   apache   order   pre   

apache 中添加如下配置

<VirtualHost *:9448>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
#ProxyPreserveHost off
#ProxyRequests off
#ProxyAddHeaders off
#SSLProxyEngine on
#Header unset "X-Forwarded-For"
#Header unset "X-Forwarded-Server"
#Header unset "X-Forwarded-Host"
#SSLProxyVerify none
#SSLProxyCheckPeerCN off
#SSLProxyCheckPeerName off
#SSLProxyCheckPeerExpire off
#RequestHeader unset "X-Forwarded-For"
#RequestHeader unset "X-Forwarded-Server"
#RequestHeader unset "X-Forwarded-Host"
#RequestHeader unset "Host"
#SSLEngine On
SSLCertificateKeyFile /usr/local/aig_sg_tomcat/apache/ssl/server.key
SSLCertificateFile /usr/local/aig_sg_tomcat/apache/ssl/server.crt
SSLProtocol -ALL +TLSv1.2
SSLHonorCipherOrder On
SSLCipherSuite HIGH:!aNULL:!MD5:!RC4:!EDH:!AES256
LogLevel warn
ErrorLog "|/usr/local/aig_sg_tomcat/apache/bin/rotatelogs /usr/local/aig_sg_tomcat/apache/logs/error_9448.%Y%m%d.log 86400 +480"
ProxyRequests Off
<Proxy "balancer://cluster">
BalancerMember "ajp://172.161.281.322:8009" route=tc1 loadfactor=1
BalancerMember "ajp://172.161.281.322:9009" route=tc2 loadfactor=1
ProxySet lbmethod=bytraffic stickysession=JSESSIONID|jsessionid scolonpathdelim=on nofailover=on failonstatus=500,501,502,503,504
</Proxy>

#ProxyPass "/insurance" "balancer://cluster/insurance" lbmethod=bytraffic stickysession=JSESSIONID|jsessionid nofailover=On scolonpathdelim=on timeout=5 maxattempts=3
ProxyPass "/insurance/" "balancer://cluster/insurance/"
ProxyPassReverse /insurance/ http://172.251.161.523:9448/insurance/
</VirtualHost>
#Header edit Set-Cookie ^(.*)$ $1;Secure;HttpOnly
#<filesMatch "\.(js|axd|fcc|sfcc|template|pptemplate|properties|unauth|cpp|err|bat|mxml|php|cgi|pl|htm)$">
# #ExpiresDefault 0
# Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"
# Header set Pragma "no-cache"
#</filesMatch>

tomcat server.xml

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

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

 

apache 2.4 配置loadbalance

标签:one   cpp   usr   failover   tlsv1   ajp   apache   order   pre   

原文地址:https://www.cnblogs.com/Andy-Shi/p/11758771.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!