Apache implements Web server load Balancing in detail (regardless of Session edition) _php tutorial

Source: Internet
Author: User
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 ...

  • Related Article

    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.