Skip to content

checkmk - Apache2 vs. NGINX

checkmk
2 1 715
  • 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

  • Nextcloud - Update auf 30.0.1

    Nextcloud nextcloud linux
    1
    0 Stimmen
    1 Beiträge
    219 Aufrufe
    Niemand hat geantwortet
  • Debian 12 Bookworm released

    Linux debian linux
    5
    0 Stimmen
    5 Beiträge
    425 Aufrufe
    FrankMF
    Mein persönliches Fazit, alles läuft rund mit Debian Bookworm 12 Alle meine Hetzner VMs sind jetzt auf Bookworm Ok, was schwer und zeitaufwendig war, war die Nextcloud Installation bzw. der ganze PHP-Server. Das ist echt jedes mal eine Herausforderung, aber auch dabei werde ich die letzten Jahre sicherer. Hier die Story zum Nextcloud Server https://linux-nerds.org/topic/1437/nextcloud-upgrade-auf-bookworm-12 Richtig rund lief das Upgrade des NodeBB-Servers, war einfach und direkt auf Node18 hochgezogen. https://linux-nerds.org/topic/1444/nodebb-upgrade-auf-debian-bookworm-12 Damit ist jetzt alles hier auf Debian Bookworm 12 Haupt-PC VMs bei Hetzner VMs in der Proxmox Oh, da fällt mir gerade ein, der Proxmox ist noch fällig. Aber, dazu habe ich mir was einfallen lassen, da ist noch ein neues Mainboard unterwegs und dann gibt es dazu einen etwas größeren Beitrag. Danke Debian-Team, Debian Bookworm 12 ist eine runde Sache! Spannend wird jetzt, wie lange ich auf meinem Haupt-PC (Bookworm, KDE, Wayland) bleibe. Ich habe da so eine unangenehme Eigenschaft, wenn es um veraltete Pakete geht. Diesmal werde ich dann wahrscheinlich auf den Debian Unstable Zweig (sid) wechseln. Aber das dürfte noch was dauern, da ja aktuell erst mal alles passt.
  • NAS 2023 - Hardware

    Angeheftet Verschoben Linux nas linux
    3
    6
    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
  • Debian 11.1 released

    Linux linux debian
    1
    0 Stimmen
    1 Beiträge
    188 Aufrufe
    Niemand hat geantwortet
  • VSCodium

    Linux linux vscodium
    1
    1
    0 Stimmen
    1 Beiträge
    271 Aufrufe
    Niemand hat geantwortet
  • ROCKPro64 - Debian Bullseye Teil 2

    Verschoben ROCKPro64 debian linux rockpro64
    3
    0 Stimmen
    3 Beiträge
    521 Aufrufe
    FrankMF
    Gestern mal das Ganze mit einem Cinnamon Desktop ausprobiert. Eine verschlüsselte Installation auf eine PCIe NVMe SSD. So weit lief das alles reibungslos. Der Cinnamon Desktop hat dann leider keine 3D Unterstützung. Sieht so aus, als wenn keine vernünftigen Grafiktreiber genutzt würden. Da ich auf diesem Gebiet aber eine Null bin, lassen wir das mal so. Außerdem mag ich sowieso keine Desktops auf diesen kleinen SBC. Da fehlt mir einfach der Dampf Gut, was ist mir so aufgefallen? Unbedingt die Daten des Daily Images erneuern, keine alten Images nutzen. Ich hatte da jetzt ein paar Mal Schwierigkeiten mit. Da das ja nun keine Arbeit ist, vorher einfach neu runterladen und Image bauen. Warum zum Henker bootet eigentlich. außer meiner Samsung T5, nichts vom USB3 oder USB-C Port??
  • Rest-Server

    Verschoben Restic rest-server linux restic
    8
    0 Stimmen
    8 Beiträge
    745 Aufrufe
    FrankMF
    Dann mal eben ausprobiert. Auf meinem Server war die Version 0.9.7 selber, mit go, gebaut. Dann mache ich das auch mit der v0.10.0 so. Aber bevor ich anfange, wird die v0.9.7 gesichert. mv /usr/local/bin/rest-server /usr/local/bin/rest-server_0_9_7 So erspare ich mir im Problemfall das selber bauen. Ok, dann die neue Version bauen. git clone https://github.com/restic/rest-server.git cd rest-server go run build.go Danach befindet sich im Verzeichnis die Binärdatei rest-server Die kopieren wir jetzt cp rest-server /usr/local/bin Danach kurzer Test # rest-server --version rest-server 0.10.0 (v0.10.0-6-g037fe06) compiled with go1.11.6 on linux/amd64 Gut Version passt Dann ein Backup gestartet. Das sichert einen Teil meines Home-Verzeichnis Files: 153 new, 100 changed, 177857 unmodified Dirs: 0 new, 1 changed, 0 unmodified Added to the repo: 81.881 MiB processed 178110 files, 80.571 GiB in 0:28 snapshot 607e0027 saved Applying Policy: keep the last 3 snapshots, 3 monthly snapshots keep 5 snapshots: ID Time Host Tags Reasons Paths --------------------------------------------------------------------------------------- fa97890e 2020-07-25 21:02:05 frank-XXX monthly snapshot /home/frank 5b073bbb 2020-08-30 10:17:27 frank-XXX monthly snapshot /home/frank f7cf37ef 2020-09-06 15:13:03 frank-XXX last snapshot /home/frank 0157462c 2020-09-13 13:32:12 frank-XXX last snapshot /home/frank 607e0027 2020-09-14 08:09:34 frank-XXX last snapshot /home/frank monthly snapshot --------------------------------------------------------------------------------------- 5 snapshots remove 1 snapshots: ID Time Host Tags Paths --------------------------------------------------------------------- 3010b7cc 2020-09-06 11:39:27 frank-XXX /home/frank --------------------------------------------------------------------- 1 snapshots 1 snapshots have been removed, running prune counting files in repo building new index for repo [1:34] 100.00% 17351 / 17351 packs So weit funktioniert das genau wie vorher. Im Changelog stand ja was von Subfoldern. Das betrifft mich nicht, weil ich für jeden User genau ein Verzeichnis habe. So mit alles Gut Dann warte ich mal morgen ab, ob die täglichen Backups der Server rund laufen.
  • sign_and_send_pubkey: signing failed: agent refused operation

    Linux linux
    1
    0 Stimmen
    1 Beiträge
    842 Aufrufe
    Niemand hat geantwortet