Home
Softono
HAProxy-3-RPM-builder

HAProxy-3-RPM-builder

Open source MIT Makefile
16
Stars
3
Forks
0
Issues
1
Watchers
1 week
Last Commit

About HAProxy-3-RPM-builder

Build latest HAProxy 3 binary for CentOS 8/9 with prometheus metrics support

Platforms

Web Self-hosted Docker

Languages

Makefile

Links

RPM builder for HAProxy (EL8/EL9/EL10/Amazon Linux 2023)

Build latest HAProxy binary with prometheus metrics support

HAProxy version GitHub last commit GitHub All Releases

๐Ÿš€ Quick Start

Perform the following steps on a build box as a regular user:

sudo dnf -y groupinstall 'Development Tools'
cd /opt
sudo git clone https://github.com/philyuchkoff/HAProxy-3-RPM-builder.git
cd ./HAProxy-3-RPM-builder

๐Ÿ› ๏ธ Build options:

Basic:

sudo make

With Lua:

sudo make USE_LUA=1

With Prometheus metrics:

sudo make USE_PROMETHEUS=1

Without sudo for YUM:

sudo make NO_SUDO=1

Resulting RPM will be stored in

/opt/HAProxy-3-RPM-builder/rpmbuild/RPMS/x86_64/

Using Docker:

sudo make run-docker

Resulting RPM will be stored in

./RPMS/

โœ… Install:

sudo dnf -y install /opt/HAProxy-3-RPM-builder/rpmbuild/RPMS/x86_64/haproxy-3.4.0-1.el9.x86_64.rpm

or, if you build *.rpm with Docker:

sudo dnf -y install RPMS/haproxy-3.4.0-1.el9.x86_64.rpm 

Check after install:

haproxy -v

๐Ÿ“Š Stats page

After installation you can access a stats page without authenticating via the URL: http://<YourHAProxyServer>:9000/haproxy_stats

๐Ÿ†˜ Common problem:

:o: If some not working - check SELINUX:

sestatus

If SELINUX is enabled - switch off this: open /etc/selinux/config and change SELINUX to disabled:

sudo sed -i s/^SELINUX=.*$/SELINUX=disabled/ /etc/selinux/config

:o: Work with non-standard ports (SELinux)

sudo dnf -yd install policycoreutils-python-utils
sudo semanage port -a -t http_port_t -p tcp 9999

:o: Cannot chroot1

[/usr/sbin/haproxy.main()] Cannot chroot1(/var/lib/haproxy)  
Solution:
  • Create /var/lib/haproxy directory
  • Check on the rpcbind service to ensure that this service is started

:o: Failed to download metadata for repo 'AppStream' (CentOS8/9)

Solution:
cd /etc/yum.repos.d/
sudo sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sudo sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

Supported platforms:

  • Enterprise Linux 8 (RHEL 8, CentOS 8, Rocky Linux 8, AlmaLinux 8)
  • Enterprise Linux 9 (RHEL 9, CentOS 9, Rocky Linux 9, AlmaLinux 9)
  • Enterprise Linux 10 (RHEL 10, CentOS 10, Rocky Linux 10, AlmaLinux 10)
  • Amazon Linux 2023

โš ๏ธ Breaking changes

Stats socket path changed

The default stats socket path in haproxy.cfg was changed from /run/haproxy/haproxy.sock to /run/haproxy.sock (removed the /run/haproxy/ subdirectory so no extra directory creation is needed).

Migration: If you have monitoring scripts, socat commands, or external tools referencing the old path, update them to the new path:

- /run/haproxy/haproxy.sock
+ /run/haproxy.sock

Or override the path in your own haproxy.cfg to keep the previous value.