Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merging per-server and per-virtualhost config is buggy #188

Open
woodpeck opened this issue Aug 28, 2018 · 6 comments
Open

merging per-server and per-virtualhost config is buggy #188

woodpeck opened this issue Aug 28, 2018 · 6 comments

Comments

@woodpeck
Copy link
Contributor

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 with create_tile_config and merge_tile_config which I need to debug further.

@amandasaurus
Copy link
Contributor

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.

@amandasaurus
Copy link
Contributor

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

@amandasaurus
Copy link
Contributor

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

@amandasaurus
Copy link
Contributor

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.

@SomeoneElseOSM
Copy link
Contributor

@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".

@amandasaurus
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants