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:
- Login to the Client Area;
- Select at the top of menu the "My Services > VPS" tab;
- Press the "Manage" button at the service table;
- Press the "Install OS" button;
- Choose Ubuntu 16.04 operating system, agree with warning and press "Continue";
- Wait for 5-10 minutes and refresh VPS management page.
First things first. Like always, first of all, we recommend to update and upgrade your server.
apt-get upgrade -y
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:
wget to download the latest package:
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:
chmod a+w mw-config
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-mbstringConfiguring
service apache2 restart
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:
rm -rf config
MediaWiki is now successfully installed and configured! Now you have powerful and at same time easy to use wiki engine.