| FOTO | AUTO | EDV | AUDIO |

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Nächste Überarbeitung
Vorhergehende Überarbeitung
edv:woody:dokuwiki [11 03 2025 15 : 03] – angelegt André Reichert-Creutzedv:woody:dokuwiki [15 14 2025 20 : 14] (aktuell) André Reichert-Creutz
Zeile 1: Zeile 1:
 ======DokuWiki====== ======DokuWiki======
 +====== Installation von DokuWiki unter DietPi mit lighttpd und HTTPS ======
  
-=====Plugin sidebar===== +Diese Anleitung beschreibt die minimalistische und optimierte Installation von DokuWiki auf einem DietPi-System.   
-Die neue action.php: Keife störende Sidebar in Admin und Edit+Als Webserver wird '''lighttpd''' verwendet. Die Installation ist rein dateibasiert und kommt ohne Datenbank aus.   
 +Die Absicherung der Verbindung erfolgt über HTTPS mit einem kostenlosen Let's Encrypt Zertifikat. 
 + 
 +===== Voraussetzungen ===== 
 +  * Ein laufendes DietPi-System 
 +  * '''lighttpd''' ist installiert und über Port 80 erreichbar (z.B. via `dietpi-software`) 
 +  * Root- oder sudo-Zugriff auf die Konsole 
 +  * Eine aktive Internetverbindung 
 +  * Ein Domainname, der auf die IP-Adresse des Servers zeigt: 
 +<code>creutz.spdns.de → 192.168.178.3</code> 
 + 
 +===== 1. PHP und benötigte Erweiterungen installieren ===== 
 + 
 +<code bash> 
 +dietpi-software install 89 
 +apt update 
 +apt install php-xml php-gd php-intl php-mbstring -y 
 +</code> 
 + 
 +===== 2. PHP-FPM in lighttpd aktivieren ===== 
 + 
 +<code bash> 
 +lighttpd-enable-mod fastcgi 
 +lighttpd-enable-mod fastcgi-php-fpm 
 +systemctl restart php8.2-fpm 
 +systemctl restart lighttpd 
 +</code> 
 + 
 +===== 3. DokuWiki herunterladen und installieren ===== 
 + 
 +<code bash> 
 +cd /tmp 
 +wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz 
 +tar xvf dokuwiki-stable.tgz 
 +mv dokuwiki-*/ /var/www/dokuwiki 
 +chown -R www-data:www-data /var/www/dokuwiki 
 +chmod -R 755 /var/www/dokuwiki 
 +</code> 
 + 
 +===== 4. Angepasste lighttpd-Konfiguration ===== 
 + 
 +Bearbeiten der Datei **/etc/lighttpd/lighttpd.conf**: 
 + 
 +<code> 
 +server.modules = ( 
 +    "mod_indexfile", 
 +    "mod_access", 
 +    "mod_alias", 
 +    "mod_redirect", 
 +    "mod_rewrite", 
 +    "mod_openssl", 
 +    "mod_fastcgi", 
 +    "mod_setenv" 
 +
 + 
 +server.document-root = "/var/www/dokuwiki" 
 +server.upload-dirs   = ( "/var/cache/lighttpd/uploads"
 +server.errorlog      = "/var/log/lighttpd/error.log" 
 +server.pid-file      = "/run/lighttpd.pid" 
 +server.username      = "www-data" 
 +server.groupname     = "www-data" 
 +server.port          = 80 
 + 
 +index-file.names = ( "index.php", "index.html"
 +url.access-deny = ( "~", ".inc", ".htaccess", "VERSION", "COPYING"
 +static-file.exclude-extensions = ( ".php", ".pl", ".fcgi"
 + 
 +$HTTP["url"] =~ "^/(data|conf|bin|inc)/"
 +    url.access-deny = (""
 +
 +url.rewrite-if-not-file = ( 
 +    "^/_media/(.*)"  => "lib/exe/fetch.php?media=$1", 
 +    "^/_detail/(.*)" => "lib/exe/detail.php?media=$1", 
 +    "^/_export/([^/]+)/(.*)" => "doku.php?do=export_$1&id=$2", 
 +    "^(.*)" => "doku.php?id=$1" 
 +
 + 
 +fastcgi.server = ( 
 +    ".php" => ( 
 +        "localhost" => ( 
 +            "socket" => "/run/php/php8.2-fpm.sock", 
 +            "broken-scriptfilename" => "enable" 
 +        ) 
 +    ) 
 +
 + 
 +$SERVER["socket"] == ":80"
 +    url.redirect = ( 
 +        "" => "https://${url.authority}${url.path}${qsa}" 
 +    ) 
 +
 + 
 +$SERVER["socket"] == ":443"
 +    ssl.engine  = "enable" 
 +    ssl.pemfile = "/etc/letsencrypt/live/creutz.spdns.de/fullchain.pem" 
 +    ssl.privkey = "/etc/letsencrypt/live/creutz.spdns.de/privkey.pem" 
 +    ssl.ca-file = "/etc/letsencrypt/live/creutz.spdns.de/chain.pem" 
 + 
 +    ssl.use-sslv3 = "disable" 
 +    ssl.honor-cipher-order = "enable" 
 +    ssl.cipher-list = "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256" 
 +
 + 
 +server.feature-flags += ("server.h2proto" => "enable"
 +server.feature-flags += ("server.h2c"     => "enable"
 +setenv.add-response-header = ( 
 +    "X-Frame-Options" => "SAMEORIGIN", 
 +    "X-Content-Type-Options" => "nosniff", 
 +    "X-XSS-Protection" => "1; mode=block" 
 +
 +</code> 
 + 
 +===== 5. HTTPS mit Let's Encrypt einrichten ===== 
 + 
 +<code bash> 
 +dietpi-letsencrypt 
 +</code> 
 + 
 +Gib als Domain **creutz.spdns.de** an und folge den Anweisungen.   
 +Nach Abschluss ist HTTPS automatisch aktiv. 
 + 
 +===== 6. DokuWiki im Browser einrichten ===== 
 + 
 +Öffne im Browser:   
 +<code> 
 +https://creutz.spdns.de/install.php 
 +</code> 
 + 
 +Fülle die Felder aus, lege den Admin-Account an und bestätige. 
 + 
 +===== 7. Installation absichern ===== 
 + 
 +<code bash> 
 +mv /var/www/dokuwiki/install.php /var/www/dokuwiki/install.php.bak 
 +</code> 
 + 
 +===== Ergebnis ===== 
 + 
 +  * ✅ DokuWiki läuft unter lighttpd auf DietPi 
 +  * ✅ Zugriff unter **https://creutz.spdns.de** 
 +  * ✅ Keine Datenbank nötig 
 +  * ✅ Ressourcenschonend und abgesichert 
 + 
 +====== Rechte nach Updates automatisch wiederherstellen ===== 
 +nano /usr/local/bin/dokuwiki-fix-perms.sh 
 +<code bash> 
 +#!/bin/bash 
 +DOCU_PATH="/var/www/dokuwiki" 
 + 
 +chown -R www-data:www-data "$DOCU_PATH" 
 +find "$DOCU_PATH" -type d -exec chmod 755 {} \; 
 +find "$DOCU_PATH" -type f -exec chmod 644 {} \; 
 + 
 +find "$DOCU_PATH/data"        -type d -exec chmod 775 {} \; 
 +find "$DOCU_PATH/data"        -type f -exec chmod 664 {} \; 
 +find "$DOCU_PATH/lib/plugins" -type d -exec chmod 775 {} \; 
 +find "$DOCU_PATH/lib/plugins" -type f -exec chmod 664 {} \; 
 +find "$DOCU_PATH/lib/tpl"     -type d -exec chmod 775 {} \; 
 +find "$DOCU_PATH/lib/tpl"     -type f -exec chmod 664 {} \; 
 +</code> 
 +Danach ausführen: <code bash>chmod +x /usr/local/bin/dokuwiki-fix-perms.sh</code> 
 + 
 +---- 
 +====== Plugins ====== 
 +=====Plugin sidebar: Keine störende Sidebar in Admin und Edit ===== 
 +Die neue action.php: 
 <code php> <code php>
 <?php <?php
Zeile 138: Zeile 304:
         $ACT = $saveACT;         $ACT = $saveACT;
     }     }
 +}
 +</code>
 +
 +==== Sidebar positionieren ====
 +die neue style.css:
 +<code css>
 +/**
 + * Extra styles for sidebar template
 + *
 + * @author Christopher Smith <chris@jalakai.co.uk>
 + */
 +
 +/* dokuwiki containers & styles */
 +
 +/* sidebar orientation and position */
 +#sidebar {
 +  width:8%;
 +  margin:0;
 +  padding:0;
 +  position: relative;
 +}
 +
 +#sidebartop {
 +  position: absolute;
 +  top: -17em;
 +  width: 100%;
 +  height: 1.2em;
 +  background: __background_neu__;
 +}
 +
 +.sidebar_inside_left #sidebar {
 +    float:left;
 +}
 +
 +.sidebar_inside_right #sidebar {
 +    float:right;
 +}
 +
 +.sidebar_inside_left .dokuwiki div.breadcrumbs {
 +    float: right;
 +    width: 78%;
 +    padding: 0 1% 0 0.9%;
 +}
 +
 +.sidebar_inside_left .dokuwiki .page, .sidebar_inside_left .dokuwiki .meta {
 +    float:right;
 +    width:77%;             /* also see IE Win fix below */
 +    margin-right: 1%;
 +    margin-left:0;
 +}
 +
 +.sidebar_inside_right .dokuwiki .page, .sidebar_inside_right .dokuwiki .meta, .sidebar_inside_right .dokuwiki div.breadcrumbs {
 +    float:left;
 +    width:77%;
 +    margin-left: 1%;
 +    margin-right: 0;
 +}
 +
 +.sidebar_outside_left #sidebar {
 +    position:absolute;
 +    top:11em;
 +    left:30em;
 +}
 +
 +.sidebar_outside_right #sidebar {
 +    position:absolute;
 +    top:0;
 +    right:0;
 +}
 +
 +.sidebar_outside_left .dokuwiki {
 +    padding-left:21%;
 +}
 +
 +.sidebar_outside_right .dokuwiki {
 +    padding-right:21%;
 +}
 +
 +.sidebar_outside_left .footerinc {
 +    padding-left: 21%;
 +}
 +
 +.sidebar_outside_right .footerinc {
 +    padding-right: 21%;
 +}
 +
 +/* sidebar presentation */
 +/* the following three styles use a faux-column image to place a separating line
 +   between the sidebar and dokuwiku */
 +.sidebar_outside_left .dokuwiki, .sidebar_inside_left .dokuwiki {
 +    background: url(images/sidebar-border.gif) repeat-y 20%;
 +}
 +
 +.sidebar_outside_right .dokuwiki, .sidebar_inside_right .dokuwiki {
 +    background: url(images/sidebar-border.gif) repeat-y 80%;
 +}
 +
 +/* hide the line where it passes through .stylehead */
 +.stylehead {
 +    background: __background__;
 +}
 +
 +/* sidebar contents */
 +#sidebar {
 +    font-size:10px;
 +}
 +
 +#sidebar a {
 +    color: __existing__;
 +}
 +
 +#sidebar a.wikilink2 {
 +    color: __text_neu__;
 +}
 +
 +#sidebar a.wikilink2:hover {
 +    text-decoration:none;
 +    cursor:default;
 +}
 +
 +#sidebar h1 {
 +    font-size:140%;
 +    margin-left: 0px;
 +    padding-left: 2px;
 +    font-weight:bold;
 +    padding-bottom:0;
 +    background-color: __background_alt__;
 +}
 +#sidebar h2 {
 +    font-size:120%;
 +    margin-left: 4px;
 +    font-weight:bold;
 +    padding-bottom:0;
 +}
 +#sidebar h3 {
 +    font-size:120%;
 +    margin-left: 8px;
 +    font-weight:normal;
 +    padding-bottom:0;
 +}
 +#sidebar h4 {
 +    font-size:100%;
 +    margin-left: 12px;
 +    font-weight:bold;
 +    padding-bottom:0;
 +}
 +#sidebar h5 {
 +    font-size:100%;
 +    margin-left: 16px;
 +    font-weight:normal;
 +    padding-bottom:0;
 +}
 +#sidebar .toc {
 +    display:none;
 +}
 +
 +#sidebar .secedit {
 +}
 +
 +/* reduced section indentation */
 +#sidebar div.level1 {margin-left: 2px;}
 +#sidebar div.level2 {margin-left: 6px;}
 +#sidebar div.level3 {margin-left: 10px;}
 +#sidebar div.level4 {margin-left: 14px;}
 +#sidebar div.level5 {margin-left: 18px;}
 +
 +/* IE fixes (hide from IE Mac) \*/
 +
 +* html .page .toc {height:1px}    /* General Dokuwiki fix. IE needs this to always display TOC contents \*/
 +* html pre {width:95%;          /* General Dokuwiki fix - very important for Sidebar. IE needs this to get the overflow:auto style to kick in \*/
 +* html .stylehead {height:1px;  /* Get IE in hasLayout mode to ensure the background covers the whole element \*/
 +
 +* html .sidebar_inside_left .page, * html .sidebar_inside_right .page,
 +* html .sidebar_inside_left .meta, * html .sidebar_inside_right .meta {
 +    width: 77%;                   /* IE needs extra gap to ensure #sidebar & .page float next to each other \*/
 +    overflow-x: auto;             /* IE proprietary property to prevent wide images in wiki page forcing sidebar down below wiki page \*/
 +                                  /* 'overflow-x:auto;' maybe replaced by 'overflow:auto;' to ensure template passes w3c validation \*/
 +}
 +
 +/* (end IE Mac hiding) */
 +
 +/* duplicate standard DW styles with increased specificity to counter some sidebar styles */
 +.sidebar_outside_left .insitu-footnote, .sidebar_inside_left .insitu-footnote {
 +  background-color: __background_other__;
 +}
 +/* counteract some inappropriate DW styling */
 +.sidebar div.dokuwiki #bar__bottom {
 +  margin-bottom: 0;
 +}
 +.sidebar div.dokuwiki p.license {
 +  background-color: __background_other__;
 +  padding-top: 3px;
 } }
 </code> </code>