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 inbound-loadbalancer for the Web server inside LAN. 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.PrerequisitesAn 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 the Apache servers (rsync, Cororsync or other to keep Web server files updated)2.Configure PfsensePfsense 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.1MonitorWe're officially starting. First click Services, Load balancers, and then select the Monitor tab. 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 types to HTTP, Host address set an unused IP (we will establish a virtual IP on this IP, this virtual IP will be assigned to the failover failover node, note: There is also the article said to set it to Wan IP), HTTP code to save the default Then click Save and make the change effective with apply changes.2.2PoolNext, set up the server pool. Click the + button on the Pools tab to add a pool. I specify Apachesrvpool as the service pool name, set mode to load Balance, port 80 (. 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.3Virtual ServerIn the final step, select the Virtual Servers tab and click + to add a record. Fill in the name Apacheclustervirtualserver, description and IP address, this IP address is the same as the unused IP in the 1th step, port 80, all the connections sent to this wanip: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. Get! Finally, do not forget to add firewall rules for the virtual server IP and pool. Free pick up brother even it education original Linux OPS engineer video/Detailed Linux tutorials, details Inquiry official website customer service: http://www.lampbrother.net/linux/learn PHP, Linux, HTML5, UI, Android and other video tutorials (Courseware + notes + video)! Contact Q2430675018
  • 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.