IT:Creating a wiki

From Stiki
Jump to: navigation, search

This documents the steps taken in setting up this wiki in January 2009, both to act as a memory aid for me and to help in installations for other people.

Choosing MediaWiki

I chose to use MediaWiki because it has excellent functionality, is free, is supported, and has an extensive community (with numerous extensions allowing customisation). I believed that the technical aptitude required to perform the installation was within my capabilities (even though I had never used Apache, PHP, MySQL or phpMyAdmin before); mainly due to the level of documentation available for MediaWiki. And the relatively large size of the installation (31.2 MB for version 1.13.2) was small compared to the amount of available space on my website.

Alternative wiki software packages exist (some requiring just a single page to be placed in your web space, with no database set up). For an excellent comparison of many different wiki software packages, see

Loading MediaWiki

The files are available from MediaWikiWiki:Download, in a .tar.gz archived format only.

  1. Save the files to your local computer.
  2. Extract the files and directory structure.
  3. Upload the files, in their directories, to your web space.

Due to the large number of files to be uploaded (1350 files and 51 folders in version 1.13.2) you'll want to use some type of FTP software to upload the files in one action.

Naming the directory

Note that at this stage you should choose what to name the subdirectory that contains your wiki software files. Specifically this should not be the folder name that you want to be displayed when the wiki is running. This is because you will want to "prettify" the URI.


looks better than this:

(although they both work).

The shorter URL must be a different directory to the one where the files are actually stored, since redirection is used to remap where the path points to (see below). So knowing that I wanted the visible directory to be "stiki", I placed the files in a folder called "wiki".

You should not redirect your wiki to look this:

This is due to various problems that can occur due to any file requests to that domain being treated as wiki page requests. In particular the files robots.txt and favicon.ico may not be handled correctly.

If you really want a short URI, just use a single letter for the directory:

For more information on this subject, see MediaWikiWiki:Manual:Short URL.

Required additional software

MediaWiki had the following requirements at the time:

  • A web server (such as Apache)
  • PHP version 5.0 or later
  • A database server (such as MySQL version 4.0 or later)
  • Recommended: software for administering the database server (such as phpMyAdmin for MySQL)

For the current requirements see MediaWikiWiki:Installation#Requirements.

Web server

My website is hosted at 1&1. Paying for professional hosting ensures that I have continuity without having to run hardware myself, the website is fully supported, and there are no unwanted advertisements. They provide the web server: requirement satisfied.


I was all set to create an installation of PHP myself, and researched and downloaded a copy of PHP. That all turned out to be unnecessary because 1&1 (currently) provide PHP 4 and 5 as standard on all of their hosting packages bar the "1&1 Beginner". I was on the "1&1 Home" package: requirement statisfied.

Database server

Setting up a database server myself was beyond the scope of my plans. The "1&1 Home" package had no database support either. But upgrading to the next package up ("1&1 Business") provided two MySQL databases up to 100MB each in size (plus assorted other benefits that weren't particularly material to me at the time). So I upgraded (taking the opportunity to transfer payment of the hosting fees to my company account): requirement satisfied.

Additionally their database support already included phpMyAdmin, as recommended by MediaWiki. Excellent!

Creating a database for a 1&1 account is very straightforward:

  1. From the Adminstration Control Panel (that appears when you log in to your account) scroll down to the "Web Space & Access" section and select "MySQL Administration".
  2. In the "MySQL Configuration" section, click on "New Database" at the top of the table (if you've not set up any databases yet, the table will be empty).
  3. The "MySQL Database Setup" form has only two questions:
    • The description of the new database is just the name used to refer to it (such as, say, "wiki").
    • At the time I set up my database there was a choice between MySQL versions 4.0 and 5.0. They are both stable versions, so I chose 5.0 as it's more recent.
  4. Keep a note of the details that are then returned as they are needed for completing the installation of the wiki software. Specifically, you will require the database name, host name, user name, and password. All of these are available from the 1&1 account data at: Administration > Web Space & Access > MySQL Administration.
  5. It then takes a minute or two for the database to be created and set up. You're now ready to complete the installation!

Note that if you have root access to the database server (which you won't if you're on a hosted web server) then the MediaWiki installation script can create a new database itself.

Installing MediaWiki

  1. Using a web browser, navigate to the location of your wiki software files on your web site.
  2. You should be shepherded into the installation questionnaire. I got an error message first saying, "PHP 5.0.0 or higher is required. If PHP 5 is available only when PHP files have a .php5 extension, please navigate to index.php5 to continue installation. ABORTING.". But clicking on the link (taking me from 'index.php' to 'index.php5') displayed the questionnaire correctly.
  3. Then fill in all of the fields depending on how you want to set up your wiki. In particular you'll need information on the database as mentioned above (the host name, database name, user name, and password).
  4. If all goes well, this will complete the installation (give it a minute or two to finish setting up the files).
  5. Error messages usually contain some useful information, so read them carefully and fix anything that you can identify as incorrect. Details on filling in this questionnaire can be found at MediaWikiWiki:Manual:Config script.

Your wiki should now be active!

Customising settings

There are many different settings you can change in order to get your wiki working just as you want it. Most of these involve editing the file "LocalSettings.php" that is stored in the your wiki's root directory. To change this file you will probably need to download it to your computer, edit it as required, then upload the edited file back into your web space, before finally testing that your changes were successful.

Note that "LocalSettings.php" is a text file and can be edited with any text editor except for Notepad. This is because Notepad does not cope correctly with extended character sets and so will corrupt the contents of PHP files (you'll see that it doesn't even display the line breaks correctly). If you're using Windows, you can use WordPad instead, which will not cause this problem. Do not use Notepad for editing any PHP files!

See IT:Customising a wiki for details on the setting that I have used on this wiki.