Knowledge Base

Install Mediawiki

This guide will explain how to install MediaWiki v1.7.1 on your ASO account. You will be using SSH (shell), enabled by default, and raw Linux commands for this guide.

Getting Everything Ready

Let's go ahead and get our files together and organized. Login to your account via SSH. This guide assumes that you are installing Mediawiki in a subdirectory of your website. If you are not, some directions will be different for you. Let's go ahead and get the tarball. Make sure you are in your public_html directory and execute the following:

 wget http://superb-east.dl.sourceforge.net/sourceforge/wikipedia/mediawiki-1.7.1.tar.gz
tar -zxvf mediawiki-*.tar.gz
rm mediawiki-*.tar.gz

That should have created a folder in public_html called mediawiki-1.7.1. We should probably change that:

mv ./mediawiki-1.7.1 ./*foldername*
cd *foldername*

Replace 'foldername' with the new name that you want (wiki is good). One more step... we have to make the config directory writable just until we finish installation:

chmod a+w config

Now that are files are all setup, we should move on to the database.

Setting Up Our Database

  1. Log into your cPanel and click the MySQL Databases link

  2. Scroll down to the New Database input box and enter the name for your new database

  3. Click Create Database

    If all goes well, you should see a page telling you that 'ASOusername_databasemame was created'. Of course, ASOusername is your ASO Username, and databasename is the name you entered in the input box. Before Mediawiki can access the database, it needs a user.

  4. Return to the MySQL Databases page

  5. If you already have a global user created (mine is called main), you can just scroll down to Add Users To Your Databases

  6. Choose your user and then the new database you just created, and click Add user to database

  7. If you don't have a user created yet, scroll down to Current Users, enter a username and a password

  8. Click Create User then follow the steps for adding a user to the database

The Actual Install

Everything should be ready now. All we have to do is run a Mediawiki installation script:

  1. Navigate to your MediaWiki directory

    You should see a page that says Please setup the wiki first. Click setup the wiki. Whew... lots of input boxes! There are too many for me to explain them all, and most of them have descriptions.

  2. Make sure you use your database settings that we set up in Setting up our database

  3. Leave Superuser account and Superuser password alone, unless you are on a VPS or Dedicated Server

Final Steps

We aren't quite done yet! We have to do some cleanup before we can start editing our new wiki. Execute the following commands via SSH (make sure you are in your MediaWiki directory):

cp config/LocalSettings.php ./ rm -Rf config

And we should stop our LocalSettings.php file from being readable, since it contains passwords...

chmod 600 LocalSettings.php

... andddd done! That's all there is to it! Now you can enjoy your brand new MediaWiki installation!


Install on a Subdomain

There are a few extra steps we must do if you are installing MediaWiki under a subdomain. Just add the following line to LocalSettings.php:

$wgServer = "http://subdomain.yoursite.com";

Also, change:

$wgScriptPath = "/*foldername*";


$wgScriptPath = "";

MediaWiki should now work on a subdomain.

Install on 1.9+ with Shared Hosting Plan

When installing Mediawiki 1.9+ you may run into this error: "zend.ze1_compatibility_mode is active"! This option causes horrible bugs with MediaWiki; you cannot install or use MediaWiki unless this option is disabled."

If you have access to your php.ini file, you can turn of the zend setting there, however on shared hosting plans, you can not do this, and you will need to disable it from the script. Luckily, many of the settings in the php.ini can be bypassed using ini_set()

When installing, you can add the following to the top (after <?php) of /config/index.php:

ini_set('zend.ze1_compatibility_mode', '0');

AFTER INSTALLING, you MUST to delete this line from the page, and insert it into your LocalSettings.php, again at the top (after <?php). If you do not, you will see really weird errors when <nowiki> </nowiki> tags are used.

Did you find this article helpful?

* Your feedback is too short