Installing MediaWiki on Fedora Server

MediaWiki is a powerful open-source wiki engine that is widely used for creating collaborative websites. In this tutorial, we will explain how to install MediaWiki on a Fedora server.

Requirements

Step 1: Update the system

Before proceeding, update the system to ensure that all software packages are up-to-date:

sudo dnf update

Step 2: Install Apache

MediaWiki requires a webserver to function, and Apache is the most popular webserver for Linux systems. To install Apache, run the following command:

sudo dnf install httpd

Once Apache is installed, start and enable it to start at boot time:

sudo systemctl start httpd
sudo systemctl enable httpd

Step 3: Install PHP

MediaWiki is a PHP application, and so you need to ensure that PHP is installed on your server. You can install PHP and its required dependencies by running:

sudo dnf install php php-mysqlnd php-xml php-gd php-intl php-mbstring php-json php-opcache

Once PHP is installed, restart the Apache webserver for the changes to take effect:

sudo systemctl restart httpd

Step 4: Install MariaDB

MediaWiki also requires a database to store its content, and we will use MariaDB for this purpose. To install MariaDB, run the following command:

sudo dnf install mariadb mariadb-server

Once MariaDB is installed, start and enable the database server to start at boot time:

sudo systemctl start mariadb
sudo systemctl enable mariadb

Run the security script included with MariaDB to secure the database server:

sudo mysql_secure_installation

Step 5: Create a database and user for MediaWiki

Create a new database and user for MediaWiki to use. Log in to the MariaDB server as the root user and run the following commands to create a new database and user:

CREATE DATABASE mediawiki;
GRANT ALL PRIVILEGES ON mediawiki.* TO 'wikiuser'@'localhost' IDENTIFIED BY 'your-password';
FLUSH PRIVILEGES;

Replace your-password with your own strong password.

Step 6: Install MediaWiki

Download the latest version of MediaWiki:

wget https://releases.wikimedia.org/mediawiki/1.36/mediawiki-1.36.1.tar.gz

Extract the package to the webserver's document root directory:

sudo tar xf mediawiki-1.36.1.tar.gz -C /var/www/html/

Rename the extracted directory to a more user-friendly name:

sudo mv /var/www/html/mediawiki-1.36.1 /var/www/html/mediawiki

Set the correct permissions for the MediaWiki files and directories:

sudo chown -R apache:apache /var/www/html/mediawiki/
sudo chmod -R 755 /var/www/html/mediawiki/

Step 7: Configure MediaWiki

Open your browser and navigate to your server's IP address or domain name followed by /mediawiki. You will be directed to the MediaWiki installation page.

Select your language, and then configure the database connection by entering the username, password, and database name you created in Step 5.

Follow the prompts to set up the admin account and complete the installation.

Conclusion

Congratulations! You have successfully installed MediaWiki on your Fedora server. You can now create, edit and collaborate on your own wiki pages using MediaWiki.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!