Configuration haproxyhttpTéléchargez la configuration de base pour un équilibreur de charge non redondant avec accès http Konfiguration haproxyDer Aufbau der Konfigurationsdatei des haproxy Dienstes ist recht komplex. Aus diesem Grunde empfiehlt es sich eine entsprechende Vorlage aus dem zentralen jtel Download-Verzeichnis anzuwenden, um die Konfigurationsarbeiten zu beschleunigen. Dort befinden sich zwei Vorlagen, die sich darin unterscheiden, ob die Dienste über HTTP oder über HTTPS angeboten werden. Ist die Bereitstellung über HTTPS gewünscht, muss zusätzlich zu der Konfigurationsdatei auch eine Datei mit einem gültigen Zertifikat und dem dazugehörigen Private Key im PEM-base64--Format zur Verfügung gestellt werden. Das Herunterladen der folgenden Konfigurationsvorlage ist ein guter Startpunkt für ein System welches über HTTP erreichbar sein soll : Translations Ignore |
---|
Code Block |
---|
language | bash | title | Download the HTTP configuration template |
---|
| curl https://cdn.jtel.de/downloads/configs/haproxy-std.cfg > /etc/haproxy/haproxy.cfg |
| Ist hingegen gewünscht, dass HTTP Zugriffe automatisch auf HTTPS umgeleitet werden und alle Zugriffe über HTTPS erfolgen sollen, so ist folgende Konfigurationsvorlage herunterzuladenhttpsTéléchargez la configuration de base pour un équilibreur de charge non redondant avec accès http : Translations Ignore |
---|
Code Block |
---|
language | bash | title | Download the HTTPS configuration template |
---|
| curl https://cdn.jtel.de/downloads/configs/haproxy-ssl.cfg > /etc/haproxy/haproxy.cfg |
|
Pour une configuration https, le fichier /etc/haproxy/haproxy.pem doit également être créé, qui contient les certificats et les clés pour https. Ce fichier doit également être doté de privilèges d'accès spéciaux, sinon l'haproxy ne pourra pas démarrer. Voir les sections sur les certificats pour le rôle LB pour plus de détails. Translations Ignore |
---|
Code Block |
---|
| chmod 400 /etc/haproxy/haproxy.pem |
|
|