Lighttpd-mod-simple_vhost issue after update to 3.10.6 / 3.10.7

Since Luci no longer seemed to work on my Omnia, I did a little digging, and noticed the following errors when starting lighttpd: [typos possible, since I was unable to copy/paste]

Undefined config variable: var.vhosts_dir
2018-10-03 09:43:50: (configfile.c.1289) source: /etc/lighttpd/modules.d/30-simple_vhost.load line: 18 pos: 45 parser failed somehow near here: *
2018-10-03 09:43:50:(configfile.c.1289) source: /etc/lighttpd/lighttpd.conf line: 37 pos: 8 parser failed somehow near here: (EOL)

After uninstalling package lighttpd-mod-simple_vhost this problem went away, and lighttpd started again. I don’t remember if I installed this module in an experiment to serve a website to external users (which failed in the end, so I opted for nginx), or if it’s part of the standard installation.

i had this issue as well … (setenv, alias, simple_vhost)

The variable vhosts_dir needs to be declared before the 30-simple_vhost.conf.

As a solution: create a file /etc/lighttpd/conf.d/10-vars.conf with something like:

var.vhosts_dir := "/mnt/disk/www"
simple-vhost.debug := 1

Then restart the lighttpd with /etc/init.d/lighttpd restart or start it manually with lighttpd -D -f /etc/lighttpd/lighttpd.conf.

Then you can watch logs with tail -f /var/log/lighttpd/error.log and reload a page in a browser. You’ll see something like:

(../src/mod_simple_vhost.c.164) /mnt/disk/www//192.168.1.1/htdocs/: No such file or directory

E.g. the lighttpd tried to find a folder for the IP but didn’t found and used the default server.document-root = "/www" that contains LUCI/reForis

The same issue for webdav which uses home_dir variable that is not declared.
The Lighttpd piss me off: if something wrong in config then it refuses to start and default configs for modules are broken.

UPD in nest versions of the lighttpd package the all needed variables will be set and the problem should never occur again

1 Like