You are not logged in.

Announcement

*** NOTICE: forum.openstreetmap.org is being retired. Please request a category for your community in the new ones as soon as possible using this process, which will allow you to propose your community moderators.
Please create new topics on the new site at community.openstreetmap.org. We expect the migration of data will take a few weeks, you can follow its progress here.***

#1 2011-02-24 13:33:07

fast
Member
Registered: 2011-01-11
Posts: 7

mod_tile/renderer/apache configuration issue

Hi,
     I have built my own openstreetmap server (Ubuntu 10.04) using the guidelines from http://weait.com/content/build-your-own … map-server
  I was able to generate tiles using mapnik successfully.
then I installed mod_tile using the following instructions :
******************************************************************************
svn co http://svn.openstreetmap.org/applicatio … s/mod_tile
cd mod_tile

Edit render_config.h so that all references to lib64 are lib if on a 32bit OS.
Open renderd.conf change the path to WWW_ROOT to the correct path and the XML
file should point to the one generated in the previous step by mapnik.
Once everything is changed:
sudo make
sudo install
sudo mkdir /var/www/osm_tiles2
sudo mkdir /var/www/direct
sudo mkdir /var/run/renderd

Edit /etc/apache2/conf.d/mod_tile.conf to match your settings
and change the socket for renderd to /tmp/osm-renderd
Make an empty file planet-import-complete in /var/lib/mod_tile/
Restart apache

Run renderd via
sudo ./mod_tile/renderd
******************************************************************************
when I run renderer -f It runs without any errors and when I request for a tile http://LAN_server_IP/osm_tiles2/0/0/0.png it gives me 404 error.And when I open  http://LAN_server_IP/mod_tile  all values are 0

when I do apache2ctl -M  it displays  --> tile_module (shared)

I have also disabled SElinux using -->   sudo echo 0 > /selinux/enforce
**********************************************************************************************************
                                Renderd Daemon Output
**********************************************************************************************************
root@ubuntu:~/mod_tile# ./renderd -f
renderd[2121]: Rendering daemon started
renderd[2121]: Parsing section renderd
renderd[2121]: Parsing render section 0
renderd[2121]: Parsing section mapnik
renderd[2121]: Parsing section default
renderd[2121]: config renderd: unix socketname=/tmp/osm-renderd
renderd[2121]: config renderd: num_threads=4
renderd[2121]: config renderd: num_slaves=0
renderd[2121]: config renderd: tile_dir=/var/lib/mod_tile
renderd[2121]: config renderd: stats_file=/var/run/renderd/renderd.stats
renderd[2121]: config mapnik:  plugins_dir=/usr/local/lib/mapnik/input
renderd[2121]: config mapnik:  font_dir=/usr/local/lib/mapnik/fonts
renderd[2121]: config mapnik:  font_dir_recurse=1
renderd[2121]: config renderd(0): Active
renderd[2121]: config renderd(0): unix socketname=/tmp/osm-renderd
renderd[2121]: config renderd(0): num_threads=4
renderd[2121]: config renderd(0): tile_dir=/var/lib/mod_tile
renderd[2121]: config renderd(0): stats_file=/var/run/renderd/renderd.stats
renderd[2121]: config map 0:   name(default) file(/home/haseeb/mapnik/my_osm.xml) uri(/var/www) htcp() host(tile.idt.org)
renderd[2121]: Initialising unix server socket on /tmp/osm-renderd
renderd[2121]: Created server socket 4
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSansCondensed-BoldOblique.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSerif.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSansCondensed-Oblique.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSerifCondensed.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSerif-BoldItalic.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSans-ExtraLight.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSansMono-Bold.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSansCondensed-Bold.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSerifCondensed-BoldItalic.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/unifont-5.1.20080907.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSans-BoldOblique.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSerif-Bold.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSerifCondensed-Italic.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSansMono.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSansMono-Oblique.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSansCondensed.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSerifCondensed-Bold.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSans-Bold.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSansMono-BoldOblique.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSerif-Italic.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSans-Oblique.ttf
renderd[2121]: DEBUG: Loading font: /usr/local/lib/mapnik/fonts/DejaVuSans.ttf
Running in foreground mode...
renderd[2121]: Starting stats thread

**********************************************************************************************************
                               Apache error.log
**********************************************************************************************************
[Thu Feb 24 12:35:55 2011] [info] [client 10.1.82.20] tile_translate: uri(/osm_tiles2/0/0/0.png)
[Thu Feb 24 12:35:55 2011] [info] [client 10.1.82.20] tile_translate: baseuri(/var/www/) name(default)
[Thu Feb 24 12:35:55 2011] [info] [client 10.1.82.20] tile_storage_hook: handler((null)), uri(/osm_tiles2/0/0/0.png), filename(/var/www/osm_tiles2/0/0/0.png), path_info((null))
[Thu Feb 24 12:35:55 2011] [error] [client 10.1.82.20] File does not exist: /var/www/osm_tiles2/0
[Thu Feb 24 12:35:55 2011] [debug] mod_deflate.c(615): [client 10.1.82.20] Zlib: Compressed 294 to 226 : URL /osm_tiles2/0/0/0.png
[Thu Feb 24 12:35:55 2011] [info] [client 10.1.82.20] tile_translate: uri(/favicon.ico)
[Thu Feb 24 12:35:55 2011] [info] [client 10.1.82.20] tile_translate: baseuri(/var/www/) name(default)
[Thu Feb 24 12:35:55 2011] [info] [client 10.1.82.20] tile_storage_hook: handler((null)), uri(/favicon.ico), filename(/var/www/favicon.ico), path_info((null))
[Thu Feb 24 12:35:55 2011] [error] [client 10.1.82.20] File does not exist: /var/www/favicon.ico
[Thu Feb 24 12:35:55 2011] [debug] mod_deflate.c(615): [client 10.1.82.20] Zlib: Compressed 285 to 219 : URL /favicon.ico
[Thu Feb 24 12:35:58 2011] [info] [client 10.1.82.20] tile_translate: uri(/favicon.ico)
[Thu Feb 24 12:35:58 2011] [info] [client 10.1.82.20] tile_translate: baseuri(/var/www/) name(default)
[Thu Feb 24 12:35:58 2011] [info] [client 10.1.82.20] tile_storage_hook: handler((null)), uri(/favicon.ico), filename(/var/www/favicon.ico), path_info((null))
[Thu Feb 24 12:35:58 2011] [error] [client 10.1.82.20] File does not exist: /var/www/favicon.ico
[Thu Feb 24 12:35:58 2011] [debug] mod_deflate.c(615): [client 10.1.82.20] Zlib: Compressed 285 to 219 : URL /favicon.ico
[Thu Feb 24 12:36:05 2011] [info] [client 10.1.82.20] tile_translate: uri(/osm_tiles2/0/0/0.png)
[Thu Feb 24 12:36:05 2011] [info] [client 10.1.82.20] tile_translate: baseuri(/var/www/) name(default)
[Thu Feb 24 12:36:05 2011] [info] [client 10.1.82.20] tile_storage_hook: handler((null)), uri(/osm_tiles2/0/0/0.png), filename(/var/www/osm_tiles2/0/0/0.png), path_info((null))
[Thu Feb 24 12:36:05 2011] [error] [client 10.1.82.20] File does not exist: /var/www/osm_tiles2/0
[Thu Feb 24 12:36:05 2011] [debug] mod_deflate.c(615): [client 10.1.82.20] Zlib: Compressed 294 to 226 : URL /osm_tiles2/0/0/0.png
[Thu Feb 24 12:36:15 2011] [info] [client 10.1.82.20] tile_translate: uri(/osm_tiles2/0/0/0.png)
[Thu Feb 24 12:36:15 2011] [info] [client 10.1.82.20] tile_translate: baseuri(/var/www/) name(default)
[Thu Feb 24 12:36:15 2011] [info] [client 10.1.82.20] tile_storage_hook: handler((null)), uri(/osm_tiles2/0/0/0.png), filename(/var/www/osm_tiles2/0/0/0.png), path_info((null))
[Thu Feb 24 12:36:15 2011] [error] [client 10.1.82.20] File does not exist: /var/www/osm_tiles2/0
[Thu Feb 24 12:36:15 2011] [debug] mod_deflate.c(615): [client 10.1.82.20] Zlib: Compressed 294 to 226 : URL /osm_tiles2/0/0/0.png
[Thu Feb 24 12:36:16 2011] [info] [client 10.1.82.20] tile_translate: uri(/osm_tiles2/0/0/0.png)
[Thu Feb 24 12:36:16 2011] [info] [client 10.1.82.20] tile_translate: baseuri(/var/www/) name(default)
[Thu Feb 24 12:36:16 2011] [info] [client 10.1.82.20] tile_storage_hook: handler((null)), uri(/osm_tiles2/0/0/0.png), filename(/var/www/osm_tiles2/0/0/0.png), path_info((null))
[Thu Feb 24 12:36:16 2011] [error] [client 10.1.82.20] File does not exist: /var/www/osm_tiles2/0
[Thu Feb 24 12:36:16 2011] [debug] mod_deflate.c(615): [client 10.1.82.20] Zlib: Compressed 294 to 226 : URL /osm_tiles2/0/0/0.png
[Thu Feb 24 12:36:17 2011] [info] [client 10.1.82.20] tile_translate: uri(/osm_tiles2/0/0/0.png)
[Thu Feb 24 12:36:17 2011] [info] [client 10.1.82.20] tile_translate: baseuri(/var/www/) name(default)
[Thu Feb 24 12:36:17 2011] [info] [client 10.1.82.20] tile_storage_hook: handler((null)), uri(/osm_tiles2/0/0/0.png), filename(/var/www/osm_tiles2/0/0/0.png), path_info((null))
[Thu Feb 24 12:36:17 2011] [error] [client 10.1.82.20] File does not exist: /var/www/osm_tiles2/0
[Thu Feb 24 12:36:17 2011] [debug] mod_deflate.c(615): [client 10.1.82.20] Zlib: Compressed 294 to 226 : URL /osm_tiles2/0/0/0.png
[Thu Feb 24 12:36:18 2011] [info] [client 10.1.82.20] tile_translate: uri(/osm_tiles2/0/0/0.png)
[Thu Feb 24 12:36:18 2011] [info] [client 10.1.82.20] tile_translate: baseuri(/var/www/) name(default)
[Thu Feb 24 12:36:18 2011] [info] [client 10.1.82.20] tile_storage_hook: handler((null)), uri(/osm_tiles2/0/0/0.png), filename(/var/www/osm_tiles2/0/0/0.png), path_info((null))
[Thu Feb 24 12:36:18 2011] [error] [client 10.1.82.20] File does not exist: /var/www/osm_tiles2/0
[Thu Feb 24 12:36:18 2011] [debug] mod_deflate.c(615): [client 10.1.82.20] Zlib: Compressed 294 to 226 : URL /osm_tiles2/0/0/0.png

**********************************************************************************************************
                                Apache access.log
**********************************************************************************************************
10.1.82.20 - - [22/Feb/2011:14:54:30 +0500] "GET /mod_tile HTTP/1.1" 200 638 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13"
10.1.82.20 - - [22/Feb/2011:14:54:30 +0500] "GET /mod_tile HTTP/1.1" 200 637 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13"
10.1.82.20 - - [22/Feb/2011:14:54:30 +0500] "GET /mod_tile HTTP/1.1" 200 637 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13"
10.1.82.20 - - [22/Feb/2011:14:54:33 +0500] "GET /mod_tile HTTP/1.1" 200 637 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13"
10.1.82.20 - - [22/Feb/2011:14:58:09 +0500] "GET /mod_tile HTTP/1.1" 200 638 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13"
10.1.82.20 - - [22/Feb/2011:15:02:09 +0500] "GET /mod_tile HTTP/1.1" 200 638 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13"
10.1.82.20 - - [22/Feb/2011:16:05:06 +0500] "GET /osm_tiles2/0/0/0.png HTTP/1.1" 404 509 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13"

**********************************************************************************************************
                                /etc/apache2/sites-enabled/mod_tile.conf
*********************************************************************************************************
haseeb@ubuntu:/var/log/apache2$ cat /etc/apache2/sites-enabled/mod_tile.conf
# This is the Apache server configuration file for providing OSM tile support
# through mod_tile

LoadModule tile_module modules/mod_tile.so

<VirtualHost *:80>
    ServerName tile.idt.org
    ServerAlias a.tile.idt.org b.tile.idt.org c.tile.idt.org d.tile.idt.org
    DocumentRoot /var/www

    LoadTileConfigFile /etc/renderd.conf

    ModTileRequestTimeout 3

    ModTileMissingRequestTimeout 10

    ModTileMaxLoadOld 2

    ModTileMaxLoadMissing 5

     ModTileRenderdSocketName /tmp/osm-renderd

ModTileCacheDurationMax 604800

ModTileCacheDurationDirty 900

ModTileCacheDurationMinimum 10800

ModTileCacheDurationMediumZoom 13 86400

ModTileCacheDurationLowZoom 9 518400

ModTileCacheLastModifiedFactor 0.20

ModTileEnableTileThrottling Off
.
ModTileThrottlingTiles 10000 1
.
ModTileThrottlingRenders 128 0.2

    LogLevel debug

</VirtualHost>

**********************************************************************************************************
                                /etc/renderd.conf
*********************************************************************************************************
haseeb@ubuntu:/var/log/apache2$ cat /etc/renderd.conf
[renderd]
;socketname=/var/run/renderd/renderd.sock
num_threads=4
tile_dir=/var/lib/mod_tile ; DOES NOT WORK YET
stats_file=/var/run/renderd/renderd.stats

[mapnik]
plugins_dir=/usr/local/lib/mapnik/input
font_dir=/usr/local/lib/mapnik/fonts
font_dir_recurse=1

[default]
URI=/var/www
XML=/home/haseeb/mapnik/my_osm.xml
HOST=tile.idt.org
;HTCPHOST=proxy.openstreetmap.org
***************************************************************************************************
***************************************************************************************************

Can anyone please help me out.I have already spent over a week on mod_tile setup but still couldn't figure it out. Thank you so much and waiting for a response.

Regards,
Haseeb

Offline

#2 2011-02-25 10:53:43

greencaps
Member
Registered: 2009-10-05
Posts: 423

Re: mod_tile/renderer/apache configuration issue

I was able to generate tiles using mapnik successfully.

Where did mapnik store the produced tiles?

What does mapnik have to to with the renderer? Does the renderer generate tiles or does it use mapnik to generate them? Did mapnik generate the ...//0/0/0.png tile already? Then where does it reside?

Please explain a bit how the rendere uses mapnik, if it does.

[Thu Feb 24 12:35:55 2011] [info] [client 10.1.82.20] tile_translate: uri(/favicon.ico)
[Thu Feb 24 12:35:55 2011] [info] [client 10.1.82.20] tile_translate: baseuri(/var/www/) name(default)
[Thu Feb 24 12:35:55 2011] [info] [client 10.1.82.20] tile_storage_hook: handler((null)), uri(/favicon.ico), filename(/var/www/favicon.ico), path_info((null))
[Thu Feb 24 12:35:55 2011] [error] [client 10.1.82.20] File does not exist: /var/www/favicon.ico

File does not exist: If you put some favicon.ico in that directory does the error go away?

[Thu Feb 24 12:36:05 2011] [info] [client 10.1.82.20] tile_translate: uri(/osm_tiles2/0/0/0.png)
[Thu Feb 24 12:36:05 2011] [info] [client 10.1.82.20] tile_translate: baseuri(/var/www/) name(default)
[Thu Feb 24 12:36:05 2011] [info] [client 10.1.82.20] tile_storage_hook: handler((null)), uri(/osm_tiles2/0/0/0.png), filename(/var/www/osm_tiles2/0/0/0.png), path_info((null))
[Thu Feb 24 12:36:05 2011] [error] [client 10.1.82.20] File does not exist: /var/www/osm_tiles2/0

For me it is strange that "osm_tiles2/0" is called a file.

Now did you check if file "/var/www/osm_tiles2/0/0/0.png" is in the mentioned directory?

Or is /var/www/osm_tiles2/0/0 not a physical directory?

Offline

#3 2011-02-25 20:03:25

fast
Member
Registered: 2011-01-11
Posts: 7

Re: mod_tile/renderer/apache configuration issue

thankyou so much for replying...I got a solution using the mailing list...The solution was I was giving the wrong path in renderd.conf i first set the path to
URI=/var/www
but it should be /osm_tiles2/
Then I changed the ownership of /var/www  to www-data
and also changed the write permissions of  /var/lib/mod_tile/ to 777
restarted apache and executed the renderd..it started working.

FOR TILE GENERATION USING MAPNIK
it has a script generate_image.py  and generate_tiles.py  which generates image or set of tiles using the bounding box and the number of zoom levels for which you want to generate ...and it starts generating tiles on the path that you set to write on

Offline

Board footer

Powered by FluxBB