Lighttpd web application development disturbance through aliasing on 127.0.0.1

Bug #396055 reported by tobyS
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
lighttpd (Ubuntu)
Fix Released
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"
            }
        }
    }

Revision history for this message
Darren Warner (launchpad-dazwin) wrote :

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"
        }
}

Revision history for this message
Darren Warner (launchpad-dazwin) wrote :

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

Revision history for this message
tobyS (tobias-schlitt) wrote :

*bump*

Revision history for this message
gstrauss (gstrauss) wrote :

`lighty-disable-mod debian-doc`

Changed in lighttpd (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.