I set up a tileserver with the following configuration:
mod_tile (apache2) config:
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers,Authorization"
# Renderd configution
LoadTileConfigFile /usr/local/renderd/renderd.conf
ModTileEnableStats On
ModTileEnableStatusURL On
ModTileBulkMode On
ModTileRequestTimeout 0
ModTileMissingRequestTimeout 60
ModTileMaxLoadOld 1000
ModTileMaxLoadMissing 1000
ModTileRenderdSocketName /var/run/renderd/renderd.sock
ModTileCacheDurationMax 60480000000
ModTileCacheDurationMinimum 908000000
ModTileCacheDurationDirty 900
ModTileCacheDurationLowZoom 9 5184000
ModTileCacheLastModifiedFactor 0.20
ModTileEnableTileThrottling Off
#LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias /mapproxy /usr/local/mapproxy/config.py
WSGIDaemonProcess mapproxy-wsgi-daemon processes=16 threads=8
WSGIApplicationGroup %{GLOBAL}
RewriteEngine on
RewriteRule ^/([0-9]+)/([0-9]+)/([0-9]+).png /osm_tiles/$1/$2/$3.png [PT]
<VirtualHost *:80>
ServerAlias CC-GEO01.eurofunk.com
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
<Directory /usr/local/mapproxy>
Order deny,allow
Allow from all
Require all granted
</Directory>
</VirtualHost>
and renderd.conf:
[renderd]
pid_file=/var/run/renderd/renderd.pid
stats_file=/var/run/renderd/renderd.stats
socketname=/var/run/renderd/renderd.sock
num_threads=20
tile_dir=/usr/local/renderd/cache
MAXZOOM=20
[mapnik]
plugins_dir=/usr/lib/mapnik/3.1/input
font_dir=/usr/share/fonts
font_dir_recurse=true
[default]
URI=/tile/
XML=/usr/local/mapnik/openstreetmap-carto/CARTO_DE_AT_CH.xml
HOST=CC-GEO01.eurofunk.com
TILEDIR=/usr/local/renderd/cache
MINZOOM=0
MAXZOOM=20
[topo]
URI=/topo/
XML=/usr/local/mapnik/OpenTopoMap/mapnik/opentopomap.xml
HOST=CC-GEO01.eurofunk.com
TILEDIR=/usr/local/renderd/cache
MINZOOM=0
MAXZOOM=20
I renderd my extend OSM - Tile Calculator (WGS84: 5.05 45.71 17.75 55.32 or EPSG:3857 562163 5733998 1975921 7424221) one time from Z0 to Z18 with render_list_geo.pl which uses render_list.
Updading works with pyosmium. I update the database every 5 minutes. With this script i also rerender the updated tiles from Z15 to Z18. With this setup i dont want to get my tiles expired since they get updated by my script automatically. With this command rerendering is done:
/usr/local/bin/render_expired -t /usr/local/renderd/cache --map=default --min-zoom=15 --max-zoom=18 -s /run/renderd/renderd.sock < /usr/local/renderd/scripts/pyosmium/dirty_tiles.txt > render_expired.$$ 2>&1
But they get expired. When i jump around the map mod_tile tells renderd to rerender some tiles although they already exist.
What i tried:
- Updating mod_tile configuration to the tiles never get expired
- Creating a planet-import-complete file unter /usr/local/renderd/cache/default and /usr/local/renderd/cache/topo with a timestamp from 2015. I found this option in some other threads but it did not help
Can someone tell me how to tell me how to tell mod_tile not to auto expire tiles. Thanks in advance.
P.S.: one addition to the render_expired command:
at the beginning of my setup the command looked like this:
/usr/local/bin/render_expired -t /usr/local/renderd/cache --map=default --min-zoom=15 --touch-from 15 --delete-from 15 --max-zoom=19 -s /run/renderd/renderd.sock < /usr/local/renderd/scripts/pyosmium/dirty_tiles.txt > render_expired.$$ 2>&1
I assume the --delete-from and --touch-from deleted me the expired files which were missing afterwards. Since i removed this now i hope this command does not delete the expired tiles automatically.