Tirex/Building and Installing

From OpenStreetMap Wiki
Jump to navigation Jump to search

Download

Tirex is available from the Github repository at https://github.com/geofabrik/tirex

Currently you have to install from source or build your own Debian/Ubuntu packages as there are no ready-made packages available.

Prerequisites

You'll need the following Perl modules to run Tirex:

Perl module Debian/Ubuntu package Fedora package
IPC::ShareLite libipc-sharelite-perl perl-IPC-ShareLite
JSON libjson-perl perl-JSON
GD libgd-gd2-perl perl-GD
LWP libwww-perl perl-libwww-perl

You'll need a C++ compiler and build tools to compile the Mapnik backend.

Building

To build Tirex run

 make

in the main directory. This will compile the mapnik backend and create the man pages for the Perl modules.

Call make clean to cleanup after a make.

Installing

If you want to create Debian/Ubuntu packages and install them, jump to #Debian/Ubuntu. Otherwise for normal installation call

 make install

as root user. This will install the main parts of Tirex including the tirex-master, tirex-backend-manager and the Mapnik backend.

This will not install the example map, or the munin or nagios plugins. To install those, call

 make install-example-map
 make install-munin
 make install-nagios

respectively. You can also install everything with

 make install-all

Debian/Ubuntu

To create Debian/Ubuntu packages you need some packages installed:

sudo apt install devscripts libjson-perl libipc-sharelite-perl libgd-perl

For creating the deb-packages, call:

 make deb

The following packages will be created in the parent directory:

Package name Description
tirex-core Core of the Tirex system including master, backend-manager, several tools, Perl libraries, example config, and test rendering backend
tirex-backend-mapnik The Mapnik rendering backend
tirex-backend-mapserver The Mapserver rendering backend
tirex-backend-openseamap The OpenSeaMap rendering backend
tirex-backend-wms The WMS rendering backend
tirex-example-map Example map data and config for the Mapnik rendering backend
tirex-munin-plugin Munin plugins
tirex-nagios-plugin Nagios plugins
tirex-syncd Program to sync newly rendered tiles to another host

All backends are optional but you need to have at least one installed.

For installing the packages call

sudo dpkg -i tirex-core.deb

To clean the deb files after generation, call make deb-clean.

Tirex User and Group

All parts of the Tirex system expect to be run under a normal user ID, not root. You should create a tirex user and group on your system for this. The Debian/Ubuntu packages will do it for you. This user needs write access to the tile, statistics, and log directories as well as the pid files (typically under /var/lib/tirex, /var/log/tirex, and /var/run/tirex).

Tests

Call prove in the main directory to run Perl unit tests. You need Test::More (Debian/Ubuntu: libtest-simple-perl) and Test::Harness (Debian/Ubuntu: libtest-harness-perl) installed.

There are some other tests in the test directory. See the description at the beginning of the scripts for information on how to use them.