User Tools

Site Tools


knowhow_dokuwiki

This is an old revision of the document!


Table of Contents

Dokuwiki

Installation

On the web VM (Debian 12)

  • Install dokuwiki package
  • Modify nginx config off this
  • Restart nginx (TODO nginx knowhow)
  • Add wiki.arf20.com DNS entry (TODO bind howto)
  • Generate certificate for wiki.arf20.com with certbot certonly
  • Add cert to nginx and restart nginx
  • Add user arf20

nginx config

/etc/nginx/sites-available/wiki.arf20.com.conf

server {
        listen 80;
        listen 443 ssl;
        listen [::]:80;
        listen [::]:443 ssl;

        server_name wiki.arf20.com;

        ssl_certificate /etc/letsencrypt/live/wiki.arf20.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/wiki.arf20.com/privkey.pem;

        root /usr/share/dokuwiki;

        access_log /etc/nginx/logs/wiki.arf20.com/access.log;
        error_log /etc/nginx/logs/wiki.arf20.com/error.log;

        index index.html index.php index.htm;

        location ~ ^/lib.*\.(js|css|gif|png|ico|jpg|jpeg|svg)$ {
                expires 365d;   # browser caching
        }

        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 ^/tag/(.*) /doku.php?id=tag:$1&do=showtag&tag=tag:$1 last;  #untested
                rewrite ^/(.*) /doku.php?id=$1&$args last;

                # rewrites "doku.php/" out of the URLs if you set the userewrite
                # setting to .htaccess in dokuwiki config page
        }

        location ~ [^/]\.php(/|$) {
                fastcgi_split_path_info ^(.+?\.php)(/.*)$;
                if (!-f $document_root$fastcgi_script_name) {
                        return 404;
                }

                fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
                fastcgi_index index.php;

                include fastcgi_params;
                fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
        }
}
knowhow_dokuwiki.1743882878.txt.gz ยท Last modified: 2025/04/05 19:54 by arf20