| Configuration haproxyhttpDownload the basic configuration for a non redundant load balancer with http access 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 | bashtitle |  | Download the HTTP configuration template | 
|---|
 |  | curl https://cdn.jtel.de/downloads/configs/haproxy-std.cfg > /etc/haproxy/haproxy.cfg | 
 
 | 
 httpsDownload the basic configuration for a non redundant load balancer with http accessIst hingegen gewünscht, dass HTTP Zugriffe automatisch auf HTTPS umgeleitet werden und alle Zugriffe über HTTPS erfolgen sollen, so ist folgende Konfigurationsvorlage herunterzuladen: Im Falle einer Konfiguration die HTTPS Unterstützt, muss zusätzlich die Datei| 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 | 
 | 
 For a https configuration, the file angelegt werden, in der sich sowohl das Zertifikat, eventuelle Zwischenzertifikate und der Private Schlüssel befindet. Diese Datei muss außerdem eine spezielle Berechtigung erhalten, damit nur der Benutzer root darauf lesen zugreifen kann, ansonsten wird der haproxy Dienst nicht starten./etc/haproxy/haproxy.pem  must also be created, which contains the certificates and keys for https. This file must also be given special access privileges otherwise haproxy may not start. See the sections on certificates for the role LB for further detailsFür selbstgenerierte Zertifikate siehe Rolle LB - Selbst signiertes Zertifikat . | Translations Ignore | 
|---|
 | 
 | Code Block | 
|---|
 | | language | bash | title | Save the certificate file | 
|---|
 |  | chmod 400 /etc/haproxy/haproxy.pem | 
 
 | 
 
 
 
 |