Apache implementation of Web server load balancing detailed (regardless of session version)

Source: Internet
Author: User
This article is the use of Apache implementation of Web server load Balancing method for a detailed analysis of the introduction, the need for friends under the reference (regardless of the session version)

Requires at least three servers:
Server A: Control server
Server B and Server C: actually executing the server
Load balancing principle: Distributing requests to Server A to Server B and Server C
To modify the Apache http.conf file on Server A:

First, load the appropriate agent module, remove the # # # in front of 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

Second, add at the end of the file:
proxypass/example/balancer://proxy/
<proxy balancer://proxy>
Balancermember http://serverB/example/
Balancermember http://serverC/example/
</Proxy>

Indicates that all files under the http://serverA/example/subdirectory of Access server A are distributed to Server B and C execution, equivalent to accessing http://serverB/example/or http://serverC/example/ A file under a subdirectory.

if written as:
proxypass/balancer://proxy/
<proxy balancer://proxy>
Balancermember http ://serverb/
Balancermember http://serverC/
</proxy>
Then all requests to access a are appropriately converted to access B or C
Finally, Reboot Server A's Apache

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.