Installing mobiki on OpenBSD 5.8

Disclaimer: do this at your own risk. I am not sure I am doing this right. php scares me.

I need/want a small, simple wiki or note-taking tool. TiddlyWiki was overly complex. Desktop applications don't scale easily between numerous rigs. Evernote and PBworks are proprietary. Mobiki, on the other hand, can live on my server and seems very simple, both in terms of code and use.

If this doesn't work out, I will just store all my notes as plain text files that live in ~./notes on my server. Update: that's just what I did mere hours after installing mobiki. mkdir, rm, and vi are just plain easier to work with. Though mobiki is also nice and recommended.

Anyway, here are the steps I took to get mobiki working on OpenBSD:

Download and unzip mobiki.

In the mobiki directory, edit config.php; I took out the Images menu item line, changed the name of the wiki title and author name, and so on. Do not mess with the password field. You'll set it through the website later. Remove .htaccess from the mobiki directory. That's for apache and we're not going to use apache. Clear out the images directory. That's some other dude's stuff. If you're up for it, edit template.html and/or template.css.

Now we need to set up the server to actually host mobiki. Start by installing php-fpm:

# pkg_add php-fpm
Ambiguous: choose package for php-fpm
a   0: <None>
    1: php-fpm-5.4.43
    2: php-fpm-5.5.27
    3: php-fpm-5.6.11
Your choice: 3

Now let's configure /etc/httpd.conf so that httpd will work with php. Your /etc/httpd.conf file should be made to look something like this:

server "default" {
    listen on $ext_addr port 80
    location "/mobiki/" { directory index "index.php" }
    location "*.php" { fastcgi socket "/run/php-fpm.sock" }
}

Now let's tell the system to always start httpd and php-fpm at boot:

# rcctl enable httpd
# rcctl enable php_fpm

And now, to avoid rebooting, let's start them manually:

# rcctl start httpd
# rcctl start php_fpm

And now, let's copy the mobiki folder over to /var/www/htdocs/:

# cp -R mobiki /var/www/htdocs/
# chown -R www:www /var/www/htdocs/mobiki

Now surf over to your site's mobiki directory (e.g., https://www.example.com/mobiki/). If everything worked, you should be prompted to enter a password.

There, mobiki is installed! Possibly -- probably -- sub-optimally, but installed nonetheless.