Detailed explanation of Apache Implementation of Web Server load balancing (not considering Session version)

Source: Internet
Author: User

At least three servers are required:
Server A: Control Server
Server B and server C: actual execution Server
Server Load balancer principle: distribute requests from server A to server B and server C
Modify the http. conf file of apache on server:

First, load the corresponding proxy module and remove the # sign before the following module:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so

Next, add the following content at the end of the file:
ProxyPass/example/balancer: // proxy/
<Proxy balancer: // proxy>
BalancerMember http: // serverB/example/
BalancerMember http: // serverC/example/
</Proxy>

Distribute all files in the http: // serverA/example/subdirectory of server A to server B and server C for execution, which is equivalent to accessing http: // serverB/example/or http: // files in the serverC/example/subdirectory.

If written:
ProxyPass/balancer: // proxy/
<Proxy balancer: // proxy>
BalancerMember http: // serverB/
BalancerMember http: // serverC/
</Proxy>
It indicates that all requests to access A are converted to access B or C
Finally, restart apache of server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.