I worked through the excellent guide on installing a tile server in Ubuntu 18.04. Frankly, this is one of the best guides I’ve ever used, and I’ve slogged through quite a few over the years. I ran into a couple of block walls at the end though. First, I want to say everything installed without any noted errors. I did get a ton of warnings (like this: Warning: amenity-points.mss:2468:6 Styles do not match layer selector .text-low-zoom.) when running carto, but that seems to be about all. I installed the Switcheroo Redirector extension in Chrome and pointed things towards my public ip address, but I keep getting Content Security Policy notices:
Initially I thought this issue was related to my server (I’m no expert on CSP!) so I added mod_headers and added very permissive policy directives. Chrome continued to refuse to load the Humanitarian Layer, but it does load the other three layers. I’ve since concluded the CPS notifications were coming from OpenStreetMap instead. I also threw together some html/css/javascript and used Leaflet to display a page. I did this with MapBox and it worked, so I’m confident my test code is acceptable. But, when I try to point towards my own server (same platform at this point), all I can get is a blank screen showing the map canvas without any graphics: This occurs in both Chrome and Safari; neither browser reports any errors, all statuses are 200. Syslog during an Apache start: May 24 07:59:58 ubuntu systemd1: Starting The Apache HTTP Server... May 24 07:59:58 ubuntu apachectl[95797]: [Thu May 24 07:59:58.490304 2018] [tile:notice] [pid 95800:tid 140608967183296] Loading tile config ajt at /hot/ for zooms 0 - 20 from tile directory /var/lib/mod_tile with extension .png and mime type image/png May 24 07:59:58 ubuntu systemd1: Started The Apache HTTP Server. Contents of /var/lib/mod_tile/ajt: I’m not sure how many of these directories should be here? I do want to say that when I try to use this link in Chrome w/ the extension, and I get the CSP notifications, if I click on one of the PNGs shown in the notification, I will get a tile to load and display. And, an additional folder gets created under /var/lib/mod_tile/ajt. I assume from this that my actual renderer works? Does this mean my problem is in how my Apache server is handing off the work to the tile server? Is my mod_tile broken? Here is my output from http://ipaddress/mod_tile after loading two png files using the method I described two paragraphs above.
I’m concluding from this that my web server is not handing off to mod_tile, but I don’t know why, nor am I sure what troubleshooting step I can take next. Any help would be greatly appreciated! I hope to hear back from you soon. In the meantime, I’ll start trying to look closer at mod_tile, and running renderd with more logging. UPDATE: I installed and configure munin to provide stats. I'm getting nothing from renderd: asked 24 May '18, 17:44 tim_rohrer
showing 5 of 7
show 2 more comments
|
I am happy to report I figured it out. As @SomeoneElse pointed out, the successful loading of The URL Template is where I found my error. Although I didn't see this in the leaflet.js documentation, the lat, lng, and zoom values are automatically picked up from the Perhaps this will be of help to someone in the future. answered 26 May '18, 05:07 tim_rohrer So what should I do to correct this? I'm having the same issues but didn't understood how to solve it.
(16 Nov '19, 19:40)
carlosguedes
Hi Carlos, do you have a public link to your setup to inspect you leaflet code? That would be the easiest way to help you out. Otherwise (if it's small) just post your leaflet code here or at paste bin or somewhere were we can have a look.
(16 Nov '19, 20:40)
Spiekerooger
The Leaflet file is the raw one used by the tutorial https://switch2osm.org/manually-building-a-tile-server-18-04-lts/ I just posted my question in another topic to don't make a mess https://help.openstreetmap.org/questions/71682/private-tile-server-not-rendering
(17 Nov '19, 02:04)
carlosguedes
|
I've added an answer at https://help.openstreetmap.org/questions/63690/tiles-not-creating - based largely on what you have found out!
In your case the fact that tiles are getting generated (as the "ls -al" shows) means that the link to mod_tile is working, but as you've since found the CSP (I think) is stopping Chromium from serving tiles.
Unfortunately, when I created my own leaflet-based site, and tested against my local server, I still only get the blank screen shown above.
In my server, CSP is not active. No errors or issues are noted in the browser.
I'm still working to pore through more logs, but not getting much to speak of.
Does your leaflet-based site work with osm's tile servers?
I tested against MapBox, yes I'm confident my code is acceptable. Do you think there is something different that should cause me to try and point towards osm's tile servers directly?
I'm in the process of redownloading shape files since, well, I don't know what else to try.
I still have not gotten this figured out, and mucking with the shape files made things worse. I've started over, and we'll see how it goes.
I'm still curious about the warnings I get with carto, although I've been told those shouldn't be a factor.
On a related note, what are the roles of the .lua and .style files used in the osm2pgsql process? Do they contain data that is actually imported into the gis database? Ultimately, if there is a problem with the openstreetmap-carto configuration, does that mean the database needs to be regenerated?
Any known tests for this?
The .style file (such as this one) determines what database columns are created, and the .lua file (such as here) allows fine-grained control over data as it is imported.
I've you've been using the lua transforms to move OSM data into a different column then yes, you might need to reload data after changing a .lua file. If you've not changed that you won't need to, though.
The bit of the switch2osm guide that says "Point a web browser at: http://yourserveripaddress/hot/0/0/0.png" is the basic test to check that your tile server's working.
Another thing that you might try is (on one session) "sudo tail -f /var/log/syslog" and on another "sudo /etc/init.d/renderd restart"
Thanks @SomeoneElse. I just set up another server and ran through the setup process. Basically the same, although I created a different user.
I am able to display the /hot/0/0/0.png, so I'm glad to hear your comment there.
Maybe I need to start a new question and post some code, but I've run my JS against MapBox and it works. So, that leads me to think my URL template is wrong/misunderstood? The forms I've tried that don't produce errors include: http://<internalip>/#map=13/40.3743/49.7134 and http://<internalip>#map=13/40.373/49.7134.
To confirm, I should be able to files served up to the user on the node as the tile server, correct?