dokuwiki

Written by Michael Cole - January 25th 2016


So first a quick personal update. I'm still feeling pretty good after being in an accident. I have my car back, but it's missing a fog light so I need to take it back in.

With that out of the way bring on the technical stuff. Kind of hard to move on with the web server, although I made great progress. I was able to pretty much migrate my wiki across pretty easily. I just use dokuwiki because I really didn't need any of the complex features of some of the others. As it stores its data pretty much in a single directory and in plain text files that made it a good target to move.

So the first step was to install dokuwiki. This worked out great because FreeBSD has a package. Since dokuwiki really doesn't have a lot of crazy dependencies, or options to do funky things there was no need to recompile with special options.

Next was to copy the data directory over from the old server. It doesn't matter how you do it. Rsync, scp, tar it up, whatever suits your environment. If you don't have existing data that works too, just copy the data directory from the default install. Since I was in a jail, I made a ZFS dataset outside the jail and shared it read/write. Since I new it had a lot of text files I turned on compress for the dataset. It also let me set size limitations (quotas).

Next I copied my users and ACLs. If you don't have those that works too, just run the install.php and setup whatever you need.

Make sure all of your settings are in local.php so they don't get over written. The main important setting to adjust is the "savedir" which should be set to the new data directory location.

Now for some security. Mine was LAN only so not a real issue for me. But make sure to restrict your wiki with the ACL functions built in, block access to certain pages like the install and config with your web server configuration, and anything else you deem necessary. I'm not specifically going to cover that here.

So we aren't all wiki experts including me. Like I said mine was just for LAN use, mainly some technical information and some recipes. I failed to use my wiki properly and just kind of lumped everything together with some index pages. So when I moved it over I decided to setup some proper namespaces. Namespaces are a way to separate content into groups or specific areas. You can limit searches to namespaces which can help, and you can also setup ACLs and permissions on namespaces. So if you want person one to see your recipes but not information about how you setup your mail server, you can do that by page permissions or you can setup a food/recipes namespace and a technical namespace and allow different people into each one. I'm just mentioning that now, because it's easier to setup namespaces from the start.

Links that don't mention namespaces are inside the namespace that the current page is in. I know that sentence is a little confusing, but for a good example of usefulness, pretend you have the tech section and inside that tech section you make a link called pf and you write down your setup of your OpenBSD firewall. That works perfectly fine. Now the link to pf, no matter where in the tech namespace goes to that page. So you add a page for your firewall server information and link to pf and boom it works great. Now you setup a FreeBSD server and it has a different pf rule set. You could just setup sub headings and list all the pf configurations on one page or you could setup sub-namespaces for openbsd and freebsd under the tech namespace. Then each one can have it's own pf page. Maybe this isn't the best example, but I think it gets the point across. You could also have a sub-namespace for each server and then pages like software under each one, with the current software settings. Of course like everything you can go overboard. So watch out for that. But I definitely recommend doing at least a namespace for the top categories.

And before anyone emails saying you can do tons of stuff with dokuwiki. That's true. There are a bunch of plugins. Also the plugins are easy to make. There is a lot fo documentation on it, and lot's of good examples. I like to keep mine pretty simple and only add a few things. I like background colors for some of my tables, and being able to track down dead links is nice as well.

So even thought this wasn't a super in depth post, I think it's enough to get you started if you want to play with a wiki.