How to Install MediaWiki on CentOS 7

r00t December 7, 2017

Install MediaWiki on CentOS 7

In this tutorial we’ll learn how to install MediaWiki on CentOS 7. We will also install and configure its prerequisites. Mediawiki is a free and open source software package written in PHP, developed by the Wikimedia Foundation. Mediawiki runs on many sites like Wikipedia, Wiktionary and Wikimedia Commons. Mediawiki also called a wiki engine is software which permits users to create and edit webpages using a web browser.

I recommend to use a minimal CentOS server setup as a basis for the tutorial, that can be a virtual or a root server image with an CentOS 7 minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.

Install MediaWiki on CentOS 7

Step 1. First, ensure your system is fully up-to-date by running the following:

yum -y update

Step 2. Installing LAMP on CentOS 7.

You should check out this LAMP stack install tutorial for CentOS 7, if you haven’t installed LAMP yet. Once it’s installed, come back here and read on. We also will install the required packages for LAMP stack and the important PHP extension that Mediawiki relies on:

yum install php70w php70w-dom php70w-mbstring php70w-gd php70w-pdo php70w-json php70w-xml php70w-zip php70w-curl php70w-mcrypt

Step 3. Installing Mediawiki.

First, you will need to download the latest version of Mediawiki from here:

wget https://releases.wikimedia.org/mediawiki/1.29/mediawiki-1.29.1.tar.gz
tar -xvzf mediawiki-1.29.1.tar.gz
mv mediawiki-1.29.1/ /var/www/html/

Once it is done, set the owner permission for Apache root directory:

chown -R apache:apache /var/www/html/

Step 4. Configure Database for MediaWiki.

Next, we need to create a database for the MediaWiki installation:

mysql -uroot -p

Run the following command to create a database for MediaWiki:

CREATE DATABASE wikidb;
GRANT ALL PRIVILEGES ON wikidb.* TO 'wikiuser'@'localhost' IDENTIFIED BY 'password';
flush privileges;
exit;

Step 5. Accessing MediaWiki Web Installation.

Now you can access the MediaWiki web install wizard in your browser by entering the domain name or http://your_ip/ to continue your MediaWiki installation.

Install MediaWiki on CentOS 7

Congratulation’s! You have successfully install and configured MediaWiki on your CentOS 7 server. Thanks for using this tutorial for installing MediaWiki open source wiki on CentOS 7 system.

The Tags:

Leave a Comment

Comments are closed.