How To Install haproxy on AlmaLinux 8

In this tutorial we learn how to install haproxy in AlmaLinux 8. haproxy is HAProxy reverse proxy for high availability environments

Introduction

In this tutorial we learn how to install haproxy on AlmaLinux 8.

What is haproxy

HAProxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments. Indeed, it can - route HTTP requests depending on statically assigned cookies - spread load among several servers while assuring server persistence through the use of HTTP cookies - switch to backup servers in the event a main one fails - accept connections to special ports dedicated to service monitoring - stop accepting connections without breaking existing ones - add, modify, and delete HTTP headers in both directions - block requests matching particular patterns - report detailed status to authenticated users from a URI intercepted from the application

We can use yum or dnf to install haproxy on AlmaLinux 8. In this tutorial we discuss both methods but you only need to choose one of method to install haproxy.

Install haproxy on AlmaLinux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

After updating yum database, We can install haproxy using dnf by running the following command:

sudo dnf -y install haproxy

Install haproxy on AlmaLinux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install haproxy using yum by running the following command:

sudo yum -y install haproxy

How To Uninstall haproxy on AlmaLinux 8

To uninstall only the haproxy package we can use the following command:

sudo dnf remove haproxy

References

Summary

In this tutorial we learn how to install haproxy on AlmaLinux 8 using yum and dnf.