January 5, 2021 / Nirav Shah
HAProxy is a free, extremely quick and well-known toon offering high accessibility, load adjusting, and proxying for TCP and HTTP-based applications. It is especially appropriate for extremely high traffic sites and powers a lot of the world’s most visited ones. Through its consistent and overwhelming service, it has become the true standard open-source load balancer, is presently delivered with most standard Linux distributions.
Installation steps for centos8 server
Step 1
Update packages
$sudo yum update
Step 2
Install HAProxy
$sudo yum install haproxy

Step 3
An HAProxy essential setup advises the heap adjusting framework on what sort of associations it ought to tune in for and which workers it should hand-off the associations with.
Now we are going to create configuration file /etc/haproxy/haproxy.cfg
sudo nano /etc/haproxy/haproxy.cfg
And add the following text,
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
frontend http_front
bind *:80
stats uri /haproxy?stats
default_backend http_back
backend http_back
balance roundrobin
server my_server private_IP:80 check
server my_server private_IP:80 check
And save it using:wq!
Restart HAproxy using the command below
$sudo systemctl restart haproxy $sudo systemctl enable haproxy
To learn more visit to the official HAProxy site: http://www.haproxy.org

As a Director of Eternal Web Private Ltd an AWS consulting partner company, Nirav is responsible for its operations. AWS, cloud-computing and digital transformation are some of his favorite topics to talk about. His key focus is to help enterprises adopt technology, to solve their business problem with the right cloud solutions.
Have queries about your project idea or concept? Please drop in your project details to discuss with our AWS Global Cloud Infrastructure service specialists and consultants.