...
| Sv translation |
|---|
|
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 herunterzuladen: | 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 |
|
|
| Sv translation |
|---|
|
Configuration haproxy
La structure du fichier de configuration du service haproxy est assez complexe. Pour cette raison, il est recommandé d'utiliser un modèle approprié du répertoire central de téléchargement de jtel pour accélérer le travail de configuration. Il existe deux modèles, qui diffèrent selon que les services sont offerts via HTTP ou via HTTPS. Si la fourniture via HTTPS est souhaitée, un fichier avec un certificat valide et la clé privée correspondante au format PEM-base64-- doit être fourni en plus du fichier de configuration.
Le téléchargement du modèle de configuration suivant est un bon point de départ pour un système qui devrait être accessible via HTTP :
| Translations Ignore |
|---|
| Code Block |
|---|
| language | bash |
|---|
| title | Télécharger le modèle de configuration HTTP |
|---|
|
curl https://cdn.jtel.de/downloads/configs/haproxy-std.cfg > /etc/haproxy/haproxy.cfg |
Si, en revanche, on souhaite que les accès HTTP soient automatiquement redirigés vers HTTPS et que tous les accès se fassent via HTTPS, le modèle de configuration suivant doit être téléchargé :
| Translations Ignore |
|---|
| Code Block |
|---|
| language | bash |
|---|
| title | Télécharger le modèle de configuration HTTPS |
|---|
|
curl https://cdn.jtel.de/downloads/configs/haproxy-ssl.cfg > /etc/haproxy/haproxy.cfg |
Si la configuration supporte le HTTPS, le fichier /etc/haproxy/haproxy.pem doit également être créé, qui contient le certificat, les éventuels certificats secondaires et la clé privée. Ce fichier doit également être doté de permissions spéciales afin que seul l'utilisateur root ait un accès en lecture, sinon le service haproxy ne démarrera pas.
Pour les certificats autogénérés, voir SSL/TLS Certificates - Self-signed certificate.
| Translations Ignore |
|---|
| Code Block |
|---|
| language | bash |
|---|
| title | Enregistrer le fichier de certificat |
|---|
|
chmod 400 /etc/haproxy/haproxy.pem |
|