-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod_tile.conf
154 lines (109 loc) · 6.17 KB
/
mod_tile.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# 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.production.commonmap.org
ServerAlias a.tile.production.commonmap.org b.tile.production.commonmap.org c.tile.production.commonmap.org d.tile.production.commonmap.org
DocumentRoot /var/www/commonmap/tile/public
RewriteEngine On
# RewriteLogLevel 1
# RewriteLog /var/log/httpd/rewrite_tile_log
# Allows MGMaps to browse the local tile coverage
# One for each zoom level, as zoom numbers are reversed
RewriteCond %{QUERY_STRING} ^x=(.*)&y=(.*)&zoom=-2$
RewriteRule /tile/commonmapnik.gmap /19/%1/%2.png? [L,P]
RewriteCond %{QUERY_STRING} ^x=(.*)&y=(.*)&zoom=-1$
RewriteRule /tile/commonmapnik.gmap /18/%1/%2.png? [L,P]
RewriteCond %{QUERY_STRING} ^x=(.*)&y=(.*)&zoom=0$
RewriteRule /tile/commonmapnik.gmap /17/%1/%2.png? [L,P]
RewriteCond %{QUERY_STRING} ^x=(.*)&y=(.*)&zoom=1$
RewriteRule /tile/commonmapnik.gmap /16/%1/%2.png? [L,P]
RewriteCond %{QUERY_STRING} ^x=(.*)&y=(.*)&zoom=2$
RewriteRule /tile/commonmapnik.gmap /15/%1/%2.png? [L,P]
RewriteCond %{QUERY_STRING} ^x=(.*)&y=(.*)&zoom=3$
RewriteRule /tile/commonmapnik.gmap /14/%1/%2.png? [L,P]
RewriteCond %{QUERY_STRING} ^x=(.*)&y=(.*)&zoom=4$
RewriteRule /tile/commonmapnik.gmap /13/%1/%2.png? [L,P]
RewriteCond %{QUERY_STRING} ^x=(.*)&y=(.*)&zoom=5$
RewriteRule /tile/commonmapnik.gmap /12/%1/%2.png? [L,P]
RewriteCond %{QUERY_STRING} ^x=(.*)&y=(.*)&zoom=6$
RewriteRule /tile/commonmapnik.gmap /11/%1/%2.png? [L,P]
RewriteCond %{QUERY_STRING} ^x=(.*)&y=(.*)&zoom=7$
RewriteRule /tile/commonmapnik.gmap /10/%1/%2.png? [L,P]
RewriteCond %{QUERY_STRING} ^x=(.*)&y=(.*)&zoom=8$
RewriteRule /tile/commonmapnik.gmap /9/%1/%2.png? [L,P]
RewriteCond %{QUERY_STRING} ^x=(.*)&y=(.*)&zoom=9$
RewriteRule /tile/commonmapnik.gmap /8/%1/%2.png? [L,P]
RewriteCond %{QUERY_STRING} ^x=(.*)&y=(.*)&zoom=10$
RewriteRule /tile/commonmapnik.gmap /7/%1/%2.png? [L,P]
RewriteCond %{QUERY_STRING} ^x=(.*)&y=(.*)&zoom=11$
RewriteRule /tile/commonmapnik.gmap /6/%1/%2.png? [L,P]
RewriteCond %{QUERY_STRING} ^x=(.*)&y=(.*)&zoom=12$
RewriteRule /tile/commonmapnik.gmap /5/%1/%2.png? [L,P]
RewriteCond %{QUERY_STRING} ^x=(.*)&y=(.*)&zoom=13$
RewriteRule /tile/commonmapnik.gmap /4/%1/%2.png? [L,P]
RewriteCond %{QUERY_STRING} ^x=(.*)&y=(.*)&zoom=14$
RewriteRule /tile/commonmapnik.gmap /3/%1/%2.png? [L,P]
RewriteCond %{QUERY_STRING} ^x=(.*)&y=(.*)&zoom=15$
RewriteRule /tile/commonmapnik.gmap /2/%1/%2.png? [L,P]
RewriteCond %{QUERY_STRING} ^x=(.*)&y=(.*)&zoom=16$
RewriteRule /tile/commonmapnik.gmap /1/%1/%2.png? [L,P]
RewriteCond %{QUERY_STRING} ^x=(.*)&y=(.*)&zoom=17$
RewriteRule /tile/commonmapnik.gmap /0/%1/%2.png? [L,P]
# You can either manually configure each tile set
# AddTileConfig /folder/ TileSetName
# or load all the tile sets defined in the configuration file into this virtual host
LoadTileConfigFile /etc/renderd.conf
# Timeout before giving for a tile to be rendered
ModTileRequestTimeout 3
# If tile is out of date, don't re-render it if past this load threshold (users gets old tile)
ModTileMaxLoadOld 2
# If tile is missing, don't render it if past this load threshold (user gets 404 error)
ModTileMaxLoadMissing 5
# Socket where we connect to the rendering daemon
ModTileRenderdSocketName /var/run/renderd/renderd.sock
##
## Options controlling the cache proxy expiry headers. All values are in seconds.
##
## Caching is both important to reduce the load and bandwidth of the server, as
## well as reduce the load time for the user. The site loads fastest if tiles can be
## taken from the users browser cache and no round trip through the internet is needed.
## With minutely or hourly updates, however there is a trade-off between cacheability
## and freshness. As one can't predict the future, these are only heuristics, that
## need tuning.
## If there is a known update schedule such as only using weekly planet dumps to update the db,
## this can also be taken into account through the constant PLANET_INTERVAL in render_config.h
## but requires a recompile of mod_tile
## The values in this sample configuration are not the same as the defaults
## that apply if the config settings are left out. The defaults are more conservative
## and disable most of the heuristics.
# Upper bound on the length a tile will be set cacheable, which takes
# precedence over other settings of cacheing
ModTileCacheDurationMax 604800
# Sets the time tiles can be cached for that are known to by outdated and have been
# sent to renderd to be rerendered. This should be set to a value corresponding
# roughly to how long it will take renderd to get through its queue. There is an additional
# fuzz factor on top of this to not have all tiles expire at the same time
ModTileCacheDurationDirty 900
# Specify the minimum time mod_tile will set the cache expiry to for fresh tiles. There
# is an additional fuzz factor of between 0 and 3 hours on top of this.
ModTileCacheDurationMinimum 10800
# Lower zoom levels are less likely to change noticeable, so these could be cached for longer
# without users noticing much.
# The heuristic offers three levels of zoom, Low, Medium and High, for which different minimum
# cacheing times can be specified.
#Specify the zoom level below which Medium starts and the time in seconds for which they can be cached
ModTileCacheDurationMediumZoom 13 86400
#Specify the zoom level below which Low starts and the time in seconds for which they can be cached
ModTileCacheDurationLowZoom 9 518400
# A further heuristic to determine cacheing times is when was the last time a tile has changed.
# If it hasn't changed for a while, it is less likely to change in the immediate future, so the
# tiles can be cached for longer.
# For example, if the factor is 0.20 and the tile hasn't changed in the last 5 days, it can be cached
# for up to one day without having to re-validate.
ModTileCacheLastModifiedFactor 0.20
###
###
# increase the log level for more detailed information
LogLevel debug
</VirtualHost>