MediaWiki Setup

From Wiki
Jump to: navigation, search

What's a Wiki

A wiki is software that allows users to create, edit, and link web pages easily. Wikis are often used to create collaborative websites and to power community websites.


For the latest version of MediaWiki you need a Linux server with the following software installed:

  • PHP version 5.0 or later (5.1.x recommended).
  • Some Database Server like ( MySQL 4.0 or later / PostgreSQL 8.1 or later / Ingres 2006 or later)
  • Some web server software like (Apache)

Install MediaWiki

You can get MediaWiki from MediaWiki Download. We are going to install it under the folder wiki in our root apache directory (

# cd /var/www
# wget

Untar the tarball and rename the folder

# tar -zxvf mediawiki-1.11.0.tar.gz
# mv mediawiki-1.11.0 wiki

Change the owner and the group of the downloaded files to the one that apache have rights.

# chown -R apache:apache wiki

Now we should be able to open a web browser and point to our MediaWiki installation:

Configure MediaWiki

The first time we connect to our MediaWiki website we will have the option to set up our environment. Then, MediaWiki will create LocalSettings.php in our wiki/config folder. In order to allow the creation of this file, we need to give write access to the config folder of our Wiki installation.

# cd /var/www/wiki
# chmod a+w config

We will also need to create a database and grant permisions to a user before configuring MediaWiki. In MySql 4.1, we can create the database wikidb and give accesss to the user wiki-user with the password pwd:

# mysql -u root
mysql> CREATE DATABASE wikidb;
mysql> grant create, select, insert, update, delete, alter, lock tables on wikidb.* to 'wiki-user'@'localhost' identified by 'pwd';
mysql> flush privileges;

Then, everything is ready in order to do the first configuration by just pointing with our web browse to our MediaWiki installation:

We will need to fill all the form and submit it.

Finally when the initilization has succeed, we will need to move the configuration File (LocalSettings.php) from the config folder to the root folder of our Wiki installation and remove the config folder:

# cd /var/www/wiki/config
# mv LocalSettings.php ..
# cd ..
# rm -rf config

Advanced Configuration

All the advanced settings can be defined in the file LocalSettings.php. All the settings that can be edited can be found in Configuration Settings


  • deny anonymous edit
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['minoredit'] = false;
  • deny create user
$wgGroupPermissions['*']['createaccount'] = false;

Reset Administration password

# server:/var/www/mediawiki# php5 ./maintenance/changePassword.php --user=Gerard --password=newpassword

External links