In order for us to be able to install it, we need to either compile it from source (preferred) or add the EPEL repository to our server and install it using Yum. Make TARGET=linux-glibc USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_CRYPT_H=1 USE_LIBCRYPT=1 USE_SYSTEMD=1Ĭreate a systemd service /usr/lib/systemd/system/rvice cat > /usr/lib/systemd/system/rvice /etc/haproxy/haproxy. HAProxy isn’t available in the default repositories for CentOS. Yum install gcc-c++ openssl-devel pcre-static pcre-devel systemd-devel -y Install Epel: Run the following commands. Step 1 Introducing Necessary Apache Modules The modules that are needed to use Apache as a reverse proxy include modproxy itself and several of its add-on modules, which extend its functionality to support different network protocols. We recommend installing through the Epel repository to keep the packages updated. CentOS comes with the vi text editor by default, but nano can be more user friendly. The 1st step defines the branch you are going to install, If you want latest of 2.0 just modify the URL to the branch you want, you'll have to repeat that change in every step you see an URL: LATEST_HAPROXY=$(wget -qO- | egrep -o "haproxy-2\.+\.+" | head -1)ĭownload and install the package: cd /usr/src/ HAProxy is a service that can help with load balancing of web servers, or just proxying traffic.
I was able to install the latest version HAProxy 2.4.2 (LTS) on CentOS 7 by executing the steps from this blog, Here they are in case the link goes down, I've modified them a bit because the blog talks about 2.0 version while I needed the latest: Steps Choose the haproxy branch How to setup HAProxy as Load Balancer for Nginx on CentOS 7 Step 1 - Configure the /etc/hosts files Step 2 - Install and Configure HAProxy Step 3 - Install.