oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button

Web Apps with Tiger: MediaWiki
Pages: 1, 2, 3

Installing MediaWiki

The first piece of software we're going to install is from a breed called a wiki. Wikis are a relatively ("relatively") new type of software that some folks absolutely hate, some absolutely love, and some think'll be good enough in a few years. According to Wikipedia, the quite popular community created encyclopedia:

A wiki is a web application that allows users to add content . . . but also allows anyone to edit the content. The term Wiki also refers to the collaborative software used to create such a website . . .
Not only is a gargantuan wiki itself (the most well-known today, certainly), it also runs the software we'll be installing. Thus, MediaWiki satisfies our dependence and reputation concerns immediately. The development community can be found on IRC, mailing lists, or their own specific wiki--there's really no easily accessible "end user" friendly place. The readability of the code doesn't make me smile, but that's a subjective opinion anyway, and expandability is possible via extensions. For resources, I've not personally been able to create disastrous loads or heavy memory usage, but your mileage, traffic, and server skills will vary.

At the time of this writing, 1.4.9 is the latest version of the MediaWiki software. 1.5 is currently in release candidate testing, but you should only consider installing that if you're self-sufficient enough to not really need this series of articles. The following assumes an installation of 1.4.9. It also, for the sake of readability, instructs you to install MediaWiki into a subdirectory called wiki. In real life, however, you'd want to name this something that describes purpose, not implementation (see Cool URIs Don't Change). Download MediaWiki to your Desktop, and then run the following commands to create /Library/WebServer/Documents/wiki:

morbus@:~ > cd /Library/WebServer/Documents
morbus@:~ > tar xvzf ~/Desktop/mediawiki-1.4.9.tar.gz
morbus@:~ > mv mediawiki-1.4.9 wiki

Before we move on with the installation, we'll have to create a MySQL database for MediaWiki to use for all our content. Running the following commands (which assume you've set up your environment and root password as instructed in the previous article) will do that for us. Replace the italicized text with your own unique decisions. The middle two commands are word-wrapped, but should each be typed as all one line.

morbus@:~ > mysqladmin -u root -p create wiki_dbname
morbus@:~ >
   mysql -u root -p -e "GRANT ALL PRIVILEGES ON wiki_dbname.*
   TO wiki_user IDENTIFIED BY 'wiki_password'"
morbus@:~ > 
   mysql -u root -p -e "SET PASSWORD FOR
   wiki_user = OLD_PASSWORD('wiki_password')"
morbus@:~ > mysql -u root -p -e "FLUSH PRIVILEGES"

Next, open the wiki/INSTALL file in a text editor, and follow the instructions under "In-place web install." MediaWiki will then be available at The installation wizard is simple enough to not warrant further hand holding; for the "Database config," you'll want to use the database name, user, and password you chose and created in the MySQL commands above. If you don't know what a particular option means, leave it as the default setting.

With the wizard completed, go to the main page of your wiki and create your user by clicking the "create an account or log in" menu item in the upper right. Usernames can contain spaces if you'd like. Alternatively, you can login using the "Sysop" account you created as part of the installation wizard. Once logged in, you'll be returned to the front, and suitably boring, page of your new installation.

As is typical with new software, there's that inevitable, "What next?" If you've never used a wiki before, the most important maxim to take to heart is, you can't screw up, fixes are an edit away. Go ahead and click on that "edit" tab at the top of your main page, and be greeted with a text area with which you can modify the contents, preview, and eventually, save. Every time you change and save a wiki page, a backup is made. Did you screw up or accidentally delete something? You can view the "history" of a page to recover (or re-edit) that missing data, or "rollback" a page to a previous version. A list of recent content changes, as well as specific differences, are accessible from the "Recent changes" link in the "navigation" box on the left.

Most wiki software is shipped with its own Markup: shorthand for the various HTML elements you'd normally use to design your content. Instead of typing <i>eh oh!</i> for italicized text, MediaWiki allows you to use two single quotes instead: ''eh oh!'' (a full list of shorthand possibilities is available). The syntax you'll use the most, [[Some Words]], makes links to other wiki pages. For example, [[Deltab Pains Me]] will automatically create a link to the wiki page named "Deltab Pains Me," whether it exists yet or not. If it exists, clicking the link will show you the article; otherwise, you'll be given a chance to fill it with relevant content.

Every wiki software has a different shorthand, and very few are capable of supporting other formats. This shorthand can actually contribute to a negative mindset: this wiki is hard to use because it doesn't support what I've come to expect elsewhere. MediaWiki is no different: out of the box, it only supports its internal house format. Typing this shorthand is entirely optional; if you prefer using HTML, go right ahead, or use the buttons above the text area to click your way through.

If there's one piece of shorthand you should grow fond of, however, it's --~~~~. This odd looking creature forms a signature that will automatically link your name, user page, and timestamp of your edit, in the form of "--Morbus Iff 02:33, 13 Sep 2005 (EDT)." This becomes very helpful to keep track of who's who during conversation, or simply to keep tabs on the age of the content without running through the page's "history" trying to find the point of origin.

Pages: 1, 2, 3

Next Pagearrow