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
languagefr

Installer l'haproxy

Installer le logiciel

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

Translations Ignore


Code Block
languagebash
apt-get -y install haproxy 


Code Block
languagebash
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
ufw allow 80/tcp ufw allow 443/tcp ufw allow 7777/tcp


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

Translations Ignore


Code Block
languagebash
ufw allow in on eth1 to any port 80 proto tcp ufw allow in on eth1 to any port 443 proto tcp ufw allow in on eth1 to any port 7777 proto tcp


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