DokuWiki

It's better when it's simple

User Tools

Site Tools


Sidebar

Translations of this page?:

Learn about DokuWiki

Advanced Use

Corporate Use

Our Community


Follow us on Facebook, Twitter and other social networks.

Our Privacy Policy

install:openbsd

DokuWiki on OpenBSD

Installation from the package

To install DokuWiki using the OpenBSD packages use the package manager:

~$ doas pkg_add dokuwiki

The package managers will take care of setting up dependencies and chroot requirements.

Manual installation

The package doesn't do all of this so you should also look at this if you run into problems. The following should be done as the root user.

First install PHP and a dependency:

~$ pkg_add php php-gd

You should be able to choose the newest version of PHP. We will use 7.3 for this example.

To enable the PHP GD package add the symbolic link:

~$ ln -s /etc/php-7.3.sample/gd.ini /etc/php-7.3/

Start up the PHP FPM daemon:

~$ rcctl start php73_fpm

Add the daemon to the list of things started up at boot in the /etc/rc.conf.local file (you might have to create it) by adding it to any existing list like this:

pkg_scripts=pkg1 pkg2 php73_fpm

Once you have PHP working you can go through the generic installation instructions. Pay particular attention to setting up the permissions properly. If you are using the OpenBSD httpd web server you will be setting things to a user of www and group of www.

Httpd configuration

You may want to change your httpd.conf to something similar show below.

server "default" { 
        listen on egress port 80 
        listen on 127.0.0.1 port 80 
 
        location "/dokuwiki/*.php*" { 
                root { "/dokuwiki", strip 1 } 
                fastcgi socket "/run/php-fpm.sock" 
        } 
        location "/dokuwiki/*" { 
                directory index index.php 
                root { "/dokuwiki", strip 1 } 
        } 
}

Alternative configuration with updated syntax (tested on OpenBSD 6.6):

server "default" {
  listen on egress port 443
  root "/dokuwiki"
  directory index doku.php
 
  # Set according to upload_max_filesize and post_max_size in php.ini
  connection max request body 20971520
 
  location "*.php"     { fastcgi socket "/run/php-fpm.sock" }
  location "/data/*"   { block }
  location "/conf/*"   { block }
  location "/bin/*"    { block }
  location "/inc/*"    { block }
  location "/vendor/*" { block }
}  

Allowing outgoing http connections

The OpenBSD web server chroot is fairly restrictive by default. If you want to use things like automatic extension downloading you will need to open things up a bit. This should allow outgoing http and https connections. As root (creating any needed directories on the way):

~$ mknod /var/www/dev/urandom c 45 2
~$ cp /etc/resolv.conf /var/www/etc/
~$ cp /etc/ssl/cert.pem /var/www/etc/ssl/
install/openbsd.txt · Last modified: 2020-05-10 00:41 by bwalzer