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