OpenStreetMap logo OpenStreetMap

Setting up an OSM Rendering Server on Windows 10

Posted by SomeoneElse on 30 October 2017 in English. Last updated on 1 February 2018.

It’s been possible to run Linux software on Windows for some time using Microsoft’s “Windows Subsystem for Linux”. Here’s what needs to be done to run a simple tile server there, based on the existing instructions here .

Firstly, install “Bash on Ubuntu on Windows”. There’s are some intructions here (but don’t worry where that says “This won’t work with server software”). Continue down to where it says “You’ll be asked to create a user account and password for use in the Bash environment”. It’s easiest if that user account is the one that you use in the rest of the switch2osm instructions.

Once installed, at a shell prompt “lsb_release -a” should say:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial

What you get is surprisingly similar to a standard Ubuntu server machine. Some things don’t work (e.g. “screen”), and you’ll have to manually start some of the services that will need, but otherwise things are very familiar.

Run “sudo apt update” and “sudo apt upgrade” to upgrade to the latest version of everything.

Next, go over to the switch2osm instructions and follow those as normal, except for the caveats pointed out below:

If you want to ssh in (you probably will) you’ll need to “sudo service ssh start”.

You’ll likely want to allow access to ports 22 (for ssh) and 80 (for http) and possibly others at the Windows Firewall (inbound rules / new rule / port / tcp port 80 / allow / all / “name”).

After installing postgresql but before doing e.g. “createuser renderaccount” you’ll need to start postgresql manually. “sudo service postgresql status” will say “down”, but after “sudo service postgresql start” it will say “Starting PostgreSQL 9.5 database server” and “service postgresql status” will then say “9.5/main (port 5432): online”.

Where the switch2osm instructions say “service apache2 reload” you’ll need to do two things. One is to work around a “Protocol not available: AH00076: Failed to enable APR_TCP_DEFER_ACCEPT” error that is described here, and the solution is to add “AcceptFilter http none” to the end of the /etc/apache2/apache2.conf file, and the other is to start Apache2 manually via “sudo service apache2 start”.

Pointing a web browser at http://yourserveraddress/ should display an Ubuntu Apache “It works” page. If it doesn’t, check firewall access and any error messages displayed when trying to start apache.

Before you run “renderd -f -c /usr/local/etc/renderd.conf” you’ll need to ensure that postgresql and apache2 are both started (they’d start automatically on Ubuntu but not here). Requests are passed from Apache and mod_tile to renderd, and here’s an example of what you might get (this is with Hereford, an English county, loaded):

Hereford

Edit:

There’s a suggestion here to use UTF8 in the createdb when setting up a tile server on Windows 10 this way. I didn’t notice any issues without it, but my example above doesn’t need any non-Latin names.

Discussion

Log in to leave a comment