NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

So, I have succesfully installed my own map tile server using this guide: https://switch2osm.org/manually-building-a-tile-server-18-04-lts/

Everything went perfect, but now, I dont know how to start consuming my service in my WEB page using leaflet:

L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors' }).addTo(map);

I have a ddns and I want to catch my service. What kind of routing should I do in my router to point to my Tile Server? What number of internal port should I use to point to the server machine and consume the service from the outside? And then, how should the link look like? Im assuming it should be something like: 'http://MyDdns:OuterPort/Mod_tiles/{z}/{x}/{y}.png' Am I wrong? Is there a way to protect the acces to the service to be restrictive, via a key or of the sorts?

asked 01 Feb '19, 13:58

Leo_1991's gravatar image

Leo_1991
26224
accept rate: 0%

edited 01 Feb '19, 21:59

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554

(15 Apr '19, 16:47) SomeoneElse ♦

What kind of routing should I do in my router to point to my Tile Server?

Set up your router to forward whatever port you want to forward to your internal server to that server on the same or another port.

Im assuming it should be something like: 'http://MyDdns:OuterPort/Mod_tiles/{z}/{x}/{y}.png'

The config file for “renderd” is “/usr/local/etc/renderd.conf”. Your version of that probably refers to a map style called "ajt" so the full path to a file would be something like https://yourdns:yourport/hot/0/0/0.png .

permanent link
This answer is marked "community wiki".

answered 01 Feb '19, 14:21

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

Thank you for your answer!

But now it throws an "ERR_CONNECTION_REFUSED", I have all ports closed by default.Must I have any other opened?

(01 Feb '19, 15:51) Leo_1991

I tried an nmap on the domain, and the port 5000, the one I configured on router pointing to tile server throws the following:

PORT STATE SERVICE REASON 5000/tcp closed upnp conn-refused

Other ports wich I have open and running other services clearly specifies the service being run...

(01 Feb '19, 16:21) Leo_1991
2

Oh oh oh oh, I see where is my error now. The internal port should be an specific one. Now everything is fine and up running. Thank you!

(01 Feb '19, 16:35) Leo_1991

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×204
×74

question asked: 01 Feb '19, 13:58

question was seen: 4,402 times

last updated: 15 Apr '19, 16:47

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum