DokuWiki

"DokuWiki is a standards-compliant, simple-to-use wiki which allows users to create rich documentation repositories. It provides an environment for individuals, teams and companies to create and collaborate using a simple yet powerful syntax that ensures data files remain structured and readable outside the wiki."

"Unlimited page revisions allows restoration to any earlier page version, and with data stored in plain text files, no database is required. A powerful plugin architecture allows for extension and enhancement of the core system. See the features section for a full description of what DokuWiki has to offer."

In other words, DokuWiki is a wiki written in PHP and requires no database.

Initial notes

DokuWiki should work on any web server which supports PHP 5.6 until 7.4.x. As the requirements may change over time, you should consult the requirements page for DokuWiki for additional details.

It is strongly recommend to read through the appropriate sections of DokuWiki's security page for your web server. Most popular web servers are covered but there are generic instructions as well.

The package in the official repositories unpacks DokuWiki at /usr/share/webapps/dokuwiki with the configuration files in /etc/webapps/dokuwiki and the data files in /var/lib/dokuwiki/data. It also changes the ownership of the relevant files to the "http" user. This should work fine for most popular web servers as packaged for Arch.

Installation

  1. Install your web server of choice (e.g. Apache HTTP Server, nginx or lighttpd) and configure it for PHP. As mentioned above, DokuWiki has no need for a database server so you may be able to skip those steps when setting up your web server.
  2. Install the dokuwiki package.
  3. Configure web server for dokuwiki (see section below)
  4. With your web browser of choice, open http://<your-server>/dokuwiki/install.php and continue the installation from there. For nginx the URL is http://<your-server>/install.php.

Alternatively, if you would like to install from tarball, you can read from https://www.dokuwiki.org/Install. Generally the procedure is the same as above. Instead of using pacman, you will need to download the tarball, unpack it to your server's document root (e.g. /srv/http/dokuwiki), and chown to the appropriate user (e.g. "http").

Configuration

If you use PHP's open_basedir, you need to include the dokuwiki directories /etc/webapps/dokuwiki/ and /var/lib/dokuwiki/. For example:

/etc/php/php.ini
open_basedir = ''<other paths>'':/etc/webapps/dokuwiki/:/var/lib/dokuwiki/

Also uncomment the following line.

/etc/php/php.ini
extension=gd

Dokuwiki needs this library for resizing images.

Then check that you have php7-gd installed and restart php-fpm7.service.

Apache

The package should add the file with the following contents:

If you are running Apache 2.4 or newer, you will have to change the following lines: to read:

Include the newly created file in the Apache configuration by placing the following line at the end of /etc/httpd/conf/httpd.conf:

Include conf/extra/dokuwiki.conf

Make sure the folders /etc/webapps/dokuwiki and are owned by user and group "http". You may relocate these directories if you like as long as you update the references in respectively. You should keep the reference to /var/lib/dokuwiki/ for DokuWiki to find the plugins and tpl folder.

Afterwards restart Apache.

Then finish the installation by running the dokuwiki/install.php script in your browser.

lighttpd

Edit the file as per the dokuwiki instructions (might contain updated information).

Make sure the modules and are loaded. If not, load them by adding the following to :

provides the  command, which we are using from this point.

Under the line:

add this:

These entries give some basic security to DokuWiki. lighttpd does not use .htaccess files like Apache. You CAN install with out this, but I would NEVER recommend it.

Add alias somewhere in lighttpd or fastcgi conf file:

alias.url += ("/dokuwiki" => "/usr/share/webapps/dokuwiki/")

Restart lighttpd.

nginx

Ensure that is installed and started.

Add the following server block, but change the server name to your own and comment out the install.php block until you are done installing DokuWiki. This block assumes you use TLS.

/etc/nginx/nginx.conf
    server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        server_name wiki.example.com;
         
        root /usr/share/webapps/dokuwiki;
        index doku.php;

        #Remember to comment the below out when you are installing DokuWiki, and uncomment it when you are done.
        location ~ /(data/|conf/|bin/|inc/|install.php) { deny all; } # secure Dokuwiki

        location ~^/\.ht { deny all; } # also secure the Apache .htaccess files
        location @dokuwiki {
            #rewrites "doku.php/" out of the URLs if you set the userewrite setting to .htaccess in dokuwiki config page
            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 / { try_files $uri $uri/ @dokuwiki; }
        location ~ \.php$ {
            try_files $uri =404;
            fastcgi_pass unix:/run/php-fpm7/php-fpm.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
        }

    }

Restart nginx.

Enable upload and displaying of SVG files

DokuWiki supports SVG files but has them disabled by default.

If you wish to enable them, create the following file:

This has security implications - see here

Post installation

Cleaning up

After configuring the server either remove the install.php file or make sure it is made inaccessible in your webserver configuration!

 # rm /usr/share/webapps/dokuwiki/install.php

Installing plugins

Many community created plugins can be found here

They can be added through the web interface (as well as updated) through the Admin menu. Some plugins cannot be downloaded, if they go over ssl (e.g. git).

Backing up

It is very trivial to backup DokuWiki, since there is no database. All pages are in plain text, and require only a simple tar, or rsync.

A quick breakdown of the directories of interest in the current (20180422_a-1) version:

 /usr/share/webapps/dokuwiki/data/  =>  All User Created Data
 /usr/share/webapps/dokuwiki/conf/  =>  Configuration settings

This may change in future releases, please consult the DokuWiki Backup FAQ for verification.

Further reading

The DokuWiki main site has all of the information and help that you could possibly need.

gollark: You're entirely missing the point.
gollark: Presumably they still use Java 8.
gollark: Yes, that.
gollark: No, that's silly, those would be handled by Java or something.
gollark: Maybe it's an issue with newer HTTPS certificate authorities?
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.