Sv translation |
---|
|
Configuration Changes Note |
---|
For redundant installations, the haproxy configuration must be maintained on both nodes identically. |
Location of Configuration FileThe configuration file is located in: /etc/haproxy/haproxy.cfg User for haproxy AdministrationThe following URL can be used, to access the administration web admin site for the load balancer: http(s)://acd-store:7777
This page can be used for example to deactivate certain resources for maintenance purposes. Users, who can access the web admin site, must be configured in the configuraiton file. First of all, a password must be generated, using the following command: Status |
---|
colour | Red |
---|
title | Caution Password |
---|
|
Translations Ignore |
---|
Code Block |
---|
| python -c 'import crypt; print crypt.crypt("<password>", "$5$jhaProxy")' |
|
This command creates a password hash with a salt value jhaProxy. This hash and the user name is added to the configuration file. The line for newuser is added, and the user is added at the end of the group admin line: Translations Ignore |
---|
Code Block |
---|
userlist stats-auth
...
user newuser password <hashvalue>
group admin users admin,jtel,newuser |
|
The configuration file allows redirects from the following URLs to the correct login page: - Root requests directly to the load balancer are redirected to /CarrierPortal/login/RESELLER/CLIENT
- Requests to /mini are redirected to the mini client login page /CarrierPortal/mclogin/RESELLER/CLIENT
Modify the redirect parameters RESELLER and CLIENT according to the required standard RESELLER UID and CLIENT UID on the system. If required (for example for cloud installations), you can remove the /CLIENT part of the URL. Translations Ignore |
---|
Code Block |
---|
redirect location /CarrierPortal/login/RESELLER/CLIENT if root_req
redirect location /CarrierPortal/mclogin/RESELLER/CLIENT if mini_req |
|
The list of the backend web application servers and SOAP servers must be configured. The alias from /etc/hosts will work fine, however make sure you have all of the servers configured. Here is the backend configuration for two webservers for the portal: Translations Ignore |
---|
Code Block |
---|
backend jtel_portal
...
server jboss1 acd-jb1:8080 weight 1 cookie jboss1 check inter 1m
server jboss2 acd-jb2:8080 weight 1 cookie jboss2 check inter 1m |
|
And here is the backend configuration for two webservers for the portal: Translations Ignore |
---|
Code Block |
---|
backend jtel_soap
...
server jboss1 acd-jb1:8080 weight 1 cookie jboss1 check inter 1m
server jboss2 acd-jb2:8080 weight 1 cookie jboss2 check inter 1m |
|
Start the haproxy ServiceStart the haproxy service as follows: Translations Ignore |
---|
Code Block |
---|
| systemctl start haproxy.service |
|
Im Anschluss sollte geprüft werden, ob der Dienst auch tatsächlich läuft. Ist dies nicht der Fall, kann die Log-Datei Aufschluß über eventuelle Konfigurationsfehler geben. Bei Konfigurationsänderungen kann der haproxy DIenst im laufenden Betrieb mittels folgendem Befehl seine Konfiguration aktualisieren: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Update the configuration during operation |
---|
| service haproxy reload |
|
TestOpen the following URL in a browser: http://acd-lb/admin You should see the login screen of the jtel portal web application: ![](/download/attachments/17696806/portal-login.png?version=1&modificationDate=1594145642000&api=v2)
|
Sv translation |
---|
|
toc |
|
Erforderliche Anpassungen der Konfiguration
Hinweis: bei Redundanz, wird dies auf BEIDE NODES ausgeführt.
Die Konfigurationsdatei /etc/haproxy/haproxy.cfg
muss nun mit einem Text-Editor der Umgebung entsprechend angepasst werden. Die Datei enthält verschiedene Bereiche, die der Anpassung bedürfen.
Anpassung der Benutzer für die haproxy-Administration
Über die URL http(s)://acd-store:7777
kann auf eine Administrationsoberfläche des haproxy-Dienstes zugegriffen werden. Hier können z.B. Backend-Server aus der Verteilung zu Wartungs- oder Test-Zwecken ausgeschlossen werden. In der Standardkonfiguration gibt es einen Read-Only-Benutzer (Benutzername: user, Passwort: <password>) und zwei Konfigurations-berechtigte Benutzer (admin und jtel). Beide haben das gleiche (bekannte) Passwort. Möchte man z.B. das Passwort für den Benutzer admin ändern, so dass z.B. ein Kudnen- oder Partner-Administrator auch Zugriff hat, so kann man mittels einem speziellen Befehl einen neuen Passwort-Hash generieren:
Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Generate a password hash |
---|
|
python -c 'import crypt; print crypt.crypt("<password>", "$5$jhaProxy")' |
Dieser Befehl generiert ein neues SHA256 Hash für das Passwort "F1r3ball2016" unter Benutzung des Salt-Wertes "jhaProxy". Dieser Hash kann dann für den entsprechenden Benutzer eingesetzt werden. Der Benutzerbereich in der Konfigurationsdatei sieht folgendermaßen aus:
Translations Ignore |
---|
Code Block |
---|
title | User area in /etc/haproxy/haproxy.cfg |
---|
|
userlist stats-auth
user admin password $5$jhaProxy$rd33gRtd4Wt5UyIclODlyjinSeH4N2DjLtKk33PNZH.
user jtel password $5$jhaProxy$rd33gRtd4Wt5UyIclODlyjinSeH4N2DjLtKk33PNZH.
user user password $5$jhaProxy$.saE3wsZ9AzbDMk2jW9WWQqm.4.vgyZCjFdCf5dAKD6
group admin users admin,jtel
group readonly users user |
Anpassung der URL Umleitungen
Die Konfigurationsvorlage stellt drei URL-Umleitungen zu Verfügung um den komfortablen Zugriff auf die Login Masken für den System-Administrator Login, den normalen Benutzer-Login und den normalen Benutzer-Login für den Mini Client zu ermöglichen. Dies erfordert allerdings eine Anpassung an dem Bereich acdportal_http
bzw. acdportal_https
:
Translations Ignore |
---|
Code Block |
---|
title | Adjustment of URL redirects |
---|
|
redirect location /CarrierPortal/login/RESELLER/CLIENT if root_req
redirect location /CarrierPortal/mclogin/RESELLER/CLIENT if mini_req |
Hier sind die Zeichenketten RESELLER
bzw. CLIENT
respektive mit der "Reseller UID" und der "Client UID" des Standardmandanten zu ersetzen. Werden diese bei der Einrichtung des Kundensystems nicht spezifisch angepasst, so lauten beide "default".
Anpassung der Backend-Listen
Die Liste der Web-Applikationsserver auf die die Anfrage verteilt werden sollen, wird in der Konfigurationsdatei in zwei getrennten Bereichen gepflegt. Der folgende Bereich ist zuständig für die Verteilung aller Aufrufe auf das Portal:
Translations Ignore |
---|
Code Block |
---|
title | Backend area for the web portal |
---|
|
backend jtel_portal
mode http
compression algo gzip
compression type text/xml text/html text/plain text/css text/javascript
cookie SERVERID insert indirect nocache
appsession JSESSIONID len 32 timeout 3600000
balance leastconn # roundrobin
server jboss1 192.168.1.31:8080 weight 1 cookie jboss1 check inter 1m
server jboss2 192.168.1.32:8080 weight 1 cookie jboss2 check inter 1m |
Hier sind entsprechend der Systemarchitektur alle Web-Applikationsserver einzutragen, die das Web-portal (auch Mini Client) zur Verfügung stellen sollen. Für jeden Server ist eine "server"-Zeile zu erstellen. Dabei ist darauf zu achten, eindeutige interne Namenskennzeichnungen und cookie-Werte zu verwenden (im obigen Fall "jbossX" wobei X durchnummeriert wird).
Der folgende Bereich ist hingegen zuständig für die Verteilung aller SOAP Anfragen:
Translations Ignore |
---|
Code Block |
---|
title | Backend area for the SOAP interface |
---|
|
backend jtel_soap
mode http
compression algo gzip
compression type text/xml text/html text/plain text/css text/javascript
balance leastconn # roundrobin
stick-table type ip size 20k
stick on src
server jboss1 192.168.1.31:8081 weight 1 cookie jboss1 check inter 1m
server jboss2 192.168.1.32:8081 weight 1 cookie jboss2 check inter 1m |
Auch hier sind entsprechend der Systemarchitektur alle Web-Applikationsserver einzutragen, die das SOAP Interface zur Verfügung stellen sollen. Für jeden Server ist eine "server"-Zeile zu erstellen. Dabei ist darauf zu achten, eindeutige interne Namenskennzeichnungen und cookie-Werte zu verwenden (im obigen Fall "jbossX" wobei X durchnummeriert wird). Diese Server sind in der Regel die gleichen, die auch für den Portal-Zugriff verwendet werden. In großen Installationen können hierfür aber auch dedizierte Web-Applikationsserver angegeben werden.
Note |
---|
|
Ein wichtiger Unterschied zwischen der HTTP under HTTPS Version der Konfigurationsdatei, liegt in dem Port zu dem SOAP Anfragen geleitet werden. Erfolgt der Zugriff über HTTPS, so werden alle Anfrage zu den Web-Application Server auf Port 8081 geleitet. Dieser Connector ist so konfiguriert, dass der JBOSS-Server weiss, dass die originalen Anfragen über HTTPS hereingekommen sind, und die zurück gegebene URLs (wie z.B. im WSDL) mit dem entsprechenden Schema versieht, auch wenn die Kommunikation zwischen haproxy und Backend nur über HTTP läuft. In der reinen HTTP-Version der Konfigurationsvorlage werden die Anfragen hingegen zu Port 8080 geleitet. |
Starten des haproxy-Dienstes
Nach dem alle Konfigurationsanpassungen getätigt wurden, kann der haproxy-Dienst gestartet werden:
Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Start the haproxy service |
---|
|
service haproxy start |
Im Anschluss sollte geprüft werden, ob der Dienst auch tatsächlich läuft. Ist dies nicht der Fall, kann die Log-Datei Aufschluß über eventuelle Konfigurationsfehler geben.
Bei Konfigurationsänderungen kann der haproxy DIenst im laufenden Betrieb mittels folgendem Befehl seine Konfiguration aktualisieren:
Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Update the configuration during operation |
---|
|
service haproxy reload |
Ein finaler Test gibt Aufschluss über den Erfolg der Installation. Da zu diesem Zeitpunkt die UID Werte des Reseller und Mandanten noch nicht umbenannt wurden, empfiehlt sich der Aufruf der URL für den Admin-Login: http://acd-lb.example.com/admin welcher im Erfolgsfall zur Login-Maske des Portals führt.
Image Removed
Weiterführende Links
Dokumentation von haproxy