Ubuntu 14.04 & tile server nightmare - not giving up!

Having HUGE problems setting up Open Street Maps on my Ubuntu 14.04 setup.

All the software is up to date and is kept up to date, so obsolete software is not a problem. All dependencies were installed after a bit of a wrestling match with libgdal and how the multiple versions are forking annoying.

I initially (4 days ago) started with the tutorial http://switch2osm.org/serving-tiles/manually-building-a-tile-server-12-04/ . I was able to get everything to compile error free and get Mapnik going to generate_image.py and such by following the instructions from switch2osm to set up all access in the PostgreSQL “gis” database to my local user account (astump) as well as setting the owner of the gis database to my user account, making a minor adjustment as apache2 no longer uses the conf.d folder and instead uses mods-enabled/mod_tile.load – and a similar minor nuisance as /etc/apache2/sites-available/default is now known as /etc/apache2/sites-available/000-default.conf

I was able to get /etc/init.d/renderd to start and not produce any errors other than the ones because some lines are commented out on purpose. Yay!

Problem is – upon visiting http://localhost/osm_tiles/0/0/0.png I only saw a “Page not found” error. Pulling up the tiles in the freely available Slippytile pointing them to localhost gives image not found boxes, as well.

So I found another great tutorial at http://seshagiriprabhu.wordpress.com/2013/07/21/building-an-openstreetmap-tile-server-on-ubuntu-12-04-lts/ and after uninstalling everything, and reinstalling everything, and uninstalled everything again, over about 5 times and per the tutorial and everything I read online, decided to use all the steps from the switch2osm tutorial but change the user to www-data per the 2nd tutorial changing the owner to “www-data” on all tables in postgres gis database, as well as chown –R www-data /var/run/renderd and /var/lib/mod_tile I was able to get the command “ sudo –u www-data renderd –f –c /usr/local/etc/renderd.conf “ to run flawlessly.

First immediate problem is /var/run/ apparently resets permissions on every reboot, so the sudo chown www-data -R that was ran on /var/run/renderd was lost upon reboot. So I had to change this again after rebooting, and again, it worked but no tiles found, etc.

What sucks is because renderd even with –f on, shows no errors – I have no idea what is going wrong. Apache’s error & access logs are not giving any hints, either. And further – when I run the initial /etc/init.d/renderd service (under my account as that is what it inherits) – it produces no errors, either!

Here are config file snippets that are applicable – not sure if I missed something obvious or not:

(/home/astump/src/mapnik-style/inc/datasource-settings.xml.inc)

postgis
#####HIDDEN BUT SET######
localhost

www-data
gis

false

-20037508,-19929239,20037508,19929239

(/home/astump/src/mapnik-style/inc/settings.xml.inc)

(/usr/local/etc/renderd.conf)

[renderd]
socketname=/var/run/renderd/renderd.sock
num_threads=4
tile_dir=/var/lib/mod_tile
stats_file=/var/run/renderd/renderd.stats
[mapnik]
plugins_dir=/usr/local/lib/mapnik/input
font_dir=/usr/share/fonts/truetype/ttf-dejavu
font_dir_recurse=1
[default]
URI=/osm_tiles/
TILEDIR=/var/lib/mod_tile
XML=/home/astump/src/mapnik-style/osm.xml
HOST=localhost
TILESIZE=256

(/etc/apache2/sites-available/000-default.conf)

ServerAdmin webmaster@localhost
    DocumentRoot /var/www
    LoadTileConfigFile /usr/local/etc/renderd.conf
    ModTileRenderedSocketName /var/run/renderd/renderd.sock
    ModTileRequestTimeout 0
    ModTileMissingRequestTimeout 30

The PBF I am using is from Metro Extracts http://osm-extracted-metros.s3.amazonaws.com/chicago.osm.pbf

I guess this is quite the puzzler. Still can’t figure it out. Changed the settings / config all back to my default user account per first guide but still no progress - 0 tile requests, page not found on localhost/osm_tiles/0/0/0.png

Still having problems. Today I verified that in fact “www-data” can connect with provided password to gis by creating a PHP PDO connection to the gis database, so I know database connectivity is not an issue.

The command “renderd -f –c /usr/local/etc/renderd.conf” returns absolutely zero errors except due to the fact the renderd.conf file is commented out in parts, and absolutely zero messages when attempting to access the tile server at localhost/osm_tiles/0/0/0.png – just a page not found error in the web browser, and 0 requests being sent.

renderd[12238]: Rendering daemon started
renderd[12238]: Initiating reqyest_queue
iniparser: syntax error in /usr/local/etc/renderd.conf (7):
→ ;[renderd01]
iniparser: syntax error in /usr/local/etc/renderd.conf (14):
→ ;[renderd02]
iniparser: syntax error in /usr/local/etc/renderd.conf (33):
→ ;** config options used by mod_tile, but not renderd **
iniparser: syntax error in /usr/local/etc/renderd.conf (44):
→ ;[style2]
iniparser: syntax error in /usr/local/etc/renderd.conf (51):
→ ;** config options used by mod_tile, but not renderd **
renderd[12238]: Parsing section renderd
renderd[12238]: Parsing render section 0
renderd[12238]: Parsing section mapnik
renderd[12238]: Parsing section default
renderd[12238]: config renderd: unix socketname=/var/run/renderd/renderd.sock
renderd[12238]: config renderd: num_threads=4
renderd[12238]: config renderd: num_slaves=0
renderd[12238]: config renderd: tile_dir=/var/lib/mod_tile
renderd[12238]: config renderd: stats_file=/var/run/renderd/renderd.stats
renderd[12238]: config mapnik: plugins_dir=/usr/local/lib/mapnik/input
renderd[12238]: config mapnik: font_dir=/usr/share/fonts/truetype/ttf-dejavu
renderd[12238]: config mapnik: font_dir_recurse=1
renderd[12238]: config renderd(0): Active
renderd[12238]: config renderd(0): unix socketname=/var/run/renderd/renderd.sock
renderd[12238]: config renderd(0): num_threads=4
renderd[12238]: config renderd(0): tile_dir=/var/lib/mod_tile
renderd[12238]: config renderd(0): stats_file=/var/run/renderd/renderd.stats
renderd[12238]: config map 0: name(default) file(/home/astump/src/mapnik-style/osm.xml) uri(/osm_tiles/) htcp() host(localhost)
renderd[12238]: Initialising unix server socket on /var/run/renderd/renderd.sock
renderd[12238]: Created server socket 4
renderd[12238]: Renderd is using mapnik version 2.0.3
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerifCondensed-Italic.ttf
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerifCondensed-Bold.ttf
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Oblique.ttf
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-Italic.ttf
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Oblique.ttf
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-BoldItalic.ttf
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerifCondensed.ttf
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-BoldOblique.ttf
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-ExtraLight.ttf
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-Bold.ttf
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-BoldOblique.ttf
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed.ttf
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed-Bold.ttf
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed-Oblique.ttf
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerifCondensed-BoldItalic.ttf
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed-BoldOblique.ttf
renderd[12238]: DEBUG: Loading font: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Bold.ttf
Running in foreground mode…
renderd[12238]: Starting stats thread
debug: init_storage_backend: initialising file storage backend at: /var/lib/mod_tile
renderd[12238]: Loading parameterization function for
renderd[12238]: Loading parameterization function for
backend at: /var/lib/mod_tile
debug: init_storage_backend: initialising file storage backend at: /var/lib/mod_tile
renderd[12238]: Loading parameterization function for
renderd[12238]: Using web mercator projection settings
renderd[12238]: Using web mercator projection settings
renderd[12238]: Using web mercator projection settings
renderd[12238]: Using web mercator projection settings

Ok - a bit of progress here and possible reason why things are not working. Finally figured out I have to run a2ensite on 000-default to get the mod tile config in place. Upon doing so I receive the following:

astump@astump-EX58-UD4P:~$ service apache2 reload

  • Reloading web server apache2 *
  • The apache2 configtest failed. Not doing anything.
    Output of config test was:
    [Fri Jun 13 22:18:15.219624 2014] [tile:notice] [pid 9476] Loading tile config default at /osm_tiles/ for zooms 0 - 20 from tile directory /var/lib/mod_tile with extension .png and mime type image/png
    AH00526: Syntax error on line 14 of /etc/apache2/sites-enabled/000-default.conf:
    Invalid command ‘ModTileRenderedSocketName’, perhaps misspelled or defined by a module not included in the server configuration
    Action ‘configtest’ failed.
    The Apache error log may have more information.

I misspelled Renderd… DOH!

After I corrected the typo it successfully reloaded and works!

i got the same problem, did you solved this???