Skip to content
Erik Johnson edited this page Mar 28, 2016 · 5 revisions

OSM Tiles: Deploy

After tiles are generated, they are ready to be deployed to server(s).

There are many ways to handle this, such as using rsync, tar, etc.

Tar Example

Here's an example using tar:

Tar up tiles

cd to the host directory that corresponds to the container's /var/lib/mod_tile. In the previous docker-compose.yml, this is mounted from the host's ./docker/osm/mod_tile.

$ cd ./docker/osm/mod_tile

tar the default directory to mod_tile.tar. Since the tiles are images that undergo negligible compression, we will not use any compression.

$ tar cvf mod_tile.tar default

Generating a checksum file is recommended to verify integrity of the tar file upon transfer:

$ shasum mod_tile.tar > mod_tile.tar.sha1

Transfer tar file

Copy the tar file and checksum file to your server using your preferred transfer method, e.g. rsync or scp

$ rsync -av mod_tile.tar* yourserver:
# OR
$ scp mod_tile.tar* yourserver:

On the server, verify the file integrity of the tranferred file:

$ shasum -c mod_tile.tar.sha1

Deploy tar file

Back up existing mod_tile directory if needed, and deploy the tiles from the tar file. Using a symbolic link to directory other than mod_tile can be handy for keeping track of tiles' heritage.

$ cd /var/lib
$ sudo mv mod_tile mod_tile.orig
$ sudo mkdir mod_tile.pregenerated
$ sudo ln -s mod_tile.pregenerated mod_tile
$ cd mod_tile.pregenerated
$ sudo tar xvf ~/mod_tile.tar

This should deploy ~/mod_tile.tar into /var/lib/mod_tile.pregenerated/default. Since /var/lib/mod_tile was symbolically linked to /var/lib/mod_tile.pregenerated, Apache's mod_tile module should now be serving tiles from its default location.

« Previous: Render Tiles | Home

Clone this wiki locally