How to install MediaWiki on CentOS 8 - Image 1

MediaWiki is a free open source wiki software which is written in PHP and allows everyone to create their own wiki sites.

1. Install operating system packages

# dnf install httpd php php-mysqlnd php-gd php-xml mariadb-server mariadb php-mbstring php-json

2. Database configuration

# systemctl start mariadb
# systemctl enable mariadb

Secure MariaDB and log in to it:

# mysql_secure_installation
# mysql -u root -p

Create the database and database user:

> CREATE DATABASE wiki_database; 
> CREATE USER 'wiki_user'@'localhost' IDENTIFIED BY 'PASSWORD';

Grant privileges to newly created DB:

>GRANT ALL PRIVILEGES ON wiki_database.* TO 'wiki_user'@'localhost';
> FLUSH PRIVILEGES;

3. Apache configuration

Create a virtual host

# cd /etc/httpd/conf.d
# nano domain.conf
<VirtualHost *:80>
ServerName www.domain.name
DocumentRoot /var/www/domain.name/www
ServerAlias domain.name
ErrorLog /var/www/domain.name/error.log
CustomLog /var/www/domain.name/requests.log combined
</VirtualHost>

Start Apache and enable it so that will automatically start after a reboot

# systemctl start httpd
# systemctl enable httpd

Create a folder document root where files will be stored.

# mkdir -p /var/www/domain.name/www

Grant permissions

# chown -R apache: /var/www/domain.name

Download the lates MediaWiki

# wget https://releases.wikimedia.org/mediawiki/1.34/mediawiki-1.34.0.tar.gz

Untar the package

# tar zxvf mediawiki-1.34.0.tar.gz

Move files to website folder

# mv mediawiki-1.34.0/* /var/www/domain.name/www

Now Open the web browser type your domain name
Hit the “complete the installation” link
How to install MediaWiki on CentOS 8 - Image 2
Choose the languageHow to install MediaWiki on CentOS 8 - Image 3

Setup check, click on Continue

How to install MediaWiki on CentOS 8 - Image 4

Define the database

How to install MediaWiki on CentOS 8 - Image 5

Click on Continue

How to install MediaWiki on CentOS 8 - Image 6

Define name of administrator account

How to install MediaWiki on CentOS 8 - Image 7

Click on Continue to finish installation

How to install MediaWiki on CentOS 8 - Image 8

Installation is completed. Now download “LocalSettings.php” file and place it under the document root (/var/www/domain.name/www)

How to install MediaWiki on CentOS 8 - Image 9

Now click on enter your wiki

How to install MediaWiki on CentOS 8 - Image 10

Click on Log In . Enter the Admin Credentials that we have set during the installation.

Your own MediaWiki installation, ready for use.