mod_mbtiles icon indicating copy to clipboard operation
mod_mbtiles copied to clipboard

Order of lines in the configuration file determines whether apache starts or not?

Open SomeoneElseOSM opened this issue 2 years ago • 2 comments

This is on Ubuntu 22.04, and the apache there identifies itself as "Apache/2.4.52 (Ubuntu)"

mod_mbtiles was installed as per https://github.com/systemed/mod_mbtiles#installation ("sudo apt install apache2-dev libsqlite3-dev", then "sudo apxs -lsqlite3 -i -a -c mod_mbtiles.c"). It was happily serving tiles from one .mbtiles file until I tried to add a second. In the "<VirtualHost *:80>" in "000-default.conf" after " DocumentRoot /var/www/html" I have:

MbtilesEnabled true
MbtilesAdd sve01 /var/www/html/vector/sve01/tilemaker_sve01.mbtiles
MbtilesAdd omt_ny /var/www/html/vector/omt_ny/tilemaker_omt_ny.mbtiles

This fails, and "systemctl status apache2.service" says it failed with a fairly unhelpful "Segmentation fault (core dumped)". However, if I swap the entries around:

MbtilesEnabled true
MbtilesAdd omt_ny /var/www/html/vector/omt_ny/tilemaker_omt_ny.mbtiles
MbtilesAdd sve01 /var/www/html/vector/sve01/tilemaker_sve01.mbtiles

Apache is a happy bunny! I have not changed https://github.com/systemed/mod_mbtiles/blob/master/mod_mbtiles.c , and it still has "#define MAX_TILESETS 20" in it. In addition to the various modules installed by default I also have "LoadModule tile_module /usr/lib/apache2/modules/mod_tile.so" for raster tiles.

The also error occurs (with the entries the other way around) if I use two "known good" mbtiles files (two differently named copies of the same working one).

SomeoneElseOSM avatar Sep 30 '23 18:09 SomeoneElseOSM

Just to add some more examples...

"OK" means that Apache restarts OK with the lines in the /etc/apache2/sites-available/000-default.conf file as described. "fail" means that it doesn't. It's not random, it appears to be entirely predictable based on the current state of 000-default.conf .

MbtilesEnabled true MbtilesAdd omt_ny /var/www/html/vector/omt_ny/tilemaker_omt_ny.mbtiles MbtilesAdd sve01 /var/www/html/vector/sve01/tilemaker_sve01.mbtiles restarts OK

MbtilesEnabled true MbtilesAdd sve01 /var/www/html/vector/sve01/tilemaker_sve01.mbtiles MbtilesAdd omt_ny /var/www/html/vector/omt_ny/tilemaker_omt_ny.mbtiles restart fail

MbtilesEnabled true MbtilesAdd omt_ny /var/www/html/vector/omt_ny/tilemaker_omt_ny.mbtiles MbtilesAdd sve01 /var/www/html/vector/sve01/tilemaker_sve01.mbtiles restart OK

MbtilesEnabled true MbtilesAdd omt_ny /var/www/html/vector/omt_ny/tilemaker_omt_ny.mbtiles MbtilesAdd nve01 /var/www/html/vector/sve01/tilemaker_sve01.mbtiles restart OK

MbtilesEnabled true MbtilesAdd sve01 /var/www/html/vector/omt_ny/tilemaker_omt_ny.mbtiles MbtilesAdd omt_ny /var/www/html/vector/sve01/tilemaker_sve01.mbtiles restart OK

MbtilesEnabled true MbtilesAdd omt_ny /var/www/html/vector/sve01/tilemaker_sve01.mbtiles MbtilesAdd sve01 /var/www/html/vector/omt_ny/tilemaker_omt_ny.mbtiles restart OK

MbtilesEnabled true MbtilesAdd sve01 /var/www/html/vector/sve01/tilemaker_sve01.mbtiles MbtilesAdd omt_ny /var/www/html/vector/omt_ny/tilemaker_omt_ny.mbtiles restart fail

MbtilesEnabled true MbtilesAdd sve01 /var/www/html/vector/sve01/tilemaker_sve01.mbtiles MbtilesAdd pmt_ny /var/www/html/vector/omt_ny/tilemaker_omt_ny.mbtiles fail

MbtilesEnabled true MbtilesAdd sve01 /var/www/html/vector/sve01/tilemaker_sve01.mbtiles MbtilesAdd tmt_ny /var/www/html/vector/omt_ny/tilemaker_omt_ny.mbtiles fail

MbtilesEnabled true MbtilesAdd sve01 /var/www/html/vector/sve01/tilemaker_sve01.mbtiles MbtilesAdd amt_ny /var/www/html/vector/omt_ny/tilemaker_omt_ny.mbtiles fail

MbtilesEnabled true MbtilesAdd a /var/www/html/vector/sve01/tilemaker_sve01.mbtiles MbtilesAdd b /var/www/html/vector/omt_ny/tilemaker_omt_ny.mbtiles OK

MbtilesEnabled true MbtilesAdd c /var/www/html/vector/sve01/tilemaker_sve01.mbtiles MbtilesAdd d /var/www/html/vector/omt_ny/tilemaker_omt_ny.mbtiles OK

MbtilesEnabled true MbtilesAdd c /var/www/html/vector/sve01/tilemaker_sve01.mbtiles MbtilesAdd omt_ny /var/www/html/vector/omt_ny/tilemaker_omt_ny.mbtiles OK

MbtilesEnabled true MbtilesAdd sve0 /var/www/html/vector/sve01/tilemaker_sve01.mbtiles MbtilesAdd omt_ny /var/www/html/vector/omt_ny/tilemaker_omt_ny.mbtiles OK

MbtilesEnabled true MbtilesAdd tilem /var/www/html/vector/sve01/tilemaker_sve01.mbtiles MbtilesAdd omt_ny /var/www/html/vector/omt_ny/tilemaker_omt_ny.mbtiles fail

MbtilesEnabled true MbtilesAdd tilen /var/www/html/vector/sve01/tilemaker_sve01.mbtiles MbtilesAdd omt_ny /var/www/html/vector/omt_ny/tilemaker_omt_ny.mbtiles fail

MbtilesEnabled true MbtilesAdd tilema /var/www/html/vector/sve01/tilemaker_sve01.mbtiles MbtilesAdd omt_ny /var/www/html/vector/omt_ny/tilemaker_omt_ny.mbtiles OK

SomeoneElseOSM avatar Mar 03 '24 10:03 SomeoneElseOSM

Bizarrely another "fix" for this problem is to add ap_log_error(APLOG_MARK, APLOG_ERR, 0, cmd->server, "wibble");

after const char *mbtiles_add_path(cmd_parms *cmd, void *cfg, const char *name, const char *path) {

I've no idea where the log output actually goes (it doesn't appear in "journalctl -ef" (syslog).

SomeoneElseOSM avatar Jul 30 '25 00:07 SomeoneElseOSM