HAProxy & Webserver

Abhishek Arora
Jan 28, 2021

This Post is all about HAProxy and Webserver configuration using Ansible.

So, What is HAProxy?

HAProxy is free, open source software that provides a high availability load balancer and proxy server for TCP and HTTP-based applications that spreads requests across multiple servers.

  • Description

In this task we need to install HAProxy on one system and then we need to use this as LoadBalancer for Webserver running in other systems/server.

This all is automated using ansible

Ansible YAML file for HAProxy

Installing HAProxy
Copying modified config file
finally starting HAProxy

The main focus in this is about modifying the config file in which we need to provide the port number for LB and also for backend servers.

for backend app(webservers)
for frontend app(LB)

Installing httpd in webservers(backend)

Copying content for website

finally starting service (httpd)

A video of complete demonstration is below

--

--