Mediawiki is a free and open source software package written in PHP, developed by the Wikimedia Foundation. Mediawiki runs on many websites such as Wikipedia, Wiktionary and Wikimedia Commons. Mediawiki also known as a wiki engine is software that allows users to create and edit pages via a web browser.
In this tutorial, we will learn how to install and configure Mediawiki on Ubuntu-16.04 server.
A server runing Ubuntu-16.04.
A non-root user with sudo privileges setup on your server.
Before starting, update your system with the following command:
sudo apt-get update -ysudo apt-get upgrade -y
Once system is up-to-date, you will need to install LAMP stack on your server.
Change the ownership of mediawiki directory to www-data:
sudo www-data:www-data -R /var/www/html/mediawiki
Configuring the Database
Default Mariadb installation is not secure, so you will need to secure it first. You can secure it using mysql_secure_installation script:
Answer all the questions as follows:
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
You already have a root password set, so you can safely answer 'n'.
Change the root password? [Y/n] n
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
Remove anonymous users? [Y/n] Y
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] Y
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] Y
- Dropping test database...
- Removing privileges on test database...
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] Y
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
Next, you will need to login MariaDB console and create a Database for the Mediawiki.
You can do this by running the following command:
mysql -u root -p
Enter the password for root user, you should see the following output:
Welcome to the MariaDB monitor. Commands end with ; or g.
Your MariaDB connection id is 106
Server version: 10.0.27-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
Once you are logged in to MariaDB console, create a database and user with the following command:
MariaDB [(none)]> CREATE DATABASE mediawikidb;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.06 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON wikidb.* TO 'user'@'localhost';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
MariaDB [(none)]> exit
Configure Apache for Mediawiki
Once database is configured, you will need to configure Apache for Mediawiki.
So, you will need to create new virtual host file for Mediawiki:
HostPresto will be launching a European point of presence in the coming weeks, specifically in Amsterdam. For customers needing their data located within the EU still please contact support to request migration to this location with ticket subject ‘EU Migration’. We will ensure this is actioned well before the Brexit...
Should the UK leave the EU without a deal, or should a deal be agreed that does not include a provision for .eu ownership by UK entities, it’s highly likely that the EU will revoke any .eu domain names unless you can provide an EU address. While this won’t happen...
If you own a .co.uk domain name and you have not registered the equivalent .uk version, you have until the 25th June 2019 to register the domain and secure your brand. After this date any unregistered .uk domain will enter public availability – meaning anyone can register the domain. You...