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
Choose the language
Setup check, click on Continue
Define the database
Click on Continue
Define name of administrator account
Click on Continue to finish installation
Installation is completed. Now download “LocalSettings.php” file and place it under the document root (/var/www/domain.name/www)
Now click on enter your wiki
Click on Log In . Enter the Admin Credentials that we have set during the installation.
Your own MediaWiki installation, ready for use.