Project

General

Profile

Actions

Bug #2343

closed

mod_indexfile not called when lighttpd is statically built

Added by viulian over 12 years ago. Updated about 8 years ago.

Status:
Fixed
Priority:
Normal
Category:
mod_indexfile
Target version:
-
ASK QUESTIONS IN Forums:

Description

I'm trying to crosscompile lighttpd 1.4.29 for ARM platforms.
After figuring out the scons, I managed to get it statically built with the ARM toolchain and it does execute.

However, it does not load the index.php / index.html file even if I properly configured it:

@...
index-file.names += ( "index.php", "index.html" )

debug.log-request-handling = "enable"
...@

I've enabled the log-request-handling and apparently, the mod_indexfile is not called to handle the URL:

...
2011-09-15 14:13:23: (src/response.c.719) -- handling subrequest
2011-09-15 14:13:23: (src/response.c.720) Path : /system/usr/www/htdocs/
2011-09-15 14:13:23: (src/mod_compress.c.683) -- handling file as static file
2011-09-15 14:13:23: (src/mod_staticfile.c.397) -- handling file as static file
...

Before mod_compress.c, it should have tried to also ask mod_indexfile to handle the request as Indexfile.

The compilation went ok, and mod_indexfile is present in the static lighttpd:

[root@arc]/system/xbin# strings lighttpd-static | grep mod_index
mod_indexfile
mod_indexfile
src/mod_indexfile.c
mod_indexfile.c
mod_indexfile_init
mod_indexfile_free
mod_indexfile_set_defaults
mod_indexfile_patch_connection
mod_indexfile_subrequest
mod_indexfile_plugin_init

Also, this is the output of lighttpd -V:

@[root@arc]/system/xbin# lighttpd -V
lighttpd/1.4.29 - a light and fast webserver
Build-Date: Aug 30 2011 20:45:39

Event Handlers:

+ select (generic)
+ poll (Unix)
- rt-signals (Linux 2.4+)
+ epoll (Linux 2.6)
- /dev/poll (Solaris)
- eventports (Solaris)
- kqueue (FreeBSD)
- libev (generic)

Network handler:

+ sendfile

Features:

- IPv6 support
- zlib support
- bzip2 support
+ crypt support
- SSL Support
+ PCRE support
- mySQL support
- LDAP support
- memcached support
- FAM support
- LUA support
- xml support
- SQLite support
- GDBM support@

I believe it is related with the module's init method not called (and thus the handlers are not registered) when built statically.

Actions #1

Updated by viulian over 12 years ago

I found the answer: the header file src/plugin-static.h defines the order which the modules are loaded (to my understanding, header files should only contain definitions / constants, etc, and there should be a C piece of code that handles the order). Maybe it should be moved to a plugin-static-modules-order.c file ?

The order of PLUGIN_INIT sequence from src/plugin-static.h represents actually the order in which the modules are added to the internal list of modules (in static build). It took a while to realise that the order of the defines is in fact the order they get added into the master list.

Now, there's also an issue with scons which, when iterating over the modules dictionary from src/SConscript, it picks them up in random order (the keys() of Python's dictionary data type does not guarantee an order).

It means that the src/plugin-static.h file should be rewritten after scons writes it, with the values from this post: http://redmine.lighttpd.net/issues/1893#note-3 and then modified to match the desired build.

Actions #2

Updated by gstrauss about 8 years ago

  • Status changed from New to Fixed

Fixed. modules are now loaded in the order specified in the config file (lighttpd.conf)

commit b66fa2cb68a7c0ca6fae280bd71662d5ddce8c24
Author: Stefan Bühler <stbuehler@web.de>
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 <stbuehler@web.de>

    git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3029 152afb58-edef-0310-8abb-c4023f1b3aa9
Actions

Also available in: Atom