[OSM-dev] Mod_tile - apache 404 - no tiles please help

Jon Burgess jburgess777 at gmail.com
Tue Nov 2 22:24:51 GMT 2010


On Fri, 2010-10-29 at 06:26 -0700, NicoG wrote:
> Hi everyone,
> 
> i'm setting up a local OSM server on a Debian Lenny 32bit for 3 days, and
> now i need some help with mod_tile ;)
> 
> I've installed the postgresql database, postgis, osm2pgsql and mapnik tools
> correctly (i think :)
> generate_image.py works well, i can generate static png without problems !
> 
> Now i'm trying to set up Mod_tile for rendering and thats a curse for me !
> (i'm not a linux professional).
> 

See some of the comments in-line below...

> i get mod_tile from SVN ;
> This is how i've setup mod_tile and apache (long list but complete)
> 
> ---------------------
> MOD TILE
> Makefile
> top_dir:=$(shell /usr/bin/apxs2 -q exp_installbuilddir) 
> APXS = apxs2
> ---------------------
> render_config.h
> #define HASH_PATH "var/lib/mod_tile"

Should that be:

#define HASH_PATH "/var/lib/mod_tile"

> #define TILE_PATH "/var/www/osm_tiles2"

This path should only get used if you have unset '#define
DIRECTORY_HASH' which you don't mention. Are you using the directory
hashing?

> #define RENDERD_CONFIG "/etc/renderd.conf"
> #define MAPNIK_PLUGINS "/usr/local/lib/mapnik/input"
> #define FONT_DIR "/usr/share/fonts/truetype/ttf-dejavu/"
> #define FONT_RECURSE 1
> ---------------------
> renderd.conf (the one in mod_tile folder)
> [renderd]
> socketname=/var/run/renderd/renderd.sock
> num_threads=2
> 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=/osm_tiles2/
> XML=/root/travaux/osm-mapnik/osm.xml
> HOST=geolocalisation.renater.fr
> ;HTCPHOST=proxy.openstreetmap.org
> 
> -----------------------------------
> 
> i've done make, make install
> 
> the /etc/renderd.conf look like the one above
> 
> -----------------------------------
> APACHE : 
> in /etc/apache2/mods_available i have a file mod_tile.load with this line :
> LoadModule tile_module /usr/lib/apache2/modules/mod_tile.so
> 
> and i've loaded it : a2enmod mod_tile
> 
> in /etc/apache2:site_available i have a site 'osm' with this lines:
> DocumentRoot /var/www
> AddTileConfig /osm_tiles2/ default
> LoadTileConfigFile /etc/renderd.conf
> ModTileTileDir /var/lib/mod_tile
> ModTileRenderdSocketName /var/run/renderd/renderd.sock
> 
> the module is loaded successfully with apache (apache2ctl -t -D
> DUMP_MODULES) 
> the socket file /var/run/renderd/renderd.sock exist.

Are you certain the apache user (often apache or www-data depending on
your OS) has write access to this file, try:

$ sudo -u www-data ls -l /var/run/renderd/renderd.sock

If you have SELinux enabled then this also prevents the apache process
from connecting to a socket. You may find errors being reported in your
Apache error_log file. If you enable the informational logging in Apache
then you should see more output from the module as it processes the
incoming requests.


> ---------------------------
> RENDER DEAMON 
> when i launch the render deamon :  ./renderd -f
> 
> renderd[5948]: Rendering daemon started
> renderd[5948]: Parsing section renderd
> renderd[5948]: Parsing render section 0
> renderd[5948]: Parsing section mapnik
> renderd[5948]: Parsing section default
> renderd[5948]: config renderd: unix socketname=/var/run/renderd/renderd.sock
> renderd[5948]: config renderd: num_threads=2
> renderd[5948]: config renderd: num_slaves=0
> renderd[5948]: config renderd: tile_dir=/var/lib/mod_tile/
> renderd[5948]: config renderd: stats_file=(null)
> renderd[5948]: config mapnik:  plugins_dir=/usr/local/lib/mapnik/input
> renderd[5948]: config mapnik: 
> font_dir=/usr/share/fonts/truetype/ttf-dejavu/
> renderd[5948]: config mapnik:  font_dir_recurse=1
> renderd[5948]: config renderd(0): Active
> renderd[5948]: config renderd(0): unix
> socketname=/var/run/renderd/renderd.sock
> renderd[5948]: config renderd(0): num_threads=2
> renderd[5948]: config renderd(0): tile_dir=/var/lib/mod_tile/
> renderd[5948]: config renderd(0): stats_file=(null)
> renderd[5948]: config map 0:   name(default)
> file(/root/travaux/osm/osm-mapnik/osm.xml) uri(/osm_tiles2/) htcp()
> host(geolocalisation.renater.fr)
> renderd[5948]: Initialising unix server socket on
> /var/run/renderd/renderd.sock
> renderd[5948]: Created server socket 4

> ------------------------
> 
> Nothing happends in the deamon when i'm trying to access at
> http://localhost/osm_tiles2/0/1/2.png
> 
> did i forget something ? thx you for your help
> 
> Nicolas

The renderd output looks OK.

You could also see if the module responds to status requests via the
URL: http://localhost/mod_tile

If it works then you should see some output about the number of requests
it has processed:

NoResp200: 38408489
NoResp304: 1574321
NoResp404: 4257
...

   Jon






More information about the dev mailing list