Hamsa K
Editor
6 min read | 1 month ago

How to Install MediaWiki on Centos 7

Install Mediawiki on centos 7

MediaWiki is a free and open-source wiki application written in PHP.It was originally created for Wikipedia but now everyone can use it.MediaWiki is now used by several other projects of the non-profit Wikimedia Foundation and by many other wikis. MediaWiki is very easy to install does not take much time to complete. Some of the MediaWiki used websites are Wikipedia, Wiktionary etc. MediaWiki also has an inbuilt system for managing images and multimedia files. MediaWiki also supports caching which increases the speed of the website. Thousands of websites are running MediaWiki, including Wikipedia.

Prerequisites:

For mediawiki installation on Linux we must first install Web server (Apache) , PHP and Database ( MySQL / MariaDB ). If they are not installed on your system , please follow our article to install them.

otherwise install below php packages.

############ php 7.2 ##################
rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum -y install yum-utils
yum-config-manager --enable remi-php72
yum install php php-mysql php-pdo php-gd php-mbstring php-xml php-intl texlive
php -v
############# Apache 2.4.6 #############
yum install httpd
systemctl start httpd
systemctl enable httpd
httpd -v
############## mysql 8.0.17 ########################
yum localinstall https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
yum install mysql-server
mysql --version
systemctl start mysqld
grep "A temporary password" /var/log/mysqld.log
mysql_secure_installation
systemctl restart mysqld

Php xml extension is required for mediawiki to run, Php Intl extension, for internationalization support and Php gd for image thumbling. TexLive is installed for adding inline mathematical formulas in wiki page.

Create mediawki db

Login to your database by using following command

[root@centos ~]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.17 MySQL Community Server - GPL
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database mediawiki_db;
Query OK, 1 row affected (0.03 sec)
mysql> create user wiki_user@localhost identified by 'password';
Query OK, 0 rows affected (0.04 sec)
mysql> ALTER USER 'wiki_user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Query OK, 0 rows affected (0.01 sec)
mysql> grant all privileges on mediawiki_db.* to wiki_user@localhost;
Query OK, 0 rows affected (0.04 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
mysql> exit
Bye

Download mediawiki

At the time of writing this latest version is 1.33. you can download latest version from offcial download page.

[root@centos ~]# wget https://releases.wikimedia.org/mediawiki/1.33/mediawiki-1.33.0.tar.gz

once mediawiki was downloaded, then untar it and move to default path like below.

[root@centos ~]# tar -xvzf mediawiki-1.33.0.tar.gz
[root@centos ~]# mv mediawiki-1.33.0 /var/www/html/mediawiki

Now the installation process of MediaWiki has been successfully completed from CLI. You will need to do the rest from the web browser.Now you can access the MediaWiki application by reaching http://ip_address/mediawiki.

you can choose language settings and click on continue,you will get a welcome page of wediawiki.

We hope you are following "How to Install MediaWiki on Centos 7" step by step carefully. The remaining steps will help you to finish the upgrade process..

Again click continue. you will get connect to database page.you can enter database name, user and password details as shown below.

Click continue. You will get a database settings page.you can choose the database engine Innodb or MyIsam. Here I have selected Innodb.

You will get a page to name the mediawiki, and setup the admin account and password fields etc.

click on continue.on next pages you can leave default settings and click on continue and Now you will get a LocalSettings.php file.You need to put that file into /var/www/html/mediawiki (directory root path of mediawiki).otherwise you can copy the contents of the file and create the file again.then installation is completed.

Now you can enter into your mediawiki as shown below.

That's it. You are successfully installed mediawiki on Centos 7 system.



Warning! This site uses cookies
By continuing to browse the site, you are agreeing to our use of cookies. Read our terms and privacy policy