zoukankan      html  css  js  c++  java
  • apache 2.4 配置loadbalance

    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">

  • 相关阅读:
    从boosting谈起
    《人月神话》读书摘记
    Python中input()的使用方法
    Web前端攻击方式及防御措施
    吞吐量(TPS)、QPS、并发数、响应时间(RT)概念
    Mybatis的Mapper文件sql语句中使用常量值或者枚举常量值
    Java依据文件头获取文件类型
    MySQL查询优化
    RabbitMQ学习教程
    SpringBoot2.x.x + Shiro + Redis 前后端分离实现
  • 原文地址:https://www.cnblogs.com/Andy-Shi/p/11758771.html
Copyright © 2011-2022 走看看