This page contains some notes about the system administration of a MediaWiki web server for a small-ish and low-traffic wiki.
Setting up a new server
For a normal upgrade, it's possible to have the old VPS available for comparison while setting up the new one, but it should be possible to restore only from backups.
sudo update-alternatives --config editor
MediaWiki
Install from tarball to /var/www/mediawiki
, then install extensions with Composer.
Cronjobs
MAILTO=admin@example.org
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# MediaWiki statistics.
@weekly /usr/bin/php /var/www/mediawiki/maintenance/run initSiteStats --wiki=mywiki --active --update
# Sitemaps
@weekly /usr/bin/php /var/www/mediawiki/maintenance/run generateSitemap --fspath /var/www/mediawiki/sitemaps --urlpath /sitemaps/ --wiki mywiki --identifier example.org --server https://example.org
# Update query pages
@weekly /usr/bin/php /var/www/mediawiki/maintenance/run updateSpecialPages --wiki mywiki
# Database backups
@daily /var/backups/bright/backup.sh
The msmtp package is pretty useful. Install it and set it up in /etc/msmtprc
:
defaults
tls on
tls_starttls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
account default
auth on
host smtp.fastmail.com
port 587
user mainuser@fastmail.com
from wiki@example.org
password ThisIsAnAppPassword123
aliases /etc/aliases