個人技能總結7--Apache伺服器反向 Proxy,負載平衡,熱備份+Tomcat配置

來源:互聯網
上載者:User

標籤:ssr   --   images   總結   服務   res   host   roo   注釋   

負載平衡:

第一步:首先下載安裝apache,我選擇的是Apache2.2.19.

第二步:修改apache安裝目錄下的conf/httpd.conf,開啟如下配置(預設注釋掉了)

   開啟vhost配置的自設定檔:

 

第三步:注釋掉Vhost設定檔裡面原來的,增加<VirtualHost *:80>

    ServerAdmin [email protected]-host2.example.com    DocumentRoot "D:/apache2.2/httpd-2.2-x64/htdocs"    ServerName dummy-host2.example.com    ErrorLog "logs/dummy-host2.example.com-error.log"    CustomLog "logs/dummy-host2.example.com-access.log" common    ProxyRequests Off    ProxyPreserveHost on    ProxyPass / balancer://tomcat-Hello222/    ProxyPassReverse / balancer://tomcat-Hello222/    <Proxy balancer://tomcat-Hello222/>
    
    # 熱備份 #BalancerMember http://192.168.0.101:8080 #BalancerMember http://192.168.0.110:8080 status=+H
    # loadfactor=1 route=tomcat8_local  smax=5 max=20 ttl=120 retry=300 timeout=15 這個為配置的參數,最大連結,逾時,等等 BalancerMember http://192.168.0.101:8080 loadfactor=1 route=tomcat8_local  smax=5 max=20 ttl=120 retry=300 timeout=15 BalancerMember http://192.168.0.100:8080 loadfactor=1 route=tomcat8_local  smax=5 max=20 ttl=120 retry=300 timeout=15 ProxySet lbmethod=bybusyness </Proxy></VirtualHost>

 

熱備份:

  如去掉給BalancerMember配置的參數等,給備份伺服器加上status=+H

 

注意:以上代碼為本人實現,如需照抄請修改 ProxyPass處的Hello222為你自己的工程名。

個人技能總結7--Apache伺服器反向 Proxy,負載平衡,熱備份+Tomcat配置

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.