Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
centos:apc [08.01.2017 22:30. ] – [old stuff] django | centos:apc [22.07.2019 14:52. ] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 3: | Zeile 3: | ||
{{: | {{: | ||
- | Beim Betrieb eines Servers ist der Einsatz einer gesicherten Energieversorgung natürlich obligatorisch. Im RZ((Rechen Zentrum)) stehen dazu meist unterbrechungsfreie Stromversorgungen, | + | Beim Betrieb eines Servers ist der Einsatz einer gesicherten Energieversorgung natürlich obligatorisch. Im **RZ**((**R**echen **Z**entrum)) stehen dazu meist unterbrechungsfreie Stromversorgungen, |
{{: | {{: | ||
Zeile 854: | Zeile 854: | ||
===== apcupsd-cgi ===== | ===== apcupsd-cgi ===== | ||
+ | Eine weitere Möglichkeit zur Visualisierung der Stati unseres APCUPS-Daemon ist die Verwendung einer WEB-GUI, so dass von berechtigten Hosts, Netzen und/oder Nutzern eine Statusabfrage im Intra- oder auch Internet erfolgen kann. Die notwendigen Programmteile und Konfigurationsbeispiele sind in dem RPm-Paket **apcupsd-cgi** enthalten. | ||
+ | ==== Installation ==== | ||
+ | Dieses Paket installieren wir nun mit Unterstützung des Befehls **yum**. | ||
# yum install apcupsd-cgi | # yum install apcupsd-cgi | ||
- | < | + | Den Inhalt des Paketes und auch den Speicherort ermitteln wir wie gewohnt mittels **rpm** und der Option //-qil//. |
- | Name : apcupsd-cgi | + | # rpm -qil apcupsd-cgi |
+ | |||
+ | < | ||
Version | Version | ||
Release | Release | ||
Zeile 887: | Zeile 892: | ||
/ | / | ||
- | ===== old stuff ===== | + | ==== Konfiguration |
- | # vim / | + | Da wir die WEB-GUI über einen separaten Apache vHOST ansprechen wollen deaktivieren wir als erstes die mitgelieferte Apache Konfigurationsdatei //**/ |
- | + | ||
- | <file apache | + | |
+ | Die Installation und Konfiguration des **// | ||
+ | # vim / | ||
+ | <file apache / | ||
+ | ## apcupsd configuration file for Apache Web server | ||
+ | ## | ||
# | # | ||
+ | ## files are off the documentroot of Web server | ||
+ | #Alias /apcupsd / | ||
+ | #< | ||
+ | # AddHandler cgi-script cgi pl | ||
+ | # Options ExecCGI | ||
+ | #</ | ||
+ | # | ||
+ | ## | ||
+ | ## Allow only local access at default | ||
+ | ## Change the " | ||
+ | ## access rights to your needs to enable remote access also. | ||
+ | ## | ||
+ | #< | ||
+ | # DirectoryIndex upsstats.cgi | ||
+ | # AllowOverride None | ||
+ | # Options ExecCGI Indexes | ||
+ | # < | ||
+ | # # Apache 2.4 | ||
+ | # Require local | ||
+ | # </ | ||
+ | # < | ||
+ | # # Apache 2.2 | ||
+ | # Order deny,allow | ||
+ | # Deny from all | ||
+ | # Allow from 127.0.0.1 | ||
+ | # Allow from ::1 | ||
+ | # </ | ||
+ | #</ | ||
+ | |||
+ | Die Konfiguration unseres Apache vHOST erledigen wir mit Hilfe einer eigenen Konfigurationsdatei // | ||
+ | |||
+ | <file bash / | ||
# power.nausch.org | # power.nausch.org | ||
# | # | ||
Zeile 898: | Zeile 938: | ||
ServerAdmin webmaster@nausch.org | ServerAdmin webmaster@nausch.org | ||
ServerName power.nausch.org | ServerName power.nausch.org | ||
- | ServerAlias www.power.nausch.org | ||
ServerPath / | ServerPath / | ||
DocumentRoot "/ | DocumentRoot "/ | ||
AddHandler cgi-script .cgi | AddHandler cgi-script .cgi | ||
- | | + | DirectoryIndex multimon.cgi |
- | | + | |
- | AllowOverride | + | < |
- | Order Allow,Deny | + | |
- | Allow from all | + | |
- | | + | Options ExecCGI |
- | </ | + | </ |
AddType application/ | AddType application/ | ||
- | DirectoryIndex multimon.cgi | ||
ErrorLog logs/ | ErrorLog logs/ | ||
CustomLog logs/ | CustomLog logs/ | ||
</ | </ | ||
- | |||
- | ... | ||
</ | </ | ||
- | {{ : | + | Den Zugriff werden wir natürlich entsprechend beschneiden und den Transportweg absichern. Auf unserem HTTP-Proxy-Host legen wir hierzu eine passende vHOST-Konfigurationsdatei an. |
+ | # vim / | ||
+ | <file apache / | ||
+ | # Django : 2015-10-29 | ||
+ | # vHost power | ||
+ | # | ||
+ | |||
+ | # Variablen der Hostvariablen | ||
+ | Define vhost power | ||
+ | Define errors_log logs/ | ||
+ | Define access_log logs/ | ||
+ | Define ssl_log logs/ | ||
+ | |||
+ | < | ||
+ | ServerAdmin webmaster@nausch.org | ||
+ | ServerName ${vhost}.nausch.org | ||
+ | |||
+ | RewriteEngine on | ||
+ | RewriteCond %{HTTPS} off | ||
+ | RewriteRule (.*) https:// | ||
+ | |||
+ | # Welche Logdateien sollen beschrieben werden | ||
+ | SetEnvIf Remote_Addr " | ||
+ | ErrorLog | ||
+ | CustomLog ${access_log} combined env=!dontlog | ||
+ | </ | ||
+ | < | ||
+ | ServerAdmin webmaster@nausch.org | ||
+ | ServerName ${vhost}.nausch.org | ||
+ | ServerPath / | ||
+ | |||
+ | # Wer soll Zugriff auf die Webseite(n) bekommen? | ||
+ | <Proxy *> | ||
+ | Options +FollowSymLinks +Multiviews -Indexes | ||
+ | AllowOverride None | ||
+ | AuthType Basic | ||
+ | AuthName "Fuer den Zugriff auf den Webserver bitte Anmeldedaten eingeben!" | ||
+ | AuthBasicProvider ldap | ||
+ | AuthLDAPUrl ldaps:// | ||
+ | AuthLDAPBindDN cn=TechnischerUser, | ||
+ | AuthLDAPBindPassword " | ||
+ | AuthLDAPBindAuthoritative on | ||
+ | Require ldap-user django | ||
+ | </ | ||
+ | |||
+ | # Welcher Inhalt soll angezeigt bzw. auf welchen Server sollen die HTTP-Requests weitergeleitet werden? | ||
+ | ProxyRequests Off | ||
+ | ProxyPreserveHost On | ||
+ | ProxyPass / http:// | ||
+ | ProxyPassReverse / http:// | ||
+ | |||
+ | # Welche Logdateien sollen beschrieben werden | ||
+ | SetEnvIf Remote_Addr " | ||
+ | ErrorLog | ||
+ | CustomLog ${access_log} combined env=!dontlog | ||
+ | CustomLog ${ssl_log} "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \" | ||
+ | |||
+ | # Absicherung der Übertragung mit Hilfe von TLS | ||
+ | # Django : 2015-10-04 - TLS-Verschlüsselung mit Hilfe von mod_ssl | ||
+ | SSLEngine on | ||
+ | # Definition der anzubietenden Protokolle | ||
+ | SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1 | ||
+ | # Definition der Cipher | ||
+ | SSLCipherSuite ECDHE-RSA-AES256-GCM-SHA384: | ||
+ | # Schlüsseldatei, | ||
+ | SSLCertificateKeyFile / | ||
+ | # Zertifikatsdatei, | ||
+ | SSLCertificateFile / | ||
+ | # Zertifikatsdatei des bzw. der Intermediate-Zertifikate(s) | ||
+ | SSLCertificateChainFile / | ||
+ | # Änderung der Cipherorder der Clients verneinen | ||
+ | SSLHonorCipherOrder on | ||
+ | # TLS 1.0 Kompremmierung deaktivieren (CRIME attacks) | ||
+ | SSLCompression off | ||
+ | # Online Certificate Status Protocol stapling zum Prüfen des Gültigkeitsstatus des Serverzertifikats. | ||
+ | SSLUseStapling on | ||
+ | SSLStaplingResponderTimeout 5 | ||
+ | SSLStaplingReturnResponderErrors off | ||
+ | |||
+ | # HTTP Strict Transport Security (HSTS), bei dem der Server dem Client im HTTP-Header mitteilt, | ||
+ | # dass dieser nur noch verschlüsselt mit dem Server kommunizieren soll. | ||
+ | Header always set Strict-Transport-Security " | ||
+ | |||
+ | # This header enables the Cross-site scripting (XSS) filter built into most recent web browsers. | ||
+ | # It's usually enabled by default anyway, so the role of this header is to re-enable the filter for | ||
+ | # this particular website if it was disabled by the user. | ||
+ | # https:// | ||
+ | #Header set X-XSS-Protection "1; mode=block" | ||
+ | Header always set X-Xss-Protection "1; mode=block" | ||
+ | |||
+ | # when serving user-supplied content, include a X-Content-Type-Options: | ||
+ | # to disable content-type sniffing on some browsers. | ||
+ | # https:// | ||
+ | # currently suppoorted in IE > 8 http:// | ||
+ | # http:// | ||
+ | # ' | ||
+ | # Sofern die Datei auch den entsprechenden MIME-Typ " | ||
+ | # CSS-Dateien nur als CSS interprätieren. | ||
+ | Header always set X-Content-Type-Options nosniff | ||
+ | |||
+ | # config to don't allow the browser to render the page inside an frame or iframe | ||
+ | # and avoid clickjacking http:// | ||
+ | # if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri | ||
+ | # https:// | ||
+ | ###header set X-Frame-Options SAMEORIGIN | ||
+ | header always set X-Frame-Options DENY | ||
+ | |||
+ | # hide server header (apache and php version) | ||
+ | Header always unset Server | ||
+ | |||
+ | # Only allow JavaScript from the same domain to be run. | ||
+ | # don't allow inline JavaScript to run. | ||
+ | Header always set X-Content-Security-Policy "allow ' | ||
+ | |||
+ | # Add Secure and HTTP only attributes to cookies | ||
+ | Header edit Set-Cookie ^(.*)$ $1; | ||
+ | |||
+ | # prevent Clickjacking Attack | ||
+ | #Header always append X-Frame-Options SAMEORIGIN | ||
+ | Header always set X-Frame-Options " | ||
+ | |||
+ | # hkpk-stuff | ||
+ | Header always set Public-Key-Pins " | ||
+ | </ | ||
+ | |||
+ | Bevor wir zur Aktivierung unserer Konfigurationsänderungen den bzw. die HTTP-Daemon einmal durchstarten überprüfen wir unsere Apache-Konfigurationsdateien auf syntaktische Fehler. | ||
+ | # apachectl -t | ||
+ | |||
+ | Syntax OK | ||
+ | |||
+ | Ist alles O.K. starten wir den/die Daemon nun einmal neu. | ||
+ | # systemctl restart httpd.service | ||
+ | |||
+ | < | ||
+ | <font style=" | ||
+ | | ||
+ | | ||
+ | Docs: man: | ||
+ | | ||
+ | Process: 11642 ExecStop=/ | ||
+ | Main PID: 11647 (httpd) | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Jan 09 11:03:23 vml000127.dmz.nausch.org systemd[1]: Starting The Apache HTTP Server... | ||
+ | Jan 09 11:03:23 vml000127.dmz.nausch.org systemd[1]: Started The Apache HTTP Server.</ | ||
+ | </ | ||
+ | |||
+ | Nun starten wir einen Browser und öffnen die zugehörige URL. | ||
+ | $ konqueror http:// | ||
+ | |||
+ | Im ersten Bild sehen wir die Startseite der WEB-GUI. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | Das zweite Bild zeigt die Übersicht zu den aktuellen Stati unserer USV. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | Eine Ansicht aller Detailangaben zeigt das dritte Bild. | ||
+ | |||
+ | {{ : | ||
+ | ====== Links ====== | ||
+ | * **[[wiki: | ||
+ | * **[[http:// | ||