Mediawiki software - installation notes

Uit MakerSpace Leiden
Ga naar: navigatie, zoeken
Deze pagina is een vertaalde versie van de pagina Mediawiki software - installatienotities en de vertaling is 100% compleet.

Andere talen:
English • ‎Nederlands

From summer 2018 onwards, the mediawiki package and installation is not managed by apt anymore but manually. This to have more fine grained control over the versions we run at makerspace.

Locations of the software

  • The apache2 document root for mediawiki is /var/lib/mediawiki. This directory mainly contains symbolic links to files in /usr/share/mediawiki, but also some hard data, like the images, cache, uploads and config directories with user generated files.
  • /usr/share/mediawiki is a link itself, it points to /usr/share/mediawiki-<version>, where the real software is located. At this moment this is /usr/share/mediawiki-1.31.0.
  • These version specific directories contain symbolic links from LocalSettings.php to /etc/mediawiki/LocalSettings.php. Also, /etc/mediawiki contains a backup copy of Apache2's gloval config file mediawiki.conf.
  • These version specific directories also contain the extensions used (i.e. MLEB, see below).

Extensions

The only additional extension used (besides the standard package installed by default) is the 'multi language extension bundle' (MLEB). This extension (set) enables multiple languages and translation workflow in the mediawiki.

Updating mediawiki

Backing up

System backup

sudo /etc/duplicity/run.sh

Database backups

Create backups in sql en xml: mysqldump -h localhost -u mediawiki -p --default-character-set=utf8 mediawiki --single-transaction > mediawikibackup.sql

mysqldump -h localhost -u mediawiki -p --xml mediawiki --single-transaction > mediawikibackup.xml

(Authorisation data can be found in LocalSettings.php)

download mediawiki

The most recent version of mediawiki can be found at https://www.mediawiki.org/wiki/Download. You can use wget to download, e.g.:

wget https://releases.wikimedia.org/mediawiki/1.27/mediawiki-1.31.0.tar.gz

Best to uncompress the archive in your home directory and not directly in /usr/var.

Study the release notes

The release notes contain important changes, instructions and last minute notices. These might be more accurate and up-to-date than the document you are reading now.

Study the release notes!

... read them again. Make sure you know what you are doing.

move

Before moving the software to its final location, it is advised to pause serving mediawiki by apache (in /etc/apache2/conf-enabled).

  • Move the code to /usr/share/mediawiki-<version> and change the owner to wikiadmin (chown).
  • Create a symbolic link in this directory from LocalSettings.php to /etc/mediawiki/LocalSettings.php
  • Create a symbolic link in this directory from images to /var/lib/images
  • And finally, create a symbolic link in this directory from /usr/share/mediawiki to the new version /usr/share/mediawiki-<version>.

Check the release note for any other required additional actions.

update the database

Now... "Take Risk" and execute the database update script "update.php" in /usr/share/mediawiki/maintenance. With a little luck you should have updated your database now.

Updating the extensions

Updating the MLEB extension is a standard procedure as described here. Place the extension in /usr/share/mediawiki-<version>/extensions. Please do not forget to check the release notes for additional instructions and clarity.

The configuration of MLEB is customized a little in order to be able to set the page language manually (as some page originals are written in English):

$wgPageLanguageUseDB = true;

$wgGroupPermissions['sysop']['pagelang'] = true;

finishing the update

  • start serving the wiki root again by Apache2 (if you did not do this already).
  • test.
  • update this documentation if needed.