Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Content imported from a Scroll Translations translation file.
Sv translation
languageen

Install haproxy

Install Software

The installation of haproxy is performed using the following commands:

Translations Ignore


Code Block
languagebash
dnf -y install haproxy
mv /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.sample


The second command renames the installed configuration, as this is not required. 

Acticate haproxy

Activate the haproxy service with the following command:

Translations Ignore


Code Block
languagebash
systemctl enable haproxy.service


Configure Firewall

Configure the firewall with the following commands:

Translations Ignore


Code Block
languagebash
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=443/tcp --permanent
firewall-cmd --zone=public --add-port=7777/tcp --permanent
firewall-cmd --reload


SeLinux Configuration

Enable haproxy to open any port with the following selinux command:

Translations Ignore


Code Block
languagebash
setsebool -P haproxy_connect_any=1
semanage permissive -a haproxy_t


haproxy Log

To allow the haproxy service to log to the syslog service, the following commands are executed. 

The logs from haproxy will be in /var/log/messageshaproxy.log

Translations Ignore


Code Block
languagebash
sed -i -e 's/#$ModLoad *imudp/$ModLoad imudp/' -e 's/#$UDPServerRun *514/$UDPServerRun 514/'/module(load="imudp")/s/^#//g' /etc/rsyslog.conf
sed -i '/input(type="imudp"/s/^#//g' /etc/rsyslog.conf
cat <<EOFF>/etc/rsyslog.d/haproxy.conf
local2.* /var/log/haproxy.log
& stop
EOFF
servicesystemctl restart rsyslog restart




Sv translation
languagede

Status
colourRed
title

THIS PAGE IS ONLY AVAILABLE IN ENGLISH

This page is only available in English

Sv translation
languagefr

Installer l'haproxy

Installer le logiciel

L'installation de haproxy est effectuée à l'aide des commandes suivantes :

Translations Ignore


Code Block
languagebash
dnf -y install haproxy mv /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.sample


La deuxième commande permet de renommer la configuration installée, car cela n'est pas nécessaire. 

Activer haproxy

Activez le service haproxy avec la commande suivante :

Translations Ignore


Code Block
languagebash
systemctl enable haproxy.service


Configurer le pare-feu

Configurez le pare-feu à l'aide des commandes suivantes :

Translations Ignore


Code Block
languagebash
firewall-cmd --zone=public --add-port=80/tcp --permanent firewall-cmd --zone=public --add-port=443/tcp --permanent firewall-cmd --zone=public --add-port=7777/tcp --permanent firewall-cmd --reload


Configuration SeLinux

Activez l'haproxy pour ouvrir n'importe quel port avec la commande selinux suivante :

Translations Ignore


Code Block
languagebash
setsebool -P haproxy_connect_any=1 semanage permissive -a haproxy_t


journal d'haproxy

Pour permettre au service haproxy de se connecter au service syslog, les commandes suivantes sont exécutées. 

Les journaux de l'haproxie seront dans /var/log/haproxy.log

Translations Ignore


Code Block
languagebash
sed -i '/module(load="imudp")/s/^#//g' /etc/rsyslog.conf sed -i '/input(type="imudp"/s/^#//g' /etc/rsyslog.conf cat <<EOFF>/etc/rsyslog.d/haproxy.conf local2.* /var/log/haproxy.log & stop EOFF systemctl restart rsyslog