Konfiguration Configuration 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. The structure of the configuration file of the haproxy service is quite complex. For this reason it is recommended to use an appropriate template from the central jtel download directory to speed up the configuration work. There are two templates, which differ in whether the services are offered via HTTP or via HTTPS. If provision via HTTPS is desired, a file with a valid certificate and the corresponding private key in PEM-base64-- format must be provided in addition to the configuration file. Downloading the following configuration template is a good starting point for a system that should be accessible via HTTPDas 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 herunterzuladenIf, on the other hand, it is desired that HTTP accesses are automatically redirected to HTTPS and all accesses are to take place via HTTPS, the following configuration template must be downloaded: 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 |
|
Im Falle einer Konfiguration die HTTPS Unterstützt, muss zusätzlich die Datei If the configuration supports HTTPS, the file /etc/haproxy/haproxy.pem 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. must also be created, which contains the certificate, any secondary certificates and the private key. This file must also be given special permissions so that only the root user has read access, otherwise the haproxy service will not start. For self-generated certificates see SSL/TLS Certificates - Self-signed certificateFü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 |
|
|