Hamsa K
Editor
4 min read | 3 months 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. Tex Live 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

After download untar 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.

 

 

 

 

 



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