Lighttpd web application development disturbance through aliasing on 127.0.0.1

Bug #396055 reported by tobyS on 2009-07-06
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
lighttpd (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: lighttpd

This bug affects Ubuntu 9.04, package Lighttpd in version 1.4.19-5ubuntu7

In the default lighttpd.conf there is a global section to alias /images/ to /usr/share/images/. This breaks all local /images/ folders in web development projects.

    $HTTP["remoteip"] =~ "127.0.0.1" {
        alias.url += (
            "/doc/" => "/usr/share/doc/",
            "/images/" => "/usr/share/images/"
        )
        $HTTP["url"] =~ "^/doc/|^/images/" {
            dir-listing.activate = "enable"
        }
    }

I'd suggest to add another condition around this aliases, which check for the host name in addition. This way, users who use different host names that localhost for their projects to not run into this issue.

    $HTTP["host"] = "localhost" {
        $HTTP["remoteip"] =~ "127.0.0.1" {
            alias.url += (
                "/doc/" => "/usr/share/doc/",
                "/images/" => "/usr/share/images/"
            )
            $HTTP["url"] =~ "^/doc/|^/images/" {
                dir-listing.activate = "enable"
            }
        }
    }

Same problem here, however the suggested problem wouldn't work for me (or other projects that use path aliases - which is most projects that currently configure apache).

The following does work, but you'd probably need a combination of this and the above solution to cover all situations:

$HTTP["remoteip"] =~ "127.0.0.1" {
        alias.url += (
                "^doc/" => "/usr/share/doc/",
                "^images/" => "/usr/share/images/"
        )
        $HTTP["url"] =~ "^/doc/|^/images/" {
                dir-listing.activate = "enable"
        }
}

I should mention I'm using 9.10 (Karmic), lighttpd 1.4.22-1ububtu4

tobyS (tobias-schlitt) wrote :

*bump*

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers