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 21:38. ] – [Paketdetails] 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 625: | Zeile 625: | ||
| 2017-01-08 22:24:57 +0100 apcupsd 3.14.12 (29 March 2014) redhat startup succeeded | 2017-01-08 22:24:57 +0100 apcupsd 3.14.12 (29 March 2014) redhat startup succeeded | ||
| + | === Statusabfrage === | ||
| + | Zur Abfrage des aktuellen Status unseres **apcupsd** verwenden wir das Programm **apcaccess**. | ||
| - | ===== old stuff ===== | + | # / | 
| - | < | + | < | 
| - | DATE     : | + | DATE     : | 
| - | HOSTNAME : vml000020.dmz.nausch.org | + | HOSTNAME : vml000127.dmz.nausch.org | 
| - | VERSION | + | VERSION | 
| UPSNAME | UPSNAME | ||
| CABLE : Custom Cable Smart | CABLE : Custom Cable Smart | ||
| DRIVER | DRIVER | ||
| UPSMODE | UPSMODE | ||
| - | STARTTIME: | + | STARTTIME: | 
| MODEL : SMART-UPS 1400 RM | MODEL : SMART-UPS 1400 RM | ||
| STATUS | STATUS | ||
| - | LINEV : 226.2 Volts | + | LINEV : 221.0 Volts | 
| - | LOADPCT | + | LOADPCT | 
| BCHARGE | BCHARGE | ||
| - | TIMELEFT : 9.0 Minutes | + | TIMELEFT : 17.0 Minutes | 
| MBATTCHG : 5 Percent | MBATTCHG : 5 Percent | ||
| MINTIMEL : 3 Minutes | MINTIMEL : 3 Minutes | ||
| MAXTIME | MAXTIME | ||
| - | MAXLINEV : 228.8 Volts | + | MAXLINEV : 222.3 Volts | 
| - | MINLINEV : 226.2 Volts | + | MINLINEV : 219.7 Volts | 
| - | OUTPUTV | + | OUTPUTV | 
| SENSE : High | SENSE : High | ||
| - | DWAKE : 000 Seconds | + | DWAKE : 0 Seconds | 
| - | DSHUTD | + | DSHUTD | 
| - | DLOWBATT : 02 Minutes | + | DLOWBATT : 2 Minutes | 
| LOTRANS | LOTRANS | ||
| HITRANS | HITRANS | ||
| - | RETPCT | + | RETPCT | 
| - | ITEMP : 34.2 C Internal | + | ITEMP : 27.4 C | 
| - | ALARMDEL : 5 seconds | + | ALARMDEL : 5 Seconds | 
| BATTV : 27.6 Volts | BATTV : 27.6 Volts | ||
| LINEFREQ : 50.0 Hz | LINEFREQ : 50.0 Hz | ||
| LASTXFER : Automatic or explicit self test | LASTXFER : Automatic or explicit self test | ||
| NUMXFERS : 0 | NUMXFERS : 0 | ||
| - | TONBATT | + | TONBATT | 
| - | CUMONBATT: 0 seconds | + | CUMONBATT: 0 Seconds | 
| XOFFBATT : N/A | XOFFBATT : N/A | ||
| SELFTEST : NO | SELFTEST : NO | ||
| STESTI | STESTI | ||
| - | STATFLAG : 0x07000008 Status Flag | + | STATFLAG : 0x05000008 | 
| - | DIPSW : 0x00 Dip Switch | + | DIPSW : 0x00 | 
| - | REG1 : 0x00 Register 1 | + | REG1 : 0x00 | 
| - | REG2 : 0x00 Register 2 | + | REG2 : 0x00 | 
| - | REG3 : 0x00 Register 3 | + | REG3 : 0x00 | 
| - | MANDATE | + | MANDATE | 
| SERIALNO : GS9939006549 | SERIALNO : GS9939006549 | ||
| - | BATTDATE : 09/23/11 | + | BATTDATE : 09/23/99 | 
| NOMOUTV | NOMOUTV | ||
| - | NOMBATTV : 24.0 Volts | + | NOMBATTV : 24.0 Volts | 
| EXTBATTS : 0 | EXTBATTS : 0 | ||
| FIRMWARE : 72.11.I | FIRMWARE : 72.11.I | ||
| - | END APC : 2012-07-28 16:28:50 +0200 | + | END APC  : 2017-01-08 14:53:15 +0100</ | 
| - | </ | + | |
| - | + | ||
| - | # vim / | + | |
| - | + | ||
| - | <file apache / | + | |
| - | + | ||
| - | # | + | |
| - | # power.nausch.org | + | |
| - | # | + | |
| - | < | + | |
| - | ServerAdmin webmaster@nausch.org | + | |
| - | ServerName power.nausch.org | + | |
| - | ServerAlias www.power.nausch.org | + | |
| - | ServerPath / | + | |
| - | DocumentRoot "/ | + | |
| - | AddHandler cgi-script .cgi | + | |
| - | < | + | |
| - | Options FollowSymLinks | + | |
| - | AllowOverride all | + | |
| - | Order Allow, | + | |
| - | Allow from all | + | |
| - | Options ExecCGI | + | |
| - | </ | + | |
| - | AddType application/ | + | |
| - | DirectoryIndex multimon.cgi | + | |
| - | ErrorLog logs/ | + | |
| - | CustomLog logs/ | + | |
| - | </ | + | |
| - | + | ||
| - | ... | + | |
| - | </ | + | |
| - | + | ||
| - | {{ : | + | |
| - | + | ||
| - | < | + | === Statusbenachrichtigungen per eMail === | 
| + | Bei einem Stromausfall oder anderen Störungen wird automatisch der User **root** per eMail informiert. | ||
| + | < | ||
| From: root@nausch.org (root) | From: root@nausch.org (root) | ||
| To: root@nausch.org | To: root@nausch.org | ||
| - | Subject: | + | Subject: | 
| - | vml000020.dmz.nausch.org Power Failure !!! | + | vml000127.dmz.nausch.org Power Failure !!! | 
| - | APC : 001,052,1297 | + | APC : 001,051,1170 | 
| - | DATE     : | + | DATE     : | 
| - | HOSTNAME : vml000020.dmz.nausch.org | + | HOSTNAME : vml000127.dmz.nausch.org | 
| - | VERSION | + | VERSION | 
| UPSNAME | UPSNAME | ||
| CABLE : Custom Cable Smart | CABLE : Custom Cable Smart | ||
| Zeile 775: | Zeile 744: | ||
| EXTBATTS : 0 | EXTBATTS : 0 | ||
| FIRMWARE : 72.11.I | FIRMWARE : 72.11.I | ||
| - | END APC  : 2012-07-30 17:23:01 +0200 | + | END APC  : 2017-01-08 23:23:01 +0200 | 
| </ | </ | ||
| - | < | + | Wird die Stromversorgung wieder hergestellt, | 
| + | < | ||
| From: root@nausch.org (root) | From: root@nausch.org (root) | ||
| To: root@nausch.org | To: root@nausch.org | ||
| - | Subject: | + | Subject: | 
| - | vml000020.dmz.nausch.org Power has returned | + | vml000127.dmz.nausch.org Power has returned | 
| - | APC : 001,052,1322 | + | APC : 001,051,1170 | 
| - | DATE     : | + | DATE     : | 
| - | HOSTNAME : vml000020.dmz.nausch.org | + | HOSTNAME : vml000127.dmz.nausch.org | 
| - | VERSION | + | VERSION | 
| UPSNAME | UPSNAME | ||
| CABLE : Custom Cable Smart | CABLE : Custom Cable Smart | ||
| Zeile 838: | Zeile 808: | ||
| EXTBATTS : 0 | EXTBATTS : 0 | ||
| FIRMWARE : 72.11.I | FIRMWARE : 72.11.I | ||
| - | END APC  : 2012-07-30 17:23:59 +0200 | + | END APC  : 2017-01-08 23:23:59 +0200 | 
| </ | </ | ||
| + | |||
| + | |||
| ===== apcupsd-gui ===== | ===== apcupsd-gui ===== | ||
| - | ==== Installation | + | Hat man auf dem Server einen X-server am laufen, muss man sich nicht auf die textbasierten Informationen zurückgreifen. Hier kann man auch auf das **GUI**((**G**raphical **U**ser **I**nterface)) für den APCUPS-Daemon zurückgreifen. Die Installation | 
| # yum install -y apcupsd-gui | # yum install -y apcupsd-gui | ||
| + | Den Inhalt des RPM-Paketes erforscht man bei Interesse wie folgt. | ||
| # rpm -qil apcupsd-gui | # rpm -qil apcupsd-gui | ||
| < | < | ||
| Zeile 875: | Zeile 847: | ||
| / | / | ||
| / | / | ||
| + | |||
| + | Der Start der GUI erfolgt über das Startmenü oder durch Aufruf des Befehls **gamcmon** nach Eingabe der Tatsenkobination **ALT**+**F2**. | ||
| {{ : | {{ : | ||
| - | ==== 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 911: | Zeile 891: | ||
| / | / | ||
| / | / | ||
| + | |||
| + | ==== Konfiguration ==== | ||
| + | Da wir die WEB-GUI über einen separaten Apache vHOST ansprechen wollen deaktivieren wir als erstes die mitgelieferte Apache Konfigurationsdatei // | ||
| + | |||
| + | 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 | ||
| + | # | ||
| + | < | ||
| + | ServerAdmin webmaster@nausch.org | ||
| + | ServerName power.nausch.org | ||
| + | ServerPath / | ||
| + | DocumentRoot "/ | ||
| + | AddHandler cgi-script .cgi | ||
| + | DirectoryIndex multimon.cgi | ||
| + | |||
| + | < | ||
| + | Require all granted | ||
| + | AddHandler cgi-script cgi pl | ||
| + | Options ExecCGI | ||
| + | </ | ||
| + | |||
| + | AddType application/ | ||
| + | ErrorLog 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:// | ||
| + | |||
| + | |||
 django
 django