Skip to content

checkmk - Apache2 vs. NGINX

checkmk
  • Ich wollte meine VMs im Proxmox mit meiner Dockerinstallation auf meinem Haupt-PC überwachen, bis ich feststellte, das diese Dockerinstallation kein IPv6 kann. Mein Netzwerk ist voll IPv6 fähig. Eine kurze Recherche ergab, das das bei Docker gar nicht soo einfach ist. Also wurde der Plan fallen gelassen.

    Nun musste was auf dem Proxmox ran. Da ich die Container auch mal wieder ausprobieren wollte, habe ich mir gedacht, gut machen wir so 🙂 Kurze Anmerkung, es ist im Normalfall nicht sinnvoll, das so zu machen, da man die Server von extern überwachen soll / muss! Für mich ist das aber nicht so wichtig. Was mir wichtiger ist, das ich ab und zu mal schauen kann, wie so der Status der Raids ist, wie voll sind die Platten und son Zeug.....

    Installation

    Die Installation von checkmk nach Dokumentation vorgenommen.

    Apache2

    Ich stelle hier direkt fest, das ich mit dem Apachen auf Kriegsfuß stehe. Ich mag das Konzept einfach nicht. Ich hatte mich also nun mal wieder an dieser Konfiguration herangetraut und es nach einiger Zeit auch geschafft. Die Installation war ein Debian Minimal Container.

    /etc/apache2/sites-enabled/000-default.conf

    <VirtualHost *:80>
            # The ServerName directive sets the request scheme, hostname and port that
            # the server uses to identify itself. This is used when creating
            # redirection URLs. In the context of virtual hosts, the ServerName
            # specifies what hostname must appear in the request's Host: header to
            # match this virtual host. For the default virtual host (this file) this
            # value is not decisive as it is used as a last resort host regardless.
            # However, you must set it for any further virtual host explicitly.
            #ServerName www.example.com
    
            ServerAdmin webmaster@localhost
            DocumentRoot /var/www/html
    
            # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
            # error, crit, alert, emerg.
            # It is also possible to configure the loglevel for particular
            # modules, e.g.
            #LogLevel info ssl:warn
    
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
    
            # For most configuration files from conf-available/, which are
            # enabled or disabled at a global level, it is possible to
            # include a line for only one particular virtual host. For example the
            # following line enables the CGI configuration for this host only
            # after it has been globally disabled with "a2disconf".
            #Include conf-available/serve-cgi-bin.conf
            RewriteEngine On
            RewriteCond %{SERVER_PORT} !^443$
            RewriteRule (.*) https://%{HTTP_HOST}$1 [L]
            RequestHeader set X-Forwarded-Proto "https"
    </VirtualHost>
    
    # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
    

    /etc/apache2/sites-enabled/001-ssl.conf

    <IfModule mod_ssl.c>
            <VirtualHost [IPv6]:443>
                    ServerAdmin webmaster@localhost
    
                    DocumentRoot /var/www/html
    
                    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
                    # error, crit, alert, emerg.
                    # It is also possible to configure the loglevel for particular
                    # modules, e.g.
                    #LogLevel info ssl:warn
    
                    ErrorLog ${APACHE_LOG_DIR}/error.log
                    CustomLog ${APACHE_LOG_DIR}/access.log combined
    
                    # For most configuration files from conf-available/, which are
                    # enabled or disabled at a global level, it is possible to
                    # include a line for only one particular virtual host. For example the
                    # following line enables the CGI configuration for this host only
                    # after it has been globally disabled with "a2disconf".
                    #Include conf-available/serve-cgi-bin.conf
    
                    #   SSL Engine Switch:
                    #   Enable/Disable SSL for this virtual host.
                    SSLEngine on
    
                    #   A self-signed (snakeoil) certificate can be created by installing
                    #   the ssl-cert package. See
                    #   /usr/share/doc/apache2/README.Debian.gz for more info.
                    #   If both key and certificate are stored in the same file, only the
                    #   SSLCertificateFile directive is needed.
                    SSLCertificateFile      /etc/letsencrypt/live/DOMAIN/fullchain.pem
                    SSLCertificateKeyFile   /etc/letsencrypt/live/DOMAIN/privkey.pem
                    
                    # Add the following to your Apache config.
                    SSLOpenSSLConfCmd DHParameters "/etc/ssl/nginx/dhparam.pem"
    
                    # enable HTTP/2, if available
                    Protocols h2 http/1.1
    
                    # HTTP Strict Transport Security (mod_headers is required) (63072000 seconds)
                    Header always set Strict-Transport-Security "max-age=63072000"
    
                    # Requires Apache 2.4.36 & OpenSSL 1.1.1
                    SSLProtocol -all +TLSv1.3
                    SSLOpenSSLConfCmd Curves X25519:secp521r1:secp384r1:prime256v1
                    #SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
                    SSLCipherSuite AES256+EECDH:AES256+EDH
                    SSLHonorCipherOrder on
    
                    <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                    SSLOptions +StdEnvVars
                    </FilesMatch>
                    <Directory /usr/lib/cgi-bin>
                                    SSLOptions +StdEnvVars
                    </Directory>
    
                    #   SSL Protocol Adjustments:
                    #   The safe and default but still SSL/TLS standard compliant shutdown
                    #   approach is that mod_ssl sends the close notify alert but doesn't wait for
                    #   the close notify alert from client. When you need a different shutdown
                    #   approach you can use one of the following variables:
                    #   o ssl-unclean-shutdown:
                    #        This forces an unclean shutdown when the connection is closed, i.e. no
                    #        SSL close notify alert is send or allowed to received.  This violates
                    #        the SSL/TLS standard but is needed for some brain-dead browsers. Use
                    #        this when you receive I/O errors because of the standard approach where
                    #        mod_ssl sends the close notify alert.
                    #   o ssl-accurate-shutdown:
                    #        This forces an accurate shutdown when the connection is closed, i.e. a
                    #        SSL close notify alert is send and mod_ssl waits for the close notify
                    #        alert of the client. This is 100% SSL/TLS standard compliant, but in
                    #        practice often causes hanging connections with brain-dead browsers. Use
                    #        this only for browsers where you know that their SSL implementation
                    #        works correctly.
                    #   Notice: Most problems of broken clients are also related to the HTTP
                    #   keep-alive facility, so you usually additionally want to disable
                    #   keep-alive for those clients, too. Use variable "nokeepalive" for this.
                    #   Similarly, one has to force some clients to use HTTP/1.0 to workaround
                    #   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
                    #   "force-response-1.0" for this.
                    # BrowserMatch "MSIE [2-6]" \
                    #               nokeepalive ssl-unclean-shutdown \
                    #               downgrade-1.0 force-response-1.0
    
            </VirtualHost>
    </IfModule>
    
    # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
    

    NGINX

    /etc/nginx/sites-enabled/default

    ### CheckMK
    
    ### redirect http requests to https Forum
    server {
        listen               80;
        listen               [IPv6]:80;
        server_name          DOMAIN;
        return 301 https://DOMAIN$request_uri;
    }
    
    
    ### redirect http requests to https Forum
    server {
        listen               80;
        listen               [IPv6]:80;
        server_name          DPMAIN;
        return 301 https://$server_name$request_uri;
    }
    
    
    ### https server Forum
    server {
        listen               443 ssl http2;
        listen               [IPv6]:443 ssl http2;
        server_name          DOMAIN;
        client_max_body_size 10M;
    
        #### SSL & Nginx Settings - Begin
    
        # Grundeinstellungen 
        ssl_session_timeout 10m;
        ssl_session_cache shared:SSL:10m;
        ssl_buffer_size 8k;
    
    
        # OSCP Online Certificate Status Protocol
        ssl_stapling_verify on;
        ssl_stapling on;
    
        # enables TLSv1.2 & TLSv1.3
        ssl_prefer_server_ciphers on;
        ssl_protocols TLSv1.2 TLSv1.3;
        ssl_ciphers ECDH+AESGCM:ECDH+CHACHA20:ECDH+AES256:ECDH+AES128:!aNULL:!SHA1;
    
        # SSL Certificate
        ssl_certificate      /etc/letsencrypt/live/DOMAIN/fullchain.pem;
        ssl_certificate_key  /etc/letsencrypt/live/DOMAIN/privkey.pem;
        ssl_dhparam /etc/ssl/nginx/dhparam-2048.pem;
    
        # HSTS
        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; always";
    
        # Cookie
        proxy_cookie_path / "/; HTTPOnly; Secure";
    
        # X-Frame-Options
        add_header X-Frame-Options  ^`^|SAMEORIGIN ^`^};
    
        # Referrer
        add_header Referrer-Policy  ^`^|no-referrer ^`^};
    
        # Robots
        add_header X-Robots-Tag all;
    
        # X-Download
        add_header X-Download-Options noopen;
    
        # X-Permitted-Cross-Domain-Policies
        add_header X-Permitted-Cross-Domain-Policies none;
    
        # Remove X-Powered-By, which is an information leak
        fastcgi_hide_header X-Powered-By;
    
        #### SSL & Nginx Settings - End
    
       
        ### Root
        location / {
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header Host $http_host;
            proxy_set_header X-NginX-Proxy true;
    
            proxy_pass http://127.0.0.1:5000;  # no trailing slash
            proxy_redirect off;
    
            # Socket.IO Support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    }
    

    Fazit

    Was stört mich am Apachen? Ich musste mal wieder irgendwelche Module hinterher installieren, so was wie ssl z.B. Leibe Macher, welche Seite lasst ihr ohne SSL laufen? Ok, vielleicht nur Kleinigkeiten. Weiter gehts mit irgendwelchen Configs, die man aktivieren muss. a2enconf usw. Ja, es mag sein, das ich das Konzept vom Apachen nicht verstehe, ich finde es einfach nur unkomfortabel.

    NGINX installieren, Konfigurationsdateien erstellen, einmal neustarten und fertig 😉

    Ich habe oben beides angegeben, ihr könnt Euch dann das aussuchen was Euch liegt.

    Der Ordnung halber, das Paket

    dpkg -i /root/check-mk-free-2.0.0p11_0.buster_amd64.deb
    

    hat eine Abhängikeit Apache2 😉 Der installiert das also mit.

  • Ich musste am Ende wieder den Apachen installieren, da checkmk zu viele Abhängigkeiten hat. So was wie omd-apache2(?), wurde mir dann als Fehler angezeigt. Die Server waren auf einmal offline usw. Schade, aber letztendlich für den Container auch egal.

    Oben im Apachen die SSL Sicherheit erhöht.

    4ba2853c-d5a3-422d-b787-b9f66256b511-grafik.png

  • Update 1.32.5 - Security Fixes!

    Vaultwarden
    1
    0 Stimmen
    1 Beiträge
    104 Aufrufe
    Niemand hat geantwortet
  • Links zu Vaultwarden

    Angeheftet Vaultwarden
    1
    0 Stimmen
    1 Beiträge
    133 Aufrufe
    Niemand hat geantwortet
  • NAS 2023 - Hardware

    Angeheftet Verschoben Linux
    3
    +5
    0 Stimmen
    3 Beiträge
    1k Aufrufe
    FrankMF
    Ich war nicht so ganz zufrieden Die zwei 4TB 5 1/4 Zoll HDDs müssen jetzt mal weichen. [image: 1684584960061-20230520_091729-resized.jpg] Ich habe jetzt wieder einen Proxmox Backup Server im Einsatz, da brauche ich nicht mehr so viel Speicherplatz im NAS. Kleiner, aber wichtiger Nebeneffekt ist der, das ich jetzt ca. 7W eingespart habe. In Zeiten wie diesen, rechnet sich das. Nein, die Investitionskosten rechnen wir jetzt nicht dagegen [image: 1684585295398-screenshot_20230520_140727_voltcraft-sem6000_ergebnis.jpg] Aktuelle Platten Ausstattung 1 TB NVMe SSD (Proxmox Systemplatte) 2 * 2,5 Zoll 1TB SSD WD Red (ZFS Pool für mein NAS) 1 * 2,5 Zoll HDD 2TB für Datensicherung
  • 10G

    Linux
    2
    0 Stimmen
    2 Beiträge
    166 Aufrufe
    FrankMF
    Bedingt durch ein paar Probleme mit der Forensoftware, habe ich einen kleinen Datenverlust erlitten. Dazu gehören auch hier einige Beiträge. Dann versuche ich das mal zu rekonstruieren. Oben hatten wir das SFP+ Modul ja getestet. Als nächsten Schritt habe ich die ASUS XG-C100F 10G SFP+ Netzwerkkarte in meinen Hauptrechner verbaut. [image: 1635752117002-20211028_162455_ergebnis.jpg] Die Verbindung zum Zyxel Switch erfolgt mit einem DAC-Kabel. Im Video zum Zyxel Switch wurde schön erklärt, das die DAC Verbindung stromsparender als RJ45 Adapter sind. Somit fiel die Wahl auf die DAC Verbindungen. Hier nochmal das Video. https://www.youtube.com/watch?v=59I-RlliRms So sieht so ein DAC Verbindungskabel aus. Die SFP+ Adapter sind direkt daran montiert. [image: 1635752308951-20211028_170118_ergebnis.jpg] ethtool root@frank-MS-7C37:/home/frank# ethtool enp35s0 Settings for enp35s0: Supported ports: [ FIBRE ] Supported link modes: 100baseT/Full 1000baseT/Full 10000baseT/Full 2500baseT/Full 5000baseT/Full Supported pause frame use: Symmetric Receive-only Supports auto-negotiation: Yes Supported FEC modes: Not reported Advertised link modes: 100baseT/Full 1000baseT/Full 10000baseT/Full 2500baseT/Full 5000baseT/Full Advertised pause frame use: Symmetric Advertised auto-negotiation: Yes Advertised FEC modes: Not reported Speed: 10000Mb/s Duplex: Full Port: FIBRE PHYAD: 0 Transceiver: internal Auto-negotiation: on Supports Wake-on: pg Wake-on: g Current message level: 0x00000005 (5) drv link Link detected: yes iperf3 ----------------------------------------------------------- Server listening on 5201 ----------------------------------------------------------- Accepted connection from 192.168.3.207, port 44570 [ 5] local 192.168.3.213 port 5201 connected to 192.168.3.207 port 44572 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 1.10 GBytes 9.43 Gbits/sec 46 1.59 MBytes [ 5] 1.00-2.00 sec 1.10 GBytes 9.42 Gbits/sec 0 1.60 MBytes [ 5] 2.00-3.00 sec 1.10 GBytes 9.42 Gbits/sec 3 1.60 MBytes [ 5] 3.00-4.00 sec 1.10 GBytes 9.42 Gbits/sec 0 1.60 MBytes [ 5] 4.00-5.00 sec 1.10 GBytes 9.42 Gbits/sec 0 1.61 MBytes [ 5] 5.00-6.00 sec 1.10 GBytes 9.42 Gbits/sec 0 1.63 MBytes [ 5] 6.00-7.00 sec 1.10 GBytes 9.42 Gbits/sec 0 1.63 MBytes [ 5] 7.00-8.00 sec 1.09 GBytes 9.41 Gbits/sec 0 1.68 MBytes [ 5] 8.00-9.00 sec 1.10 GBytes 9.42 Gbits/sec 0 1.68 MBytes [ 5] 9.00-10.00 sec 1.10 GBytes 9.42 Gbits/sec 0 1.68 MBytes [ 5] 10.00-10.02 sec 22.5 MBytes 9.45 Gbits/sec 0 1.68 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.02 sec 11.0 GBytes 9.42 Gbits/sec 49 sender
  • NanoPi R4S - Armbian

    NanoPi R4S
    2
    0 Stimmen
    2 Beiträge
    379 Aufrufe
    FrankMF
    Müsste seit gestern so weit sein [image: 1612720791407-b20f93d2-1719-40c5-afb8-6b4edafa6793-image.png]
  • Mobian - vollverschlüsselt

    Software
    1
    0 Stimmen
    1 Beiträge
    290 Aufrufe
    Niemand hat geantwortet
  • ROCKPro64 - PCIe NVMe SSD installieren

    Hardware
    1
    0 Stimmen
    1 Beiträge
    327 Aufrufe
    Niemand hat geantwortet
  • Debian Buster 10 Release

    Linux
    3
    +0
    0 Stimmen
    3 Beiträge
    409 Aufrufe
    FrankMF
    Da man ja beim Login auswählen kann, mit was die Session startet, war ich doch jetzt etwas neugierig was überhaupt läuft. [image: 1562484643462-img_20190707_092217.jpg] frank@debian:~$ echo $WAYLAND_DISPLAY frank@debian:~$ loginctl SESSION UID USER SEAT TTY 7 1000 frank seat0 tty2 c1 116 Debian-gdm seat0 tty1 2 sessions listed. frank@debian:~$ loginctl show-session c1 -p Type Type=x11 frank@debian:~$ loginctl show-session c1 Id=c1 User=116 Name=Debian-gdm Timestamp=Sat 2019-07-06 22:43:34 CEST TimestampMonotonic=30094837 VTNr=1 Seat=seat0 TTY=tty1 Remote=no Service=gdm-launch-environment Scope=session-c1.scope Leader=1015 Audit=4294967295 Type=x11 Class=greeter Active=no State=online IdleHint=yes IdleSinceHint=1562446130937731 IdleSinceHintMonotonic=346278596 LockedHint=yes Die Installation der Nvidia Treiber macht da wohl einen x11 Desktop raus. Aber auch nicht weiter schlimm, der Wayland lief ja hier überhaupt nicht. Würde mich aber über interessante Links zum Thema freuen