I’m not new to wikis having contributed to Wikipedia and others, but I have never installed and run one of my own. I looked at different wiki software and decided on mediawiki for two main reasons. It’s nice that it runs on PHP/MySQL and is commonly used but my main interest is that:

  1. I consider mediawiki to be “best of breed”. After all it is what runs Wikipedia, the number 1 wiki on the net. It is used by many organizations and thus, at least in theory, should have more support and better modifications.
  2. There are several articles showing how to use the same authentication database for both mediawiki and vBulletin (or phpBB). This means that users only need to create an account on one system and can authenticate to both the wiki and the forum software. (I don’t know if this permits mediawiki and vBulletin to share cookies — in fact I highly doubt it, but single-sign-on is still a nice feature.)

Installing MediaWiki

My problems began when I first installed mediawiki. The install instructions on the mediawiki site are a wiki themselves, which should be intuitive but is actually very confusing. The README file included with the mediawiki software has more concise instructions than on the website.

It should also be noted that when you google for “mediawiki install” the first site you find links to a home user account detailing their experience with installing mediawiki — not a reassuring fact. Here they tell you the crucial information that you need to move the LocalSettings.php file into the root directory and edit the $wgScriptPath variable to match the directory name your wiki was installed to (i.e. “/wiki/” or “” for the root).

A side effect of setting the $wgScriptPath variable is that you cannot use multiple URLs for your wiki. For example if your wiki is in a directory “/home/user/website.com/wiki” then you need to set the variable to “/wiki” so it will show online as: http://website.com/wiki/

If you want another URL to map to the same directory such as http://websitewiki.com/ you need to set the variable to “” (blank) because it points to the root of this domain. This means you cannot have different domain names mapped to the same directory because the wiki software is hard coded based on the directory it resides on. Egads! (This was later solved with the creative use of sub-domains.)

None of this information can be found on the mediawiki website (or other websites) and is something I had to figure out on my own.

Performance of MediaWiki

Another thing you don’t learn about mediawiki until you install it is that it runs slower than a turtule with a millstone around its neck. I have found several reports online of it taking up to 20 seconds to load the main page. My personal experience on a clean and new install of mediawiki is that it takes between 15-25 seconds to load the main page. This is entirly unacceptable.

I searched and found that many people need to install MMcache, which was depricated by eAccelerator, to make mediawiki run with any reasonable response rate. Now on a dedicated, single-site hosted machine this may not be a problem, but I host my site on a shared server (i.e. Dreamhost) and don’t have the luxury of installing these tools just to make a wiki work.

Turns out people have installed eAccelerator into their Dreamhost account. The problem is this required you enable FastCGI on the domain within Dreamhost, which requires more hacking of all your PHP files. *whew* Reading the install link above you see the following: “you should build your own php, because to load eAccelerator, we must modify php.iniThis means you need to install PHP, then eAccelerator, then mediawiki into your home directory just to install a wiki! (Of course there is a “how to compile PHP on Dreamhost link, but you should never have to go this far.)

The Dreamhost Wiki has an article on mediawiki, but none on MMcache or eAccelerator. There is plenty of information there about how to install and configure your mediawiki install on Dreamhost.

Spam

The Dreamhost site really skimps on the need to configure the plethora of anti-spam settings. Here’s a link to the site I used, which is very thorough. If you do not address this your wiki will be a nest for spammers (even though the rel=nofollow is set.. duh!)

Pretty URLs

Creating friendly URLs is not a friendly process at all.  You need to be ready to use mod_rewrite to eliminate the “index.php?title=article” and replace it with “article”.  Learn how to (re)write friendly URLs.  Again, not so much a problem if are not on a shared hosting environment.

Summary

This entire experience has taught me that I’ll need to find a colo for my wiki (and probably the rest of my sites.)  Setting up mediawiki is no easy task and can put a heavy load on your server.  In order to run it properly you really need access to the server and config files.  Installing it on a shared hosting environment requires too much hacking around to make it work.

Also, don’t forget to install the numerous anti-spam features and practice spending time in the administration tools.  Running a wiki requires a different frame of mind with the various types of pages and meta tags.

Advertisements