Permalink 03:22:46 pm, by mholmes, 122 words, 33 views   English (CA)
Categories: R & D, Activity log, Documentation; Mins. worked: 90

Setting up Apache for testing Jetty/eXist

In a previous post I went through in detail how to set up the virtual host for Apache and to configure the /etc/hosts file, but I didn't give much detail on Apache itself. I've just gone through the whole process again, and I'm now documenting that as an addendum:

Configure required apache modules:

sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod ssl

Generate a certificate for the server to use:

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/spud.key -out /etc/ssl/certs/spud.crt

Restart Apache:

sudo systemctl restart apache2

Of course the name and location of the cert must match the name and location specified in the virtual host file.


Permalink 04:08:57 pm, by mholmes, 29 words, 14 views   English (CA)
Categories: Servers, R & D, Activity log, Documentation; Mins. worked: 60

eXist build script tweaked and now working

I'm now able to build the trunk of the eXist repo to get a working (but not yet tested) eXist 4. I can start testing our apps with it now.


Permalink 01:25:27 pm, by Greg, 33 words, 28 views   English (CA)
Categories: Servers, Documentation; Mins. worked: 0

Reprepro notes

While fiddling with adding a new distro to reprepro I had cause to remove one...

  1. Remove reference to it from the $repodir/conf/distributions file

  2. sudo reprepro -Vb /path/to/name-of-your-repo --delete clearvanished
Permalink 01:21:13 pm, by Greg, 207 words, 29 views   English (CA)
Categories: Servers, Documentation; Mins. worked: 0

Setting up GPG v2 key on cli

SHA1 keys are no longer recommended so I went through the process of generating a new set of keys for use on the apt server. Here's how I did it (followed this).

  1. apt install gpgv2 package. Xenial installs v1 by default. Not sure if v2 is required, strictly-speaking.

  2. Generating keys requires a quantity of entropy which can be hard to generate on a CLI system. I apt installed the pkgs rng-tools and haveged, then ran 'sudo rngd -r /dev/urandom -W 4096' which generates enough entropy for a build. You can check the available entropy by running 'cat /proc/sys/kernel/random/entropy_avail'.

  3. Create key with 'sudo gpg2 --full-gen-key'. Answer questions. No need to add a comment. Do set an unlock password, though.

  4. Result is a barf of info including a line like 'gpg: key 3GD4831G marked as ultimately trusted'. You'll ref 3GD4831G in reprepro on the SignWith line.

  5. Export an armoured public key with 'sudo gpg2 --armor --output my_public_key.asc --export 3GD4831G'. Note that the command is gpg2 and that the key has an 'asc' suffix. I have reason to believe that armoured keys that do not use either a gpg or asc suffix will eventually be ignored on import.


Permalink 04:36:15 pm, by mholmes, 31 words, 48 views   English (CA)
Categories: Activity log; Mins. worked: 60

Updated to Ubuntu 17.10

A bit late coming to this, and it took an hour or so to get everything back up and running, but fonts are way nicer and the Japanese input works better.


Permalink 04:53:57 pm, by mholmes, 136 words, 59 views   English (CA)
Categories: R & D, Activity log, Documentation; Mins. worked: 180

Setting up yet another encrypted volume

Put the new HD into the machine and tried to do a direct dd copy from the old HD in a USB cradle, but the operation failed at the same point twice (after about 15GB). In the end, I created a new encrypted volume on the new disk, formatted it as ext4 and set an scp job going to bring everything down from Rutabaga. The results will be pretty messy, I know, but there's no real alternative. I'll have to do a bunch of chmods to handle .svn folders and such; it may be simpler to check things out again. If it's possible to get my VMs off the old drive, that's the next thing to try because those aren't backed up. Only the Windows one gets used, though, and that's easy to rebuild if necessary.


Permalink 11:57:40 am, by Greg, 200 words, 77 views   English (CA)
Categories: Servers, Documentation; Mins. worked: 0

PHP upgrade issues

The new cluster runs PHP 5.6 by default, and PHP 7.1 with suPHP (instructions to follow). Testing old apps has revealed two specific issues:

  1. Warning: mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication.

  2. Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead

We aren't sure why, but you may get one or the other or both messages. It *appears* that if you fix problem #2 both problems go away, but if you only fix problem #1, you'll be left with problem #2. So, at a bare minimum, solve problem #2.

Here's how to address each problem:

  1. Log in to phpMyAdmin as the db user required by your PHP script and run the following SQL in the context of the app's DB:
    SET SESSION old_passwords=0;
    SET PASSWORD=PASSWORD('my_password');

    This has worked without further effort, but some say that you should also run:
    as the DB admin user

  2. You can either fix the problem by changing your MySQL Extension methods (mysql_*) to MySQL Improved Extension methods (mysqli_*), or the sub-optimal "ignore the deprecation" method of adding error_reporting(E_ALL ^ E_DEPRECATED); to the head of your scripts.


Permalink 09:44:51 am, by sarneil, 87 words, 74 views   English (CA)
Categories: Activity log; Mins. worked: 60

Firefox profile manager

FF Dev updated itself, created a new profile and somehow my copy of FF Prod ended up pointing at the dev profile. (i.e. all my bookmarks, plugins, history etc. "disappeared").

To tell FF which profile to use.
Close all instances of Firefox
Open the Terminal application.
In the Terminal application, enter the following:
/Applications/Firefox.app/Contents/MacOS/firefox-bin -P
Press Return. The Firefox Profile Manager (Choose User Profile) window should open.
Choose the correct profile.
Click Start Firefox.



Permalink 05:32:08 pm, by mholmes, 27 words, 71 views   English (CA)
Categories: R & D, Activity log; Mins. worked: 60

QGIS learning

In prep for RA work, installed QGIS locally and worked through the initial parts of the tutorial. Will keep going with this. So far it's pretty straightforward.


Permalink 04:58:27 pm, by mholmes, 333 words, 107 views   English (CA)
Categories: Servers, R & D, Activity log, Documentation, Documentation; Mins. worked: 90

Building a vector tile server

Now that Open Layers fully supports vector layers, we're looking at the practicality of running a vector tile server for our projects. Starting from this docker example, I created a script which I can run on a standard Debian Stretch install to create a working tile server:


#This is to be run on a standard Debian Stretch install.

#Install core stuff
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install apt-transport-https curl unzip build-essential python libcairo2-dev libprotobuf-dev xvfb 

#Temporarily use a specific source for the exact nodejs version we need.
echo "deb https://deb.nodesource.com/node_4.x jessie main" >> /etc/apt/sources.list.d/nodejs.list
echo "deb-src https://deb.nodesource.com/node_4.x jessie main" >> /etc/apt/sources.list.d/nodejs.list

#Install it.
apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -y --allow-unauthenticated install nodejs 

#Now remove the source.
rm /etc/apt/sources.list.d/nodejs.list
apt-get clean

#Added these in order to get the npm install to run properly. 
#The problem was building canvas.
apt-get -y install libjpeg62-turbo-dev libpango1.0-dev libgif-dev g++

#Create directory for tileserver application.
mkdir -p /usr/src/app

#Get the Klokantech code for the server.
cd /usr/src/app 
curl -L https://github.com/klokantech/tileserver-gl/archive/master.zip -o master.zip
unzip master.zip 
cp -r tileserver-gl-master/* ./
rm -rf tileserver-gl-master

#Install the node stuff
npm install --production

#Set environment variable
echo NODE_ENV=\"production\" >> /etc/environment

#Create the folder for the mbtiles files (you'll need to supply these later).
mkdir /data

#In case other servers are installed and running, stop them.
systemctl stop apache2 mysql
systemctl disable apache2 mysql

echo "Now put your mbtiles files into the /data folder, and run /usr/src/app/run.sh."
#Start the tileserver on port 80.

This could form the basis for a VM-based tileserver for our projects, including the Confederation Debates; running a server for all of Canada is quite practical due to the efficiency of the vector format.

:: Next Page >>


This blog is the location for all work involving software and hardware maintenance, updates, installs, etc., both routine and urgent, in the server room, the labs and the R&D rooms.


XML Feeds