dir-listing vs. index-file
I don't know if this is a documentation "bug", or a real bug -- I'm not sure what the true intent of the feature interaction is now.
According to the docs (i.e. those distributed with the version I'm running, i.e. 1.4.20):
"A directory listing is generated if a directory is requested and no index-file
was found in that directory."
However it seems to me that dir-listing takes precedence over index-file as whenever I turn on dir-listing.activate I always get directory listings even when any (or all!) of the index-file.names files are present in the requested directory.
I think if for nothing else than compatibility with Apache this is actually a code bug -- i.e. the docs should be right.
(Note I'm running a fully static-linked lighttpd built with -DLIGHTTPD_STATIC.)
#2 Updated by woods almost 8 years ago
if module loading order is important in this issue, then I would say that's a very serious bug!
I find it amazing that I have to point out that mod_dirlisting and mod_indexfile are always pre-loaded.
So, this problem should occur for dynamic-linked versions too since it is impossible to dynamically load them, especially in any different order.
From the server-config page the "loaded modules" table shows:
If this is the order they are "loaded" in (instead of what appears to be an alphabetically sorted output list) then it would seem as if the build system ignores the documented constraints for module loading order. Sigh. This kind of bug should be easily caught in early simple testing.
(BTW, static-linking is a necessary feature for many secure and embedded environments -- not fully supporting it also a serious bug in my estimation.)
#3 Updated by woods almost 8 years ago
At the moment the following manually generated "src/plugin-static.h" file seems to do the trick, though I've nowhere near tested all functionality yet -- just the minimum my site requires. #ifdefs are not used for PCRE or libz because my pkgsrc module requires those as non-optional dependencies. The opening comment is of course from the (inadequate, IMO) docs.
* The modules are executed in the order as they are specified. Loading
* mod_auth AFTER mod_fastcgi might disable authentication for fastcgi
* backends (if check-local is disabled).
* As auth should be done first, move it before all executing modules (like
* proxy, fastcgi, scgi and cgi).
* rewrites, redirects and access should be first, followed by auth and
* the docroot plugins.
* Afterwards the external handlers like fastcgi, cgi, scgi and proxy and
* at the bottom the post-processing plugins like mod_accesslog.
PLUGIN_INIT(mod_rewrite) /* PCRE /
PLUGIN_INIT(mod_redirect) / PCRE */
PLUGIN_INIT(mod_auth) /* CRYPT LDAP LBER */
PLUGIN_INIT(mod_magnet) /* LUA */
* indexfile must come before dirlisting for dirlisting not to override
PLUGIN_INIT(mod_mysql_vhost) /* MySQL */
PLUGIN_INIT(mod_ssi) /* PCRE */
* staticfile must come after cgi/ssi/et al.
PLUGIN_INIT(mod_cml) /* MEMCACHE LUA LUALIB */
PLUGIN_INIT(mod_trigger_b4_dl) /* PCRE */
PLUGIN_INIT(mod_webdav) /* XML2 SQLITE3 UUID */
* post-processing modules
PLUGIN_INIT(mod_compress) / Z BZ2 */
Fixed. modules are now loaded in the order specified in the config file (lighttpd.conf)
commit b66fa2cb68a7c0ca6fae280bd71662d5ddce8c24 Author: Stefan Bühler <email@example.com> Date: Sat Aug 29 09:28:01 2015 +0000 [plugins] when modules are linked statically still only load the modules given in the config - previously it would load all modules in some fixed order - also warn when mod_magnet or mod_trigger_b4_dl are compiled without needed dependencies - mod_trigger_b4_dl fails in plugin_init when dependencies are missing From: Stefan Bühler <firstname.lastname@example.org> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3029 152afb58-edef-0310-8abb-c4023f1b3aa9
If mod_indexfile and mod_dirlisting (and mod_staticfile) are not specified in the lighttpd.conf, they are added, with mod-indexfile being prepended to the modules list and mod_dirlisting and mod_staticfile being appended to the modules list.
Note: even if mod_indexfile and mod_dirlisting are always loaded, neither is active until configured in the configuration file. For mod_indexfile, this involves specifying the index file names. For mod_dirlisting, this requires dir-listing.activate = "enable"
Also available in: Atom