dienste:bytecluster0002:wiki

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
dienste:bytecluster0002:wiki [27.12.2020 19:55] mape2kdienste:bytecluster0002:wiki [07.03.2025 20:16] (aktuell) – Update to php8.2 mape2k
Zeile 4: Zeile 4:
   * 0.5 GB RAM   * 0.5 GB RAM
   * 2 Cores   * 2 Cores
-  * GB HDD (root-fs)+  * 16 GB HDD (root-fs)
  
 ===== System ===== ===== System =====
Zeile 13: Zeile 13:
 ===== Dienste ===== ===== Dienste =====
  
-  * FIXME+  * Dokuwiki (via NGINX)
  
 ===== Installation ===== ===== Installation =====
Zeile 22: Zeile 22:
  
   - NGINX und PHP-FPM installieren   - NGINX und PHP-FPM installieren
-    * **sudo apt-get install php7.3 php7.3-cli php7.3-fpm php7.3-gd php7.3-xml php7.3-zip nginx**+    * **sudo apt-get install php8.2 php8.2-cli php8.2-fpm php8.2-gd php8.2-xml php8.2-zip php8.2-mbstring nginx**
   - Default-Konfiguration anpassen<file|/etc/nginx/sites-available/default>   - Default-Konfiguration anpassen<file|/etc/nginx/sites-available/default>
 server { server {
Zeile 34: Zeile 34:
  
  server_name _;  server_name _;
 +
 +        # Block Bytespider
 +        if ($http_user_agent ~ (Bytespider|bytedance) ) {
 +                return 403;
 +        }
  
  location / {  location / {
Zeile 61: Zeile 66:
  location ~ \.php$ {   location ~ \.php$ { 
  try_files $uri =404;   try_files $uri =404; 
-                fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; +                fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; 
                 fastcgi_index index.php;                  fastcgi_index index.php; 
                 include fastcgi_params;                  include fastcgi_params; 
Zeile 69: Zeile 74:
 </file>  </file> 
   - Dienste aktivieren und neustarten   - Dienste aktivieren und neustarten
-    * **sudo systemctl enable nginx.service php7.3-fpm.service** +    * **sudo systemctl enable nginx.service php8.2-fpm.service** 
-    * **sudo systemctl restart nginx.service php7.3-fpm.service**+    * **sudo systemctl restart nginx.service php8.2-fpm.service**
  
 ==== Dokuwiki ==== ==== Dokuwiki ====
Zeile 80: Zeile 85:
       * Entpacken in das Verzeichnis /var/www/public_html       * Entpacken in das Verzeichnis /var/www/public_html
       * Datenverzeichnis nach /var/www/data (bzw. ../data)       * Datenverzeichnis nach /var/www/data (bzw. ../data)
 +  - Berechtigungen anpassen
 +    * **chown -R www-data:www-data /var/www/{public_html,data}**
 +  - Cache-Cleanup einrichten
 +    - Cleanup-Skript<file|/usr/local/bin/cleanup_dokuwiki_cache.sh>
 +#!/bin/bash
 +
 +cleanup()
 +{
 +    local data_path="$1"        # full path to data directory of wiki
 +    local retention_days="$2"   # number of days after which old files are to be removed
 +
 +    # remove stale lock files (files which are 1-2 days old)
 +    find "${data_path}"/locks/ -name '*.lock' -type f -mtime +1 -delete
 +
 +    # remove files older than ${retention_days} days from the cache
 +    find "${data_path}"/cache/ -type f -mtime +${retention_days} -delete
 +}
 +
 +# cleanup DokuWiki installations (path to datadir, number of days)
 +cleanup /var/www/data    180
 +</file>
 +    - Cleanup-Skript ausführbar machen
 +      * **chmod +x /usr/local/bin/cleanup_dokuwiki_cache.sh**
 +    - Cleanup-Skript als Cronjob einrichten machen
 +      * **<nowiki>echo -e "0 2 * * *\troot\t/usr/local/bin/cleanup_dokuwiki_cache.sh" | sudo tee /etc/cron.d/dokwiki > /dev/null/<nowiki>**
 +
 +=== robots.txt ===
 +
 +Quelle: https://neil-clarke.com/block-the-bots-that-feed-ai-models-by-scraping-your-website/
 +
 +  - Robots.txt setzen<file|/var/www/public_html/robots.txt>
 +User-agent: CCBot
 +Disallow: /
 +
 +User-agent: ChatGPT-User
 +Disallow: /
 +
 +User-agent: GPTBot
 +Disallow: /
 +
 +User-agent: Google-Extended
 +Disallow: /
 +
 +User-agent: anthropic-ai
 +Disallow: /
 +
 +User-agent: Omgilibot
 +Disallow: /
 +
 +User-agent: Omgili
 +Disallow: /
 +
 +User-agent: FacebookBot
 +Disallow: /
 +
 +User-agent: Bytespider
 +Disallow: /
 +
 +User-agent: ImagesiftBot 
 +Disallow: /
 +</file>
 +  - Berechtigungen anpassen
 +    * **chown www-data:www-data /var/www/public_html/robots.txt**
 +
 +==== Backup mit Borgmatic ====
 +
 +  - Installation siehe [[mariadb]]
 +  - Konfiguration <file|/etc/borgmatic/config.yaml>
 +...
 +location:
 +    # List of source directories to backup (required). Globs and
 +    # tildes are expanded.
 +    source_directories:
 +        - /etc
 +        - /home
 +        - /root
 +        - /usr/local
 +        - /var/log
 +        - /var/www
 +...
 +</file>
  • dienste/bytecluster0002/wiki.1609098905.txt.gz
  • Zuletzt geändert: 27.12.2020 19:55
  • von mape2k