tachtler:haproxy_archlinux
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende ÜberarbeitungLetzte ÜberarbeitungBeide Seiten der Revision | ||
tachtler:haproxy_archlinux [2023/01/21 17:16] – [Maintenance-Konfiguration: Test] klaus | tachtler:haproxy_archlinux [2023/12/28 15:14] – [Maintenance-Konfiguration: /etc/haproxy/maintenance.htm] klaus | ||
---|---|---|---|
Zeile 21: | Zeile 21: | ||
< | < | ||
- | ┌──────────┐ | + | |
- | https only │ Server | + | |
- | ┌────────────► | + | ┌───────────► |
- | │ └──────────┘ | + | │ |
- | ┌───────────────────────────────────┐ | + | ┌───────────────────────────────────┐ |
- | │ Browser *¹ │ | + | │ Browser *¹ │ http→https |
- | │ http:// | + | │ http:// |
- | │ http:// | + | │ http:// |
- | └───────────────────────────────────┘ | + | └───────────────────────────────────┘ |
- | │ │ Server | + | │ |
- | └────────────► | + | └───────────► |
- | https only └──────────┘ | + | |
</ | </ | ||
Zeile 497: | Zeile 497: | ||
group admin users admin | group admin users admin | ||
user admin insecure-password geheim | user admin insecure-password geheim | ||
+ | |||
+ | http-errors haerrors | ||
+ | errorfile 503 / | ||
frontend http-in | frontend http-in | ||
Zeile 511: | Zeile 514: | ||
use_backend repository.tachtler.net if { hdr(host) -i repository.tachtler.net } | use_backend repository.tachtler.net if { hdr(host) -i repository.tachtler.net } | ||
use_backend stats if { hdr(host) -i lbproxy.tachtler.net } | use_backend stats if { hdr(host) -i lbproxy.tachtler.net } | ||
- | | + | |
backend stats | backend stats | ||
Zeile 1325: | Zeile 1328: | ||
Als abschliessenden Konfigurationsschritt muss noch Sorge dafür getragen werden, das der **mount** der zuvor erstellen '' | Als abschliessenden Konfigurationsschritt muss noch Sorge dafür getragen werden, das der **mount** der zuvor erstellen '' | ||
+ | < | ||
+ | # systemctl edit haproxy.service | ||
+ | </ | ||
< | < | ||
### Editing / | ### Editing / | ||
Zeile 1432: | Zeile 1438: | ||
srw-rw-rw- 1 root root 0 Jan 2 16:32 log | srw-rw-rw- 1 root root 0 Jan 2 16:32 log | ||
</ | </ | ||
+ | |||
+ | ===== Maintenance-Konfiguration: | ||
+ | |||
+ | Nachfolgende Konfigurationsschritte sollen eine Maintenance-Konfiguration (Wartungsseite) des [[https:// | ||
+ | |||
+ | Durch die Maintenance-Konfiguration (Wartungsseite) wird eine individuelle Wartungsseite zur Anzeige gebracht, für den Fall, dass kein **'' | ||
+ | |||
+ | Bevor mit der Konfiguration des [[https:// | ||
+ | < | ||
+ | # cp -a / | ||
+ | </ | ||
+ | |||
+ | Anschliessend kann die Konfigurationsdatei des [[https:// | ||
+ | **__Nur relevanter Ausschnitt__**: | ||
+ | <code bash> | ||
+ | http-errors haerrors | ||
+ | errorfile 503 / | ||
+ | </ | ||
+ | |||
+ | :!: **HINWEIS** - Die vorhergehenden Konfigurationszeilen können als **__neue__** Sektion: '' | ||
+ | |||
+ | In der Sektion: **'' | ||
+ | <code bash> | ||
+ | errorfiles haerrors | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | * <code bash> | ||
+ | |||
+ | Erstellt eine neue http-Fehlergruppe mit dem Namen < | ||
+ | |||
+ | * <code bash> | ||
+ | |||
+ | Zuordnung eines Dateiinhalts zu einem HTTP-Fehlercode. | ||
+ | |||
+ | * <code bash> | ||
+ | |||
+ | Vwewendet ganz oder teilweise die Fehlerdateien, | ||
+ | |||
+ | ==== Maintenance-Konfiguration: | ||
+ | |||
+ | Nachfolgende Konfigurationsdatei soll **neu** erstellt werden und - hier - einen Einfachen Inhalt für eine Maintenance-Seite (Wartungsseite) im HTML-Format enthalten: | ||
+ | < | ||
+ | # vim / | ||
+ | </ | ||
+ | |||
+ | Der Inhalt könnte wie folgt aussehen: | ||
+ | <code html> | ||
+ | HTTP/1.0 503 Service Unavailable | ||
+ | Cache-Control: | ||
+ | Connection: close | ||
+ | Content-Type: | ||
+ | |||
+ | < | ||
+ | <html lang=" | ||
+ | < | ||
+ | <meta charset=" | ||
+ | <meta http-equiv=" | ||
+ | <meta name=" | ||
+ | <title data-i18n-key=" | ||
+ | < | ||
+ | html, body { padding: 0; margin: 0; width: 100%; height: 100%; } | ||
+ | * {box-sizing: | ||
+ | body { text-align: center; padding: 0; background: #d6433b; color: #fff; font-family: | ||
+ | h1 { font-size: 24px; font-weight: | ||
+ | body { font-family: | ||
+ | article { display: block; width: 700px; padding: 50px; margin: 0 auto; } | ||
+ | b { color: #fff; font-weight: | ||
+ | svg { width: 75px; margin-top: 1em; } | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | <div class=" | ||
+ | <svg xmlns=" | ||
+ | <h1 data-i18n-key=" | ||
+ | <p data-i18n-key=" | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | // The locale our app first shows | ||
+ | const defaultLocale = " | ||
+ | const supportedLocales = [" | ||
+ | // Check if locale ist supported | ||
+ | function isSupported(locale) { | ||
+ | return supportedLocales.indexOf(locale) > -1; | ||
+ | } | ||
+ | // Retrieve the first locale we support from the given | ||
+ | // array, or return our default locale | ||
+ | function supportedOrDefault(locales) { | ||
+ | return locales.find(isSupported) || defaultLocale; | ||
+ | } | ||
+ | // Detect browser locale | ||
+ | function browserLocales(languageCodeOnly = false) { | ||
+ | return navigator.languages.map((locale) => | ||
+ | languageCodeOnly ? locale.split(" | ||
+ | ); | ||
+ | } | ||
+ | // Translations | ||
+ | const translations = { | ||
+ | // German translations | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | // English translations | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | }; | ||
+ | // When the page content is ready | ||
+ | document.addEventListener(" | ||
+ | document | ||
+ | // Find all elements that have the key attribute | ||
+ | .querySelectorAll(" | ||
+ | .forEach(translateElement); | ||
+ | }); | ||
+ | // Replace the inner text of the given HTML element | ||
+ | // with the translation in the active locale, | ||
+ | // corresponding to the element' | ||
+ | function translateElement(element) { | ||
+ | const key = element.getAttribute(" | ||
+ | const initialLocale = supportedOrDefault(browserLocales(true)); | ||
+ | const translation = translations[initialLocale][key]; | ||
+ | element.innerHTML = translation; | ||
+ | } | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== Maintenance-Konfiguration: | ||
+ | |||
+ | Bevor **__weitere__** **Konfigurationsschritte** erfolgen, sollte ein **Neustart** erfolgen, was mit nachfolgendem Befehl durchgeführt werden kann: | ||
+ | < | ||
+ | # systemctl restart haproxy.service | ||
+ | </ | ||
+ | |||
+ | :!: **HINWEIS** - **Es erfolgen __keine__ weiteren Ausgaben, wenn der Start erfolgreich war !** | ||
+ | |||
+ | ==== Maintenance-Konfiguration: | ||
+ | |||
+ | Wenn der Start des [[https:// | ||
+ | |||
+ | {{: | ||
===== Cache-Konfiguration: | ===== Cache-Konfiguration: | ||
Zeile 1659: | Zeile 1814: | ||
code: 200, check duration: 8ms, status: 3/3 UP | code: 200, check duration: 8ms, status: 3/3 UP | ||
</ | </ | ||
- | |||
- | ===== Maintenance-Konfiguration: | ||
- | |||
- | Nachfolgende Konfigurationsschritte sollen eine Maintenance-Konfiguration (Wartungsseite) des [[https:// | ||
- | |||
- | Durch die Maintenance-Konfiguration (Wartungsseite) wird eine individuelle Wartungsseite zur Anzeige gebracht, für den Fall, dass kein **'' | ||
- | |||
- | Bevor mit der Konfiguration des [[https:// | ||
- | < | ||
- | # cp -a / | ||
- | </ | ||
- | |||
- | Anschliessend kann die Konfigurationsdatei des [[https:// | ||
- | **__Nur relevanter Ausschnitt__**: | ||
- | <code bash> | ||
- | http-errors haerrors | ||
- | errorfile 503 / | ||
- | </ | ||
- | |||
- | :!: **HINWEIS** - Die vorhergehenden Konfigurationszeilen können als **__neue__** Sektion: '' | ||
- | |||
- | In der Sektion: **'' | ||
- | <code bash> | ||
- | errorfiles haerrors | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | * <code bash> | ||
- | |||
- | Erstellt eine neue http-Fehlergruppe mit dem Namen < | ||
- | |||
- | * <code bash> | ||
- | |||
- | Zuordnung eines Dateiinhalts zu einem HTTP-Fehlercode. | ||
- | |||
- | * <code bash> | ||
- | |||
- | Vwewendet ganz oder teilweise die Fehlerdateien, | ||
- | |||
- | ==== Maintenance-Konfiguration: | ||
- | |||
- | Nachfolgende Konfigurationsdatei soll **neu** erstellt werden und - hier - einen Einfachen Inhalt für eine Maintenance-Seite (Wartungsseite) im HTML-Format enthalten: | ||
- | < | ||
- | # vim / | ||
- | </ | ||
- | |||
- | Der Inhalt könnte wie folgt aussehen: | ||
- | <code html> | ||
- | HTTP/1.0 503 Service Unavailable | ||
- | Cache-Control: | ||
- | Connection: close | ||
- | Content-Type: | ||
- | |||
- | < | ||
- | < | ||
- | < | ||
- | <meta charset=" | ||
- | <meta http-equiv=" | ||
- | <meta name=" | ||
- | </ | ||
- | < | ||
- | html, body { padding: 0; margin: 0; width: 100%; height: 100%; } | ||
- | * {box-sizing: | ||
- | body { text-align: center; padding: 0; background: #d6433b; color: #fff; font-family: | ||
- | h1 { font-size: 24px; font-weight: | ||
- | body { font-family: | ||
- | article { display: block; width: 700px; padding: 50px; margin: 0 auto; } | ||
- | b { color: #fff; font-weight: | ||
- | svg { width: 75px; margin-top: 1em; } | ||
- | </ | ||
- | < | ||
- | <svg xmlns=" | ||
- | < | ||
- | <div> | ||
- | < | ||
- | < | ||
- | <div> | ||
- | < | ||
- | </ | ||
- | </ | ||
- | </ | ||
- | |||
- | ==== Maintenance-Konfiguration: | ||
- | |||
- | Bevor **__weitere__** **Konfigurationsschritte** erfolgen, sollte ein **Neustart** erfolgen, was mit nachfolgendem Befehl durchgeführt werden kann: | ||
- | < | ||
- | # systemctl restart haproxy.service | ||
- | </ | ||
- | |||
- | :!: **HINWEIS** - **Es erfolgen __keine__ weiteren Ausgaben, wenn der Start erfolgreich war !** | ||
- | |||
- | ==== Maintenance-Konfiguration: | ||
- | |||
- | Wenn der Start des [[https:// | ||
- | |||
- | HAProxy - Maintenance | ||
- | |||
- | |||
- | |||
- | FIXME **Hier geht es weiter... / To be continued ...** | ||
tachtler/haproxy_archlinux.txt · Zuletzt geändert: 2023/12/28 15:21 von klaus