Jazz and the MediaWiki package

And rain, I mustn’t forget the rain. I’m worrying about the roof, although far less than I used to (it’s a different roof). The jazz is the radio; it’s on.

But the main point this morning is exploring the mediawiki-lts package maintained by Legoktm. I’ve been meaning to look at it for a while, and switch my (non-playground) wikis over to it, but there’s never enough time. Not that there’s enough time now, but I’m just trying to get it running locally for two wikis (yes, the smallest possible farm).

So, in simple steps, I first added the PPA:

sudo add-apt-repository ppa:legoktm/mediawiki-lts

This created /etc/apt/sources.list.d/legoktm-ubuntu-mediawiki-lts-xenial.list. Then I updated the package info:

sudo apt-get update

And installed the package:

sudo apt install mediawiki

At this point, the installation prompt for MediaWiki 1.27.3 was available at http://localhost/mediawiki/ (which luckily doesn’t conflict with anything I already had locally) and I stepped through the installer, creating a new database and DB user via phpMyAdmin as I went, and answering all the questions appropriately. (It’s actually been a while since I last saw the installer properly.) The only tricky thing I found was that it asks for the “Directory for deleted files” but not for the actual directory for all files — because I want the files to be stored in a particular place and not in /usr/share/mediawiki/images/, especially as I want there to be two different wikis that don’t share files.

I made a typo in my database username in the installation form, and got a “Access denied for user x to database y” error. I hit the browser’s back button, and then the installer’s back buttons, to go back to the relevant page in the installer, fixed the typo and proceeded. It remembered everything correctly, and this time installed the database tables, with only one error. This was “Notice: JobQueueGroup::__destruct: 1 buffered job(s) of type(s) RecentChangesUpdateJob never inserted. in /usr/share/mediawiki/includes/jobqueue/JobQueueGroup.php on line 447”. Didn’t seem to matter.

At the end of the installer, it prompted me to download LocalSettings.php and put it at /etc/mediawiki/LocalSettings.php which I did:

 sudo mv ~/LocalSettings.php /etc/mediawiki/.
 sudo chown root:root /etc/mediawiki/LocalSettings.php
 sudo chmod 644 /etc/mediawiki/LocalSettings.php

And then I had a working wiki at http://localhost/mediawiki/index.php!

Configuring

I wanted a different URL, so edited /etc/apache2/sites-available/000-default.conf (in order to not modify the package-provided /etc/mediawiki/mediawiki.conf) to add:

Alias /mywiki /var/lib/mediawiki

And changed the following in LocalSettings.php:

$wgScriptPath = "/mywiki";

The multiple wikis will have to wait until later, as will the backup regime.

Installing AtoM

Access to Memory is a brilliant archival description management system, written in PHP and available under the CC-BY-SA license. The installation documentation is thorough… but of course I just want to get the thing running and so didn’t bother actually reading it all! I mean, where’s the tldr?!

So here are the essential bits (for a more-or-less bog standard Ubuntu install with Apache, PHP, and Node.js), running as a normal user and installing to a subdirectory.

To start, clone the repository from https://github.com/artefactual/atom.git and check out the latest stable branch (e.g. stable/2.2.x).

Then make the config, cache, and log directories writable by the web-server user: chgrp -R www-data {cache,log,data} (or whatever your webserver runs as, of course).

Now change into the /plugins/arDominionPlugin directory and run make; this will build the CSS files.

Navigating to the installation now will redirect to the installation system, and probably throw up a bunch of errors. Probably to do with missing dependencies, or permissions; sort these out (e.g. sudo php5enmod xsl and you should be good to go.

(Good to go to the next step, that is.)

Now install Elasticsearch. It’s easier than the AtoM docs admit: just do it the normal way with sudo apt-get install elasticsearch. (I’d submit a change to the AtoM docs to remove the “it’s not in the Ubuntu repositories” line, but I’m not quite sure how yet.)

Start Elasticsearch (in the background; the -d switch) with sudox /usr/share/elasticsearch/bin/elasticsearch -d and carry on with the installation procedure. The rest seems to be fairly straight forward.

Planet Freo not offline

I thought I’d better phrase the title of this post in the negative, seeing as the blasted thing has been more often offline over the last couple of months than it has been online. Even when it’s been online it’s not been working properly. Hurrumph.

Anyway, perhaps now at last we’re on the road to correct operation. The main page and the RSS feed are now back up and working. I’ve switched to a new script (details of which to come soon).

Please let me know if Planet Freo is working okay now for you. Thanks!

Setting up USB drives for backup

I use USB hard drives for backing up one of my machines, swapping them regularly but leaving everything else up to the backup script that runs daily. This means that I want to mount them at the same place every time, regardless of which drive I plug in or what device it is registered as. This isn’t very difficult because fstab can use UUIDs or labels to identify disks:

UUID=6B70-A309    /media/sw_backup vfat user 0 0
LABEL="SW_BACKUP" /media/sw_backup vfat user 0 0

(Note: these backup drives are formatted with FAT filesystems so that I can if need be restore on any system if required.)

To avoid having to manually add the disk every time I put a new one into rotation, I go with the label method.

To use this, each disk must be given the same label (and then not plugged in at the same time!). To set the label, first find the device:

sw@swbackup:~/backups$ sudo blkid
/dev/sda3: UUID="f31d1291-9d6f-441d-9f8d-fa34e9f569d5" TYPE="swap"
/dev/sda4: UUID="8a0b99a2-8a2e-4eae-7666-d607fbc44de5" TYPE="ext4"
/dev/sdb1: LABEL="NONAME" UUID="4A39-C8E7" TYPE="vfat"

Then sudoedit /etc/mtools.conf to add the following, where the device name is the same as above:

mtools_skip_check=1
drive s: file="/dev/sdb1"

Now mtools can change the label:

sw@swbackup:~/backups$ sudo mlabel -s s:
 Volume label is NONAME
sw@swbackup:~/backups$ sudo mlabel s:SW_BACKUP
sw@swbackup:~/backups$ sudo mlabel -s s:
 Volume label is SW_BACKUP

Sitting, reading (again).

I seem to always want to return to this state: a quite chair with a pleasant outlook, and a good book. Here I am, into my second week at IBM, and I have achieved it, albeit with some detractions. The most major: I’m reading IBM Red Books. Next: this is no quiet parlor with a comfy armchair and a neat fire burning. But we take what we can get, don’t we?

So: I’m in a fluro-lit second-floor office, sitting at a cheap white melamine desk with an IBM Thinkpad. I read about AIX, on and on and on, and then I try things, turning to the server that also sits on my desk, and in this way (I guess) I am learning…

My view is to the South, looking over Bonython or Isabella Plains or wherever it is, and nearer it’s the lake, which is a lovely place (hmm, that’s probably not the complete truth) to walk at lunch time. In fact, I think that’s what I might go and do now.