Install PmWiki

(redirected from Pmwiki.Install)


PmWiki is a simple and lightweight wiki that doesn't require a database. Instead, content for the wiki is stored in simple text files. Its only requirement is PHP, making it very simple to host with OpenBSD's openhttpd. It also does not require the user's browser to support javascript, which helps improve accessibility.


Download a copy of PmWiki. In this guide, we'll grab the latest stable release.

$ ftp
$ tar xvzf pmwiki-latest.tgz
$ doas mv pmwiki-2.3.34/ /var/www/htdocs/
$ doas chown -R www:daemon /var/www/htdocs/

Make sure to replace with your actual domain name. For flexibility, we recommend you run your own nameserver using nsd and create a records for

Configure OpenHTTPd

Before you begin, make sure you have PHP installed.

Next, add a new block to /etc/httpd.conf:

server "" {
	listen on * port 80
        root "/htdocs/"
	location "/.well-known/acme-challenge/*" {
		root "/acme"
		request strip 2
        location "*.php" {
                fastcgi socket "/run/php-fpm.sock"
	directory {
		index "index.php"
        connection max request body 104857600

Lines 7-8 above tell httpd to evaluate any file that ends with .php as a PHP script. Line 9 says that the document root for the web files is /htdocs/ Keep in mind, however, that httpd automatically chroots to /var/www/, so the actual path will be /var/www/htdocs/

Line 11-13 tell httpd to automatically serve index.php as the default file when a directory is requested by the user. In other words, if a user requests, he will actually receive

Line 14 tells httpd that it can receive uploads as large as 100MB. By default, httpd is limited to only 1MB, so this setting is necessary if you want to allow large file uploads for your wiki.

While not required, it helps to put in /var/www/htdocs/

<?php include('pmwiki.php');

Then give it proper permissions:

$ doas chown www:daemon /var/www/htdocs/

Finally, restart httpd:

$ doas rcctl restart httpd

Use your browser to view

To add TLS, you can use either relayd for TLS acceleration (recommended) or openhttpd's TLS.

Configuring PmWiki

Copy the sample configuration file and then edit it:

$ doas cp /var/www/htdocs/ /var/www/htdocs/

Edit /var/www/htdocs/


Make sure you get familiar with the docs. They are located in:


Mirroring Content

When mirroring content, you want to skip the passwords in these two files:


Password Protect Pages

To change the password prompt page, edit Site.AuthForm.

By default, PmWiki allows creation of password hashes using blowfish, so in the command line, you can type:

$ encrypt

You can use these password hashes for

Read user password from file

Please, create passwd file (pass.txt) in the local folder of the pmwiki location and update config.php like this:

$DefaultPasswords['admin'] = pmcrypt(trim(file_get_contents('pass.txt', true)));

Clean URLs

The following URL rewrite rules can provide 'clean' URLs:

        location match "/pub/(.*)" {
                request rewrite "/pub/%1"
        location match "/cookbook/(.*)" {
                request rewrite "/cookbook/%1"
        location match "/uploads/(.*)" {
                request rewrite "/uploads/%1"
        location match "/local/(.*)" {
                request rewrite "/local/%1"
        location match "/favicon.(.*)" {
                request rewrite "/favicon.%1"
        location match "/(.+)/(.+)" {
                request rewrite "/index.php?n=%1.%2?$QUERY_STRING"
        location match "/(.+)" {
                request rewrite "/index.php?n=%1?$QUERY_STRING"

Edit /var/www/htdocs/pmwiki/local/config.php:

$EnablePathInfo = 1;
$ScriptUrl = '';
$PubDirUrl = '';
$UploadDir = "/var/www/htdocs/";
$UploadUrlFmt = "";

Forking IRCNow

To fork the IRCNow almanack:

$ git clone git://

Syncing with Got

Creating the almanack got repo, assuming ~/almanack will be the working directory:

$ openrsync -a --rsync-path=openrsync --exclude config.php --exclude wiki.d/SiteAdmin.AuthUser /var/www/htdocs/ ~/almanack
$ got init /var/git/almanack
$ got import -m "Import sources" -r /var/git/almanack ~/almanack

Delete the copy of the almanack and then check it out:

$ rm -r ~/almanack
$ cd ~/
$ got checkout /var/git/almanack

Then, set up a cronjob as a regular user:

$ crontab -e
@daily       openrsync -a --rsync-path=openrsync --exclude config.php --exclude wiki.d/SiteAdmin.AuthUser /var/www/htdocs/ ~/almanack
@daily       export GOT_AUTHOR="$USER <>" && cd ~/almanack && got commit -m "Daily backup" && sleep 360 && got add -R ~/almanack

Replace $USER and with your real username and email.