[pkg-lighttpd] Bug#521235: Adding modules to server.modules not idempotent

Josh Triplett josh at joshtriplett.org
Sat Jun 26 17:14:02 UTC 2010


Package: lighttpd
Severity: normal

Rough recipe to reproduce:

In an enabled lighttpd configuration file, we had two blocks for
different virtual hosts, each guarded by

$HTTP["host"] == "some.example.org" { ... }

In each block, we set "var.exampleroot" to a different path under /srv,
then used "include" to include a common configuration file.

The common configuration file contained the following:

global {
    server.modules += (
        "mod_fastcgi",
        "mod_redirect",
        "mod_rewrite",
    )
}

dir-listing.activate = "disable"

url.rewrite-once = (
    "^/favicon.ico$" => "/media/favicon.ico",
    "^(?!/(?:doc|media))(.*)" => "/example-fake-path$1",
)

alias.url = (
    "/doc" => exampleroot + "/doc/",
    "/media" => exampleroot + "/media/",
)

fastcgi.server = (
    "/example-fake-path" => ((
        "bin-path" => exampleroot + "/fastcgi",
        "socket" => exampleroot + "/run/fastcgi.sock",
        "check-local" => "disable",
        "max-procs" => 1,
        "kill-signal" => 10,
        "bin-copy-environment" => ( "" ),
    ))
)


With this setup, the FastCGI script would receive an incorrect PATH_INFO
value that included "example-fake-path".  Removing the "global" block
adding to server.modules from the common configuration file and putting
it at the top of the main configuration file instead fixed the problem.

- Josh Triplett





More information about the pkg-lighttpd-maintainers mailing list