Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
| computer:server:stratoserver [2024/01/17 13:35] – removed - external edit (Unknown date) 127.0.0.1 | computer:server:stratoserver [2024/01/17 13:35] (current) – ↷ Page moved from computer:stratoserver to computer:server:stratoserver spring | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Strato-Server ====== | ||
| + | Der Strato-Vserver ersetzt das shared-Webhosting bei webgo | ||
| + | |||
| + | Kunden-Login: | ||
| + | |||
| + | ===== Allgemeine Links ===== | ||
| + | * https:// | ||
| + | |||
| + | ===== Zusätzliche Ubuntu-Pakete ===== | ||
| + | rcs | ||
| + | ===== Dienstprogramme ===== | ||
| + | <file bash / | ||
| + | #!/bin/bash | ||
| + | docker inspect $1 | grep -i ipad | tail -1 | perl -pe ' | ||
| + | </ | ||
| + | |||
| + | Lazydocker von https:// | ||
| + | ===== docker ===== | ||
| + | ==== Installation ==== | ||
| + | |||
| + | Neueste Version installiert entsprechend https:// | ||
| + | |||
| + | Alte Versionen deinstallieren | ||
| + | sudo apt-get remove docker docker-engine docker.io containerd runc | ||
| + | | ||
| + | Neues Repository einrichten, utilities und docker installieren | ||
| + | |||
| + | sudo apt-get install \ | ||
| + | | ||
| + | curl \ | ||
| + | gnupg \ | ||
| + | | ||
| + | sudo mkdir -p / | ||
| + | curl -fsSL https:// | ||
| + | sudo apt-get update | ||
| + | sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin | ||
| + | | ||
| + | ==== Task-Limit erhöhen ==== | ||
| + | | ||
| + | Initialer Wert ist 105, das ist für Docker zu niedrig | ||
| + | Ändern in der Datei ''/ | ||
| + | |||
| + | Neu laden des Limits mit | ||
| + | sudo systemctl daemon-reload | ||
| + | | ||
| + | Siehe auch https:// | ||
| + | |||
| + | ==== / | ||
| + | sudo cat / | ||
| + | numproc | ||
| + | Problem! strato setzt den Grenzwert so niedrig, dass man die theoretische Serverleistung nicht ausschöpfen kann | ||
| + | |||
| + | ==== somaxconn erhöhen ==== | ||
| + | Der mailserver beschwert sich sonst über einen zu niedrigen Wert. Abhilfe | ||
| + | echo 1024 > / | ||
| + | Permanent setzen | ||
| + | sudo vim / | ||
| + | ''' | ||
| + | |||
| + | FIXME Testen, ob der Wert nach dem Boot bleibt | ||
| + | |||
| + | ===== Domainübersicht ===== | ||
| + | ^ Domain | ||
| + | | markus-spring.info | ||
| + | | markus-spring.de | ||
| + | | aberdoch.de | ||
| + | | georg-ritter.info | ||
| + | | babaoskar.info | ||
| + | | roswithaschmitt.de | ||
| + | | constance-spring.de | ||
| + | | lebenswertes-bad-reichenhall.de | -.- | netcup | webgo | | ||
| + | | tauber-spring.de | ||
| + | | bürgerliste-reichenhall.de | webgo | webgo | webgo | ja | | | ||
| + | | buergerliste-reichenhall.de | -.- | netcup | ||
| + | |||
| + | Registrar-Abfrage: | ||
| + | |||
| + | ===== Backup durch hermes ===== | ||
| + | |||
| + | - Public-Key des Backup-docker-Images in /root installiert | ||
| + | ===== UFW ===== | ||
| + | apt install ufw | ||
| + | vim / | ||
| + | ufw default deny incoming | ||
| + | ufw default allow outgoing | ||
| + | ufw allow ssh | ||
| + | ufw allow http | ||
| + | ufw allow https | ||
| + | ufw enable | ||
| + | | ||
| + | Test mit '' | ||
| + | Ergebnis: | ||
| + | Nmap scan report for strato.markus-spring.info (81.169.136.167) | ||
| + | Host is up (0.034s latency). | ||
| + | rDNS record for 81.169.136.167: | ||
| + | Not shown: 994 filtered ports | ||
| + | PORT | ||
| + | 22/ | ||
| + | 80/ | ||
| + | 443/ | ||
| + | 8000/tcp open | ||
| + | 8080/tcp open | ||
| + | 9999/tcp closed abyss | ||
| + | |||
| + | |||
| + | | ||
| + | ===== fail2ban ===== | ||
| + | '' | ||
| + | |||
| + | Siehe auch https:// | ||
| + | |||
| + | ==== sshd ==== | ||
| + | |||
| + | Hierfür reicht die Standardeinstellung in / | ||
| + | |||
| + | ==== postfix ==== | ||
| + | |||
| + | Der interne fail2ban des Docker-Mailservers wird disabled | ||
| + | |||
| + | Seine Aufgabe übernimmt der Host-fail2ban. Damit die Anfragen nicht mehr an die Docker-Container weitergeleitet werden, wird der Ban von der action '' | ||
| + | |||
| + | <file bash / | ||
| + | [sasl-mws] | ||
| + | enabled = true | ||
| + | port = smtp, | ||
| + | filter = postfix-mws | ||
| + | # You might consider monitoring / | ||
| + | # running postfix since it would provide the same log lines at the | ||
| + | # " | ||
| + | logpath = / | ||
| + | datepattern = ^%%b %%d %%H:%%M:%%S | ||
| + | banaction | ||
| + | </ | ||
| + | <file bash / | ||
| + | [Definition] | ||
| + | actionstart = iptables -N f2b-docker | ||
| + | iptables -A f2b-docker -j RETURN | ||
| + | iptables -I FORWARD -p tcp -m multiport --dports 25, | ||
| + | | ||
| + | actionstop = iptables -D FORWARD -p tcp -m multiport --dports 25, | ||
| + | | ||
| + | | ||
| + | | ||
| + | actioncheck = iptables -n -L FORWARD | grep -q ' | ||
| + | | ||
| + | actionban = iptables -I f2b-docker 1 -s <ip> -j DROP | ||
| + | | ||
| + | actionunban = iptables -D f2b-docker -s <ip> -j DROP | ||
| + | </ | ||
| + | |||
| + | ===== logrotate ===== | ||
| + | ===== logwatch ===== | ||
| + | |||
| + | ===== traefik2 ===== | ||
| + | Installiert auf der Basis einer Kopie von hermes, Domain markus-spring.de. Dashboard: https:// | ||
| + | |||
| + | Siehe auch: https:// | ||
| + | <code yml docker-compose.yml> | ||
| + | # $Header: / | ||
| + | |||
| + | # https:// | ||
| + | # https:// | ||
| + | |||
| + | version: ' | ||
| + | |||
| + | services: | ||
| + | traefik: | ||
| + | image: traefik: | ||
| + | container_name: | ||
| + | restart: always | ||
| + | security_opt: | ||
| + | - no-new-privileges: | ||
| + | networks: | ||
| + | - proxy | ||
| + | ports: | ||
| + | - 80:80 | ||
| + | #- 993:993 | ||
| + | - 8080:8080 | ||
| + | - 443:443 | ||
| + | - 9999:9999 | ||
| + | volumes: | ||
| + | - / | ||
| + | - / | ||
| + | - ./ | ||
| + | - ./ | ||
| + | - ./ | ||
| + | #- ./ | ||
| + | # extra Konfigurationen (für z. B. Middlewares) | ||
| + | - ./ | ||
| + | - ./ | ||
| + | command: | ||
| + | - --certresolv.myresolver.acme.storage=./ | ||
| + | environment: | ||
| + | - CLOUDFLARE_EMAIL=m.spring@gmx.de | ||
| + | - CLOUDFLARE_API_KEY=8199b6b1054ca9d95f18df5a4e7a1abf0b232 | ||
| + | labels: | ||
| + | - " | ||
| + | - " | ||
| + | - " | ||
| + | - " | ||
| + | - " | ||
| + | - " | ||
| + | - " | ||
| + | - " | ||
| + | - " | ||
| + | - " | ||
| + | - " | ||
| + | - " | ||
| + | - " | ||
| + | - " | ||
| + | | ||
| + | networks: | ||
| + | proxy: | ||
| + | external: true | ||
| + | </ | ||
| + | ==== Links ==== | ||
| + | ===== Portainer ===== | ||
| + | Installiert entsprechend https:// | ||
| + | Interface: https:// | ||
| + | |||
| + | ===== Wordpress / MariaDB / Redis / Matomo ===== | ||
| + | |||
| + | - Erledigt: | ||
| + | - markus-spring.info von webgo auf markus-spring.de umgezogen | ||
| + | - georg-ritter.info von webgo umgezogen | ||
| + | - Benutzertabelle umgezogen | ||
| + | - notizbuch.aberdoch.de umgezogen < | ||
| + | - vhs-fotogruppe-reichenhall.aberdoch.de umgezogen. Id von 8 auf 5 gewechselt. < | ||
| + | - wp-cron disablen https:// | ||
| + | |||
| + | ==== Users umziehen ==== | ||
| + | Achtung: dafür müssen die keys von webgo umgezogen werden, sonst ist offensichtlich der salt der Passwörter in der users-Tabelle von Wordpress falsch. | ||
| + | |||
| + | |||
| + | ==== Redis ==== | ||
| + | |||
| + | siehe auch https:// | ||
| + | ==== phpmyadmin ==== | ||
| + | |||
| + | Anmelden mit '' | ||
| + | |||
| + | |||
| + | ==== Links ==== | ||
| + | * Einfach: https:// | ||
| + | * Komplex: https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * - | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | |||
| + | ==== Archivierung mit Cron ==== | ||
| + | '' | ||
| + | <file bash> | ||
| + | 5 */12 * * * if [ $(docker inspect -f ' | ||
| + | </ | ||
| + | |||
| + | ==== Backup ==== | ||
| + | mysqldump -h $(dockerip.sh matomo-matomo-db-1) -u root -p<mysql root password> | ||
| + | |||
| + | ==== Pitfalls ==== | ||
| + | mysqldump: Got error: 1045: " | ||
| + | Lösung siehe https:// | ||
| + | docker exec -it CONTAINER_ID bash | ||
| + | then log into mysql as root | ||
| + | mysql --user=root --password | ||
| + | Enter the password for root (Default is ' | ||
| + | ALTER USER ' | ||
| + | |||
| + | ==== ublock überlisten ==== | ||
| + | |||
| + | Neuer Ansatz: https:// | ||
| + | |||
| + | Konfiguriert zufällige Skript- und Variablennamen. Eingesetzt auf markus-spring.info mit folgendem Code: | ||
| + | |||
| + | < | ||
| + | var _paq = window._paq = window._paq || []; | ||
| + | _paq.push([" | ||
| + | _paq.push([" | ||
| + | _paq.push([' | ||
| + | _paq.push([' | ||
| + | (function() { | ||
| + | _paq.push([" | ||
| + | _paq.push([' | ||
| + | var a = document, r = a.createElement(" | ||
| + | r.async = !0, r.defer = !0, r.src = "// | ||
| + | })(); | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | |||
| + | |||
| + | |||
| + | < | ||
| + | |||
| + | Step 1: On your matomo server, create a copy of matomo.js and matomo.php and call them m.js and m.php or whatever you prefer. | ||
| + | |||
| + | Step 2: In the m.js file, find and replace the following strings: | ||
| + | |||
| + | “action_name” = “the_action_name” (since “action_name=” is on a blocklist) | ||
| + | “idsite” = “siteid” (since “idsite=” is on a blocklist) | ||
| + | |||
| + | Step 3: In the m.php file, add the following, right after the opening comment: | ||
| + | |||
| + | if(isset($_GET[' | ||
| + | | ||
| + | if(isset($_GET[' | ||
| + | |||
| + | Step 4: In the WP Matomo plugin, switch to manual editing the tracking code and replace matomo.js and matomo.php with your new file names respectively. | ||
| + | </ | ||
| + | ===== Mail mit docker-mailserver ===== | ||
| + | https:// | ||
| + | |||
| + | Sendmail muss disabled sein, weil sonst port 587 blockiert ist: ''' | ||
| + | |||
| + | UFW muss folgende Ports öffnen: '' | ||
| + | |||
| + | Imap muss unverschlüsseltes Login erlauben, sonst funktioniert Postie nicht (https:// | ||
| + | |||
| + | Siehe auch | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | |||
| + | ==== Testen ==== | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * ptr-record check: https:// | ||
| + | |||
| + | ==== Host-System mails versenden ==== | ||
| + | Configure postfix to send mail | ||
| + | |||
| + | We installed postfix during our basic setup. We will need to configure it so that it does not start smtpd on port 25 since it is already being used by our mailserver container and we want to configure it for relayhost only so that it only forwards it to our MTA. | ||
| + | |||
| + | To disable smtpd from starting with postfix edit / | ||
| + | |||
| + | #smtp inet n | ||
| + | |||
| + | To configure relayhost edit / | ||
| + | |||
| + | mydestination = $myhostname, | ||
| + | |||
| + | relayhost = {mail.domain.name} | ||
| + | |||
| + | Enable and start postfix | ||
| + | |||
| + | sudo systemctl enable postfix | ||
| + | sudo systemctl start postfix | ||
| + | |||
| + | |||
| + | |||
| + | ===== Owntracks ===== | ||
| + | ==== Mosquitto ==== | ||
| + | mqtt.markus-spring.de | ||
| + | Secure-Port in '' | ||
| + | mqtt: | ||
| + | address: ": | ||
| + | |||
| + | Port 8883 muss auch in der UFW geöffnet werden: | ||
| + | sudo ufw allow 8883/tcp | ||
| + | |||
| + | ===== LizMap ===== | ||
| + | ==== Links ==== | ||
| + | ===== Wireguard ===== | ||
| + | ==== Links ==== | ||