HOWTO: Install DokuWiki on Tiger

The information on this page is outdated and may not be accurate anymore, since I have since developed my own Wiki engine.

Despite running PhpWiki for my main site, I like investigating OtherWikis, and DokuWiki is one of my personal favorites for a simple, no frills documentation manager. Since there is apparently a lot of confusion as to how to get it running on Mac OS X, I decided to install it myself on a virgin Tiger and share my notes.

Update: David Rostenne sent me an update regarding the July 1st version (which moved some things into data), so I changed the pathnames accordingly.

This will install it under your ~Sites folder, and it will be accessible as http://localhost/~your_username/dokuwiki - which should be fine for personal use. Mapping this to the HTTP root and making pretty URLs is a matter of learning a bit more Apache and mod_rewrite, and is beyond the scope of this HOWTO.

Enabling PHP

I have seen umpteen erroneous ways to do this (so many I have an entire HOWTO that covers most recent Mac OS X versions), and I'd like to make it clear that you don't need anything beyond what you get with Mac OS X to get PHP applications running on your Mac, even though the built-in PHP (4.3.10 for Tiger) doesn't have all the latest trendy extensions.

So read this and come back when you're done.

Installing DokuWiki

Unpack DokuWiki into your ~Sites folder, and rename the directory to something a bit more handy:

$ cd ~/Sites
$ tar -zxvf ~/Desktop/dokuwiki-2005-07-01.tgz
$ mv dokuwiki-2005-07-01 dokuwiki

Now set up the base permissions (Apache runs as www in Tiger):

$ cd ~/Sites/dokuwiki
$ touch data/changes.log
$ sudo chown www data/changes.log
$ sudo chown -R www data

Since DokuWiki's autodetection fails in this setup for some reason, set the basedir by editing conf/dokuwiki.php:

$ cat conf/dokuwiki.php | grep basedir

$conf['basedir']     = '/~user/dokuwiki/';

You're done. It should work right away if you visit http://localhost/~your_username/dokuwiki.


Although I don't use DokuWiki much, I expect to spend some time hacking it to suit my tastes, and have a few things I'd like to change:

  • The stylesheet (it's great, mind you, but I like to understand how developers separate content from presentation, and adapting Kubrick to it will be a nice way to figure that out)
  • The editing form (too many GIF buttons)
  • Prettier URLs (if I have time for a suitable recipe to drop into an .htaccess file, I'll publish it here)
  • Remove the data and conf folders from the HTTP tree (it's too easy to snarf single files from those dirs, and it might be a security risk)