[mod_tile] Use X-Forwarded-For to determine remote IP in tile throttling

If a tileserver is behind a (reverse) proxy server it only sees the IP of the proxy.
So all requests from the proxy get put in the same bucket for tile throttling. Instead, now
use the X-Forwarded-For http header to determine the IP of the originating client.



git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29011 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
[mod_tile] Fix previous X-Forwarded-For commit to support chains of X-Forwarded-For

If there are multiple proxies on the path, then X-Forwarded-For is not a single address, but a list
of addresses.

One can now choose whether one wants to use the first entry in the chain, which should be the client address,
or the last entry in the chain.

The first entry of the chain can't necessarily be trusted, as the client can create its own X-Forwarded-For http header
and thus manipulate the IP that the tileserver would use for throttling.

Using the last entry is particularly useful if one has a reverse proxy in front of the tileserver. In that case the
proxy is under ones own control and can be trusted.



git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29012 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
[mod_tile] Fix missing commas in tilejson spec

Also change the default attribution to reflect the change to ODbL



git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29030 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
[renderd] Mapnik trunc has changed the API on mapnik::datasource_cache::instance()



git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29051 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
[mod_tile] Fix missing va_end 
 
Fixes coverity issue #751708



git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29083 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
[mod_tile] Fix resource leaks during configuration read 
 
Found via coverity scan



git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29084 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
Fix off by one error in string length guard 
 
Fixes coverity scan issue #751697



git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29085 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
[mod_tile] fix memory leaks 
 
Fixes coverity scan issue #746958 and #746957



git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29086 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
[mod_tile] Fix double free bug in tile config loading

Reported by 7bitbyte, diagnosed by fabianpr on help.osm.org



git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29190 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
[mod_tile] log and graph time to retrieve tiles from disk

Adds a munin graph to monitor the average time it takes to retrieve a served tile
from disk. This can be useful to check if the underlying disk system is fast enough
to handle the load of serving tiles. It does not include time required for pontential
rendering on the fly, nor the time to deliver the tile over the network.



git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29195 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
[mod_tile] report atime in /status as well.

Add a warning to the status page that neither create time nor access time might be accurate.

Create time is manipulated by the tile expiry process, and atime is often disabled on the filesytem via noatime
for performance reasons.



git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29196 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
[render_expired] Set back date by exactly 20 years for touch
 based expiry

With a set back of 20 years rather than to a specific date,
the actual render time gets preserved and can be checked in
e.g. mod_tiles tile status



git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29197 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
Correctly print the version string of mapnik in renderd



git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29249 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
Renderd seg faulted if the database connection was reset



git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29256 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
fix tile path

git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29268 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
typo

git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29279 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
[renderd] Make renderd's TCP socket IPv6 compliant



git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29283 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
[mod_tile] Enable mod_tile to connect to renderd via TCP socket

So far mod_tile could only connect to renderd via a unix domain socket.

Renderd was already able to accept tile rendering requests on tcp sockets
to enable it to be distributed accross multiple servers. With adding this
feature to mod_tile, it is now possible to have renderd on a different server
than mod_tile.

If multiple IPs are registered to the renderd dns entry, it supports a simple
form of automatic fail over, although a more sophisticated solution is likely
necessary for proper high availability setups.



git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29284 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
adapt to mapnik >= 2.2.0 which does not provide a default ctor for mapnik::projection

git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29289 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
fix compile with clang

git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29290 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4