How to load balance your Web services with Pfsense

Source: Internet
Author: User
Tags failover learn php pfsense

Note that there are two kinds of load balancing in Pfsense: One is to set up multiple WAN to do two-line load balancing, and the other is to do the Web server in LAN Inbound-loadbalancer.

This article shows how to use pfsense 2.0 to Configure load Balancing for your multiple Web servers (Load Balancer). This assumes that you already have a pfsense server and more than 2 Apache servers in your network environment , and have a certain knowledge of pfsense .

1. Prerequisites

an installed pfsense 2.0 Machine (if it is your perimeter firewall, it is recommended to install on a physical machine)

at least 2 Apache servers (which can be virtual machines)

ensure that the code files are synchronized between Apache servers (rsync, Cororsync, or others can keep the files updated between Web servers)

2. Configure Pfsense

Pfsense can use load balancing to allow specific request pressures to be shared by multiple servers, which is useful for servers with multiple applications because you can spread the load pressure across other nodes rather than a single node.

2.1 Monitor

we officially started. First click Services, Load balancers Monitor tags.

Click the + PLUS sign on the right to add a record, enter the monitor name name and description Description(in this example name and description I use Apacheclustermon), set the type to HTTP, the host address, set to an IP that is not yet in use ( the IP on the build virtual IP, this virtual IP will be assigned to the failover failover node, note: Also the article said to set it to WAN IP),HTTP Code to Save the default then click Save to save and make the changes effective Apply changes.

2.2 Pool

Next, set up the server pool . Click the + button on the Pools tab to add a pool.

I specify Apachesrvpool is the service pool name, set Mode to Load Balance, Port (. This port when your backend server listening port, you can certainly set other applications of other ports, not necessarily the Web. Set the Apacheclustermon created in the previous step for this pool , then add all of your Web server IPs to the pool , save and apply.

2.3 Virtual Server

The last step, select Virtual Servers tab, click + to add a record. Fill in the name Apacheclustervirtualserver, description and IP address, this IP address is the same as the unused IP mentioned in step 1 , the port All connections sent to this WAN Ip:port will be forwarded to the server pool. Virtual Server pool VM Poll Select the one you created in the previous step. Submit and apply.

It's done! Finally, do not forget to add firewall rules for the virtual server IP and pool.

free pick up brother Lian it education original Linux OPS engineer video / detail linux tutorial, For more information, please contact: http://www.lampbrother.net/linux /

learn PHP, Linux, HTML5, UI, Android and other video tutorials (Courseware + notes + video)! Contact Q2430675018


How to load balance your Web services with Pfsense

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.