The Wikis help many to publish useful information about the programs. Even in the education sector wikis play an important role in describing detailed information. Therefore, in this article, I will show you how to install MediaWiki on Debian 9.
MediaWiki is an open source application written in PHP. Basically, it allows creating a wiki for our project in a simple way. It is used by many community and noncommunity projects to provide information to its users. Ideal for educational purposes, for example.
In like manner, MediaWiki has an API that developers can use to extend their projects. All this with great community support.
So, let us start to install MediaWiki on Debian 9.
1. Install Apache web server
The first step is to install Apache web server because MediaWiki is a web application. So let us install it.
:~$ su :~# apt install apache2
When the installation is complete, Debian configures Apache to start by default. So now you can check the status of the service.
:~# systemctl status apache2
So, Apache is properly running.
2. Install PHP 7.3
Debian 9 Stretch has PHP 7.0 in its official repositories. It’s a great version of PHP but it’s getting a little out of date. So let’s install PHP 7.3 on Debian 9.
For it, we have a brilliant tutorial that you can follow in this link.
Next, install all the PHP modules required for MediaWiki.
:~# apt install php7.3 php7.3-mysql libapache2-mod-php7.3 php7.3-xml php7.3-mbstring php7.3-apcu php7.3-intl php7.3-gd php7.3-cli php7.3-curl
After that, you can do some extra configuration on PHP. To increase the PHP memory handling capacity. To do it, edit the PHP configuration file.
:~# nano /etc/php/7.3/apache2/php.ini
And make the following changes
upload_max_filesize = 200M memory_limit = 128M
Finally, restart Apache.
:~# systemctl restart apache2
3. Install MariaDB
Now it is MariaDB’s turn. MariaDB is a free and open source database manager. It is very easy to learn but robust in features.
So, let us install it.
:~# apt install mariadb-server
Next, set a root password using the
You will be asked some configuration questions. In my case, I will answer like this: Y, N, Y, Y.
Then, it is necessary to create a new database for MediaWiki. Besides a MariaDB user as well.
:~# mysql -u root -p CREATE DATABASE mediawikidb; GRANT ALL PRIVILEGES ON mediawikidb.* TO 'mediawikiuser'@'localhost' IDENTIFIED BY 'mediawikipss'; FLUSH PRIVILEGES; exit;
4. Install MediaWiki
Now you can install MediaWiki. To do this, you need to download it to the Apache root directory.
:~# cd /var/www/html/ :~# wget https://releases.wikimedia.org/mediawiki/1.32/mediawiki-1.32.1.tar.gz
After that, decompress it.
:~# tar -xfvz mediawiki-1.32.1.tar.gz
Next, remove the downloaded file and rename the generated folder.
:~# rm -r mediawiki-1.32.1.tar.gz :~# mv mediawiki-1.32.1 mediawiki
So, open your web browser and access to your browser to start the installation. For example, http://SERVER_IP/mediawiki/mw-config/.
Then, it will show you a screen where you will see the software requirements and license terms.
Next, configure the database.
Next, choose the database engine.
Next, create the admin account. Scroll down and you have two choise, start the installation now or set some configuration.
In the next screen, you will be able to modify other options such as the sending of mail and the license of the articles.
Next, you can start the installation.
Now, the installation is complete.
Now, the screen shows a message where you have to download a configuration file and place it in the MediaWiki folder to complete the installation.
So, use the scp command on your host computer.
:~$ scp Path_file your-server:/home/your-home/
Then, on the server move it to the MediaWiki root directory.
:~# mv /home/your-home/LocalSettings.php /var/www/html/mediawiki/
Next, come back to your web browser and go to
http://SERVER_IP/mediawiki/ and you will see your wiki.
So, that is it.
Having your own wiki for your projects can be new and useful. Especially if it is a collaborative project where you can provide information from an easy way.
Share this post with your friends.