User Tools

Site Tools


services:dokuwiki

This is an old revision of the document!


DokuWiki

Self-hosted wiki (diese Seite!).

Access

Item Value
URL https://wiki.home.miskam.xyz
Internal https://wiki.srv.internal
Container CT 113
IP 10.100.161.113:80

Installation

# Container erstellen
pct create 113 local:vztmpl/debian-12-standard_12.7-1_amd64.tar.zst \
  --hostname dokuwiki \
  --memory 512 --swap 256 \
  --cores 1 \
  --net0 name=eth0,bridge=vmbr0,tag=160,ip=10.100.161.113/23,gw=10.100.161.254 \
  --features nesting=1 \
  --unprivileged 1 \
  --start 1
 
# Nginx + PHP installieren
pct exec 113 -- bash -c '
apt update
apt install -y nginx php-fpm php-xml php-mbstring php-gd php-intl wget unzip
'
 
# DokuWiki herunterladen
pct exec 113 -- bash -c '
cd /tmp
wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
tar xzf dokuwiki-stable.tgz
mv dokuwiki-*/ /var/www/dokuwiki
chown -R www-data:www-data /var/www/dokuwiki
'
 
# Nginx Config
pct exec 113 -- tee /etc/nginx/sites-available/dokuwiki << 'NGINX'
server {
    listen 80;
    server_name _;
    root /var/www/dokuwiki;
    index doku.php;
 
    location / {
        try_files $uri $uri/ @dokuwiki;
    }
 
    location @dokuwiki {
        rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
        rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
        rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
        rewrite ^/(.*) /doku.php?id=$1&$args last;
    }
 
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php-fpm.sock;
    }
 
    location ~ /(data|conf|bin|inc)/ {
        deny all;
    }
}
NGINX
 
pct exec 113 -- ln -sf /etc/nginx/sites-available/dokuwiki /etc/nginx/sites-enabled/
pct exec 113 -- rm -f /etc/nginx/sites-enabled/default
pct exec 113 -- systemctl restart nginx php*-fpm

Setup Wizard

  1. Admin-Account anlegen
  2. install.php löschen: rm /var/www/dokuwiki/install.php

Configuration

File Purpose
/var/www/dokuwiki/conf/local.php Main config
/var/www/dokuwiki/conf/users.auth.php Users
/var/www/dokuwiki/conf/acl.auth.php Permissions

Management

# Status
pct exec 113 -- systemctl status nginx php*-fpm
 
# Logs
pct exec 113 -- tail -f /var/log/nginx/error.log

Backup

# Flat-file — einfach Ordner sichern
tar czf dokuwiki_backup_$(date +%Y%m%d).tar.gz \
  /var/www/dokuwiki/data \
  /var/www/dokuwiki/conf
services/dokuwiki.1770460812.txt.gz · Last modified: by admin