Open woodpeck opened 6 years ago
Subscribing because I had to debug a problem caused by this. The config was like this, with a /etc/apache2/confs-enabled/tileserver.conf
for many mod_tile
directives, but inside a <VirtualHost>
there was a few AddTileConfig
directives.
The tile server worked for the first ~100 tile requests, and then it seemed to look for /var/run/renderd/renderd.sock
. Since we don't use renderd, it causes 404s for all tiles. The solution was to put ModTileRenderdSocketName
in the <VirtualHost>
too.
This bug can be reproduced with this apache config:
ModTileRenderdSocketName /run/tirex/modtile.sock
ModTileTileDir /var/cache/tirex/tiles
AddTileConfig /tiles/test test
<VirtualHost *:80>
DocumentRoot /var/www/html
LogLevel tile:debug
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
#AddTileConfig /tiles/test3 test
</VirtualHost>
Running tirex with just a test
config.
Get the tile works fine
sudo systemctl reload apache2 ; sudo rm /var/cache/tirex/tiles/test/0/0/0/0/0/0.meta ; curl localhost/tiles/test/0/0/0.png
Uncomment the #AddTileConfig
and it will break and lose the socket name
in the create_tile_config
, mod_tile will fill the the config with the default hard coded values, and then the apache directives will set them. so in the above case, the virtualhost will get a freshly created config, and that will be merged with the serverwide config and the hardcoded renderd socket name will be used
I think if you put any config directives in a VirtualHost
section, then any config options that you have set outside that are lost and replaced with the compiled in default values.
@amandasaurus It'd probably help to know what OS you'd hit the problem on - my recollection (albeit from some time ago) is that Ubuntu is that significantly different from Debian in how Apache conf files are set up by default, which has a knock-on effect of "what includes what from where".
this bug is visible on debian & ubuntu. Sorry for the comment spam, I am writing things down here because previously we have forgotten what the problem was.
When you have some configuration options inside a
<VirtualHost>...</VirtualHost>
block in Apache, and some others outside (e.g. in a Debian-type "conf_enabled/tileserver.conf" file), then things break and mod_tile reverts to default settings for some things. This is likely due to an issue withcreate_tile_config
andmerge_tile_config
which I need to debug further.