Installing Mediawiki on Arch Linux

Mediawiki is a free and open-source wiki software that allows you to create your own wiki. It is widely used by many organizations, including Wikipedia. In this tutorial, we will walk you through the process of installing Mediawiki on Arch Linux.

Prerequisites

Before you begin, make sure that you have the following prerequisites:

Step 1 - Install Mediawiki

The first step is to install Mediawiki software on your Arch Linux system. You can install it by running the following command from the terminal:

sudo pacman -S mediawiki

Step 2 - Configure Apache web server

Mediawiki requires an Apache web server to work. If you have not installed Apache already, you can install it using the following command:

sudo pacman -S apache

Once Apache is installed, you need to enable and start Apache service using the following command:

sudo systemctl enable httpd.service
sudo systemctl start httpd.service

Step 3 - Configure PHP

Mediawiki requires a PHP version greater than or equal to 7.3. To install PHP on Arch Linux, you can run the following command:

sudo pacman -S php php-apache

Once PHP is installed, you need to configure it for Apache. To do this, you need to edit the /etc/httpd/conf/httpd.conf file and uncomment the following line:

LoadModule php7_module modules/libphp7.so

Now, restart the Apache service using the following command:

sudo systemctl restart httpd.service

Step 4 - Setup MYSQL database

Mediawiki stores its data in a MySQL or MariaDB database. If you have not installed MySQL or MariaDB already, you can install it using the following command:

sudo pacman -S mysql

Once MySQL is installed, you need to create a database for Mediawiki. To do this, you can log in to the MySQL server using the following command:

mysql -u root -p

Then, run the following SQL command to create a new database for Mediawiki:

CREATE DATABASE mediawiki;

Step 5 - Configure Mediawiki

To configure Mediawiki, you need to create a configuration file called LocalSettings.php. You can generate this file by running the following command:

sudo mv /etc/webapps/mediawiki/LocalSettings.php{.maintenance,}

Then, edit the LocalSettings.php file and modify the following lines:

$wgDBtype = 'mysql';
$wgDBserver = 'localhost';
$wgDBname = 'mediawiki';
$wgDBuser = '<your mysql user>';
$wgDBpassword = '<your mysql password>';

Replace <your mysql user> and <your mysql password> with your MySQL username and password.

Step 6 - Access Mediawiki

After completing the previous steps, you can access Mediawiki by visiting the following URL in your web browser:

http://localhost/mediawiki

You should see the Mediawiki installation page where you can configure and install Mediawiki.

Conclusion

Congratulations! You have successfully installed Mediawiki on Arch Linux. Now you can create your own wiki and share information with others.

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!