Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| dokuwiki_in_nginx [2025/09/14 19:49] – ranslite | dokuwiki_in_nginx [2025/09/14 20:17] (aktuell) – ranslite | ||
|---|---|---|---|
| Zeile 6: | Zeile 6: | ||
| Alle Abhängigkeiten installieren. | Alle Abhängigkeiten installieren. | ||
| <code bash [enable_keyword_links=" | <code bash [enable_keyword_links=" | ||
| - | sudo apt-get install nginx php php-fpm php-curl php-gd php-opcache php-json php-mbstring php-intl php-imagick php-xml -y | + | sudo apt-get install nginx php php-fpm php-curl php-gd php-opcache php-json php-mbstring php-intl php-imagick php-xml |
| </ | </ | ||
| Zeile 19: | Zeile 19: | ||
| Und nginx starten. | Und nginx starten. | ||
| <code bash> | <code bash> | ||
| + | sudo systemctl start nginx | ||
| + | </ | ||
| + | Bei php-fpm auf die richtige Version von php achten.\\ | ||
| + | Die richtige php-Version herausfinden. | ||
| + | <code bash> | ||
| + | php --version | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | sudo systemctl start php8.4-fpm | ||
| </ | </ | ||
| Zeile 49: | Zeile 59: | ||
| </ | </ | ||
| - | Die richtige php-Version herausfinden. | ||
| - | <code bash> | ||
| - | php --version | ||
| - | </ | ||
| Den Serverblock erstellen. | Den Serverblock erstellen. | ||
| Zeile 115: | Zeile 121: | ||
| <code bash> | <code bash> | ||
| sudo systemctl restart nginx | sudo systemctl restart nginx | ||
| + | </ | ||
| + | |||
| + | Jetzt sollte unter [[http:// | ||
| + | \\ | ||
| + | Mit [[http:// | ||
| + | \\ | ||
| + | Im Anschluß die Datei '' | ||
| + | \\ | ||
| + | Nun mit dem certbot ein TLS/SSL Zertifikat erstellen. | ||
| + | <code bash> | ||
| + | sudo certbot --nginx | ||
| + | </ | ||
| + | |||
| + | Abschließend den externen Zugriff auf die Ordner einschränken.\\ | ||
| + | <code bash> | ||
| + | sudo nano / | ||
| + | </ | ||
| + | <code nginx> | ||
| + | |||
| + | location / { | ||
| + | try_files $uri $uri/ @dokuwiki; | ||
| + | } | ||
| + | |||
| + | location @dokuwiki { | ||
| + | rewrite ^/ | ||
| + | rewrite ^/ | ||
| + | rewrite ^/ | ||
| + | rewrite ^/(.*) / | ||
| + | } | ||
| + | |||
| + | location ~ \.php$ { | ||
| + | include snippets/ | ||
| + | fastcgi_pass unix:/ | ||
| + | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
| + | include fastcgi_params; | ||
| + | } | ||
| + | |||
| + | # Verweigert Zugriff auf die Ordner data, conf, bin, inc, vendor | ||
| + | location ^~ /data/ { | ||
| + | return 404; | ||
| + | } | ||
| + | |||
| + | location ^~ /conf/ { | ||
| + | return 404; | ||
| + | } | ||
| + | |||
| + | location ^~ /bin/ { | ||
| + | return 404; | ||
| + | } | ||
| + | |||
| + | location ^~ /inc/ { | ||
| + | return 404; | ||
| + | } | ||
| + | |||
| + | location ^~ /vendor/ { | ||
| + | return 404; | ||
| + | } | ||
| + | |||
| </ | </ | ||