Install MediaWiki#

Over the last three weeks you’ve created a web application on your devbox. The simple application counts visits using file storage. Files storage is fine for very simple applications but will eventually fail under heavy load, corrupting your precious data. This week we are going to install a database management system (DBMS), commonly referred to as a database. The DBMS offers structured storage that supports A.C.I.D. (Atomic, Consistent, Independent and Durable) transactions. Those important properties make it possible for many users to access our application at the same time without risk of data corruption. Every web application that has user-modifiable data and handles any amount of traffic uses a DBMS of some kind.


In class we’ll do two top-level tasks:

  1. Install and configure MariaDB

  2. Install and configure MediaWiki

Those tasks will be broken up into smaller parts in recorded labs. Since these activities are pretty specific to this class there are no written labs to follow.


Upgrade your devbox to an e2-small so it has enough resources to run MariaDB and MediaWiki.

Lab 1: Install MariaDB#

In the first recorded lab we’ll install MariaDB using apt. The basic steps are:

  1. Use apt search to find the names of packages

  2. Use apt install to install MariaDB (client and server)

  3. Use dpkg -L to find the files that are a part my MariaDB

Lab 2: Manage MariaDB#

In this recorded lab we’ll take a tour of MariaDB by connecting to the DBMS and issuing SQL commands. There will be some example commands that are optional but one task is necessary: We have to create a DMBS user for MediaWiki. Here’s a summary of the steps we’ll take:

  1. Use sudo mysql to connect as root.

  2. Introduction to SQL commands:

    1. CREATE

    2. INSERT

    3. SELECT

    4. DELETE

    5. DROP

  3. Create a user

  4. Examine the Maria’s data directory.

Make a note of where MariaDB keeps its data.

Lab 3: Install MediaWiki#

In this recorded lab we’ll install MediaWiki using apt. MediaWiki is easy to install and configure with a little help. Here’s a summary of the steps we’ll take:

  1. Use apt search to find the names of packages

  2. Use apt install to install MediaWiki

  3. Use dpkg -L to find the installed files

  4. Examine Apache’s configuration

    1. Examine the /etc/apache2 directory

    2. Find the installed URL

  5. Configure MediaWiki

    1. Install and download LocalSettings.php

    2. Move LocalSettings.php into the /etc

Keep a copy of LocalSettings.php

Project Documentation#

Your project documentation should focus on the steps you will need to take to recreate MediaWiki. Carefully document the packages you installed and the steps you took to configure MariaDB. The MariaDB documentation need not contain the optional part of the lab but should contain how to connect and run the GRANT SQL command. Your documentation should also include a copy of your LocalSettings.php file.


LocalSettings.php contains passwords! Remove them before posting it to the discussion forum!

You forum post this week should have at least:

  1. Documentation of the packages you installed

  2. Commands to create a user on MariaDB

  3. The location of MariaDB’s database files

  4. A copy of LocalSettings.php

  5. A screenshot of your wiki