DokuWiki

It's better when it's simple

User Tools

Site Tools


install:openbsd

This is an old revision of the document!


DokuWiki on OpenBSD

Installation from the package

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

~$ doas pkg_add dokuwiki

The package manager 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.

First install PHP and a dependency:

~$ doas pkg_add php php-gd

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

To enable the installed PHP package add the symbolic links as root:

# cd /etc/php-7.4.sample
# for i in *; do ln -sf ../php-7.4.sample/$i ../php-7.4/; done

Start up the PHP FPM daemon:

~$ doas rcctl start php74_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 php74_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" 
                request strip 1
                fastcgi socket "/run/php-fpm.sock" 
        } 
        location "/dokuwiki/*" { 
                directory index index.php 
                root "/dokuwiki"
                request 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):

# mkdir /var/www/dev
# mknod /var/www/dev/urandom c 45 2
# mkdir /var/www/etc
# cp /etc/resolv.conf /var/www/etc/
# cp /etc/hosts /var/www/etc/
# cp /etc/services /var/www/etc/
# mkdir /var/www/etc/ssl
# cp /etc/ssl/cert.pem /var/www/etc/ssl/

Note: On OpenBSD 6.9 using the package dokuwiki-2020.07.29p0 the above did not seem to be sufficient to allow DokuWiki access to the plugin and template repositories. The Extension Manager still displays the message: “The plugin repository could not be contacted. Make sure your server is allowed to contact www.dokuwiki.org and check your proxy settings. [Retry]”

install/openbsd.1628596075.txt.gz · Last modified: 2021-08-10 13:47 by fiwswe

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki