MediaWiki Engine Installing and Configuring

Lawrence
Lawrence

Introduction

MediaWiki is free and open-source wiki software and it is the same software used by Wikipedia. It is fully dynamic and runs on a LAMP stack, taking advantage of the PHP language and the MySQL database backend. With easy installation and configuration, MediaWiki is a good solution when you need a familiar, full-featured dynamic wiki engine.


Requirements

Only requirements are to have user with sudo privileges (root is fine) and Apache, PHP and MySQL installed on your VPS.

Tutorial on how to create new user and grant him sudo privileges can be found here.
Tutorial on how to install LAMP stack (Apache, MySQL, PHP) can be found here.

In this tutorial we will be using Ubuntu 16.04, however you should be able to use all our offered Ubuntu and Debian versions.

In Time4VPS you are able to install Ubuntu 16.04 template really easy and fast, only with few mouse clicks:
  1. Login to the Clients Portal;
  2. Select at the top of menu the "My Services > VPS" tab;
  3. Press the "Manage" button at the service table;
  4. Press the "Install OS" button;
  5. Choose Ubuntu 16.04 operating system, agree with warning and press "Continue";
  6. Wait for 5-10 minutes and refresh VPS management page.

Updating System

First things first. Like always, first of all, we recommend to update and upgrade your server.
apt-get update
apt-get upgrade -y


Installing

To begin, download the latest release of MediaWiki. At this moment (19th May, 2017) latest version is 1.28.2. You can find the download location for the latest release by visiting the MediaWiki homepage.

Go to web accessible DocumentRoot, in our case it is:

cd /var/www/html/

Use wget to download the latest package:

wget https://releases.wikimedia.org/mediawiki/1.28/mediawiki-1.28.2.tar.gz

Decompress the package by using the tar command, as shown below:

tar -xvzf mediawiki-1.28.2.tar.gz 

Move the uncompressed mediawiki-1.28.2 directory into your html/ folder, renaming the directory to mediawiki/ in the process.

mv mediawiki-1.28.2/ mediawiki
The name of the directory beneath the html/ will determine the path to your wiki. In this case, the wiki would be located at mediawiki/.

The config/ directory inside the mediawiki/ directory needs to allow MediaWiki to write to it during the installation process. Change into the mediawiki/ directory and run the following chmod command:
cd mediawiki
chmod a+w mw-config
mbstring extention needed for MediaWiki is a non-default extension. This means it is not enabled by default. You must explicitly enable the module with commands:
apt-get install php-mbstring
service apache2 restart


Configuring

On your broweser go to your_domain/mediawiki and click the “Please set up the wiki first” link. The setup page contains everything you need to complete the installation.

Now proceed with configuration, enter such information as database name, username, and password and so on.


After completing the installation form and submitting it, you will arrive at the “MediaWiki Installation” page. Follow the directions at the bottom and move the config/LocalSettings.php file to MediaWiki’s root directory as instructed:
mv /var/www/html/mediawiki/config/LocalSettings.php ..
Since the LocalSettings.php file will contain your MySQL password, make sure to restrict access to it:
chmod 700 /var/www/html/media/wiki/LocalSettings.php
After moving LocalSettings.php, you can safely delete the /config folder, as per the instructions:
cd /car/www/html/mediawiki/
rm -rf config

Conclusion

MediaWiki is now successfully installed and configured! Now you have powerful and at same time easy to use wiki engine.
Sign In or Register to comment.
© 2013 - 2017 Time4VPS. All rights reserved. Powered by Vanilla
The opinions or views of users on the forum are those of the author and not of Time4VPS.