Setting Up Your Local MediaWiki Environment


If you followed my post from last week (The Non-Programmer’s Guide to Setting Up a Wiki), you now have a wiki up and running. That was cool, but now what? If you’re ready to stretch your html and css skills you can make the wiki your own by creating your very own skin.

Before you start to skin your wiki, it’s important to set up a development environment. It’s easy to break skins, so you’ll want to test any changes that you make before you move them to your live site. I’m a Windows person, so I’ll be describing how to set things up on a Windows machine, but wiki skin development can be done on a variety of platforms, including Linux and Mac.

Here we go…

Before you try to install the MediaWiki software, you’ll need to have Apache (webserver), MySQL (database), and an interpreter for PHP installed on your computer. There are packages out there that make the whole thing surprisingly easy. The two that I tried were XAMPP and WAMP. Both of these packages were very easy to install. All you need to do is follow the install procedure. That’s it.

What are the differences between the two packages? I personally liked the WAMP interface a lot better than the XAMPP, but WAMP didn’t play nicely with Skype, which I use for instant messaging and chatting, so XAMPP won out in the end. Hint: Shut Skype off before you start Apache – they both try to use port 80. After Apache has been started, you can start Skype and it will take another port.

OK – you’re now ready to install the MediaWiki. You can download the latest version from here. If the version of the Mediawiki you’re using on your site is not the latest version, find your version here, and download that instead.

The file that you are downloading is a zip file. If you are using XAMPP, create a folder in the xampp/htdocs directory named wiki. In WAMP, create the wiki folder in the wamp/www directory. Unzip the MediaWiki files into that directory.

Now the fun begins…

By unzipping the MediaWiki file, you essentially installed the MediaWiki. Now it’s time to configure it. Make sure to have XAMPP or WAMP running. Go to http://localhost/wiki. You should be seeing a screen that asks you to set up your wiki. The MediaWiki walks you through installation. Stick with the defaults. This is not a wiki for public consumption so there’s no need to worry about copyright and things like that.

When I created my wiki, I let the MediaWiki create the database for me. The initial install failed and I added a username and password to the new database that it created for me. If you decide to go this way, you’ll need to go into XAMPP or WAMP and modify the user to have a password – when MediaWiki creates the user, it leaves the password blank, which is a no-no for installing.

If you want to circumvent the whole database issue, you can create your database through WAMP or XAMPP before you start the MediaWiki installation. Don’t forget what username and password that you decided to use because you’ll need it for the MediaWiki configuration.

Next – move the LocalSetting.php file from your config directory to your root directory. That’s it. You’re done with your local installation and ready to get to work. You can make your development environment more robust as I will explain in a post to follow.