You need at least three servers:
Server A: Control server
Server B and Server C: actual server execution
Load balancing principle: Distribute requests for access server A to Server B and Server C
Modify the http.conf file for Apache on Server A:
First, load the appropriate proxy module, removing the # number 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
Next, add at the end of the file:
proxypass/example/balancer://proxy/
Balancermember http://serverB/example/
Balancermember http://serverC/example/
Represents the distribution of all files under the http://serverA/example/subdirectory of Access server A to servers B and C, equivalent to accessing http://serverB/example/or http://serverC/example/ The files in the sub-directory.
If written as:
proxypass/balancer://proxy/
Balancermember http://serverB/
Balancermember http://serverC/
All requests to access A are converted to access B or C accordingly.
Finally, restart Server A's Apache
http://www.bkjia.com/PHPjc/327998.html www.bkjia.com true http://www.bkjia.com/PHPjc/327998.html techarticle requires at least three servers: Server A: Control server server B and Server C: actually perform server load Balancing principle: Distribute the request for Server A to Server B and services ...