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.
Labs#
In class we’ll do two top-level tasks:
Install and configure MariaDB
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.
Note
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:
Use
apt search
to find the names of packagesUse
apt install
to install MariaDB (client and server)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:
Use
sudo mysql
to connect asroot
.Introduction to SQL commands:
CREATE
INSERT
SELECT
DELETE
DROP
Create a user
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:
Use
apt search
to find the names of packagesUse
apt install
to install MediaWikiUse
dpkg -L
to find the installed filesExamine Apache’s configuration
Examine the
/etc/apache2
directoryFind the installed URL
Configure MediaWiki
Install and download
LocalSettings.php
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.
Warning
LocalSettings.php
contains passwords! Remove them before posting it to the discussion forum!
You forum post this week should have at least:
Documentation of the packages you installed
Commands to create a user on MariaDB
The location of MariaDB’s database files
A copy of
LocalSettings.php
A screenshot of your wiki