Project

General

Profile

[NoResponse] Lighty exposing port on all domains?

Added by Anonymous about 7 years ago

I was curious if this is the expected behaviour...

I am trying to expose adminer only on a certain port of a particular domain.

$SERVER["socket"] == ":8080" { 
    $HTTP["host"] == "mydomain.tld" { server.document-root = ". . ." } 
} else $HTTP["host"] == "mydomain2.tld" {
    server.document-root = ". . . " 
}

Now, loading up my expected server.document-root works great from mydomain.tld:8080 ...

However, I can also now access mydomain2.tld:8080 (it loads the expected document root fine, but I wouldn't necessarily expect the conditional to allow serving any pages up to this domain on this port).

I noticed as well this spawned another lighttpd proc that had to be killed to reload subsequent changes to the config (service lighttpd stop didnt seem to have any effect with the second process which I presume was for :8080).

This was on ubuntu 14.04 lts, installing lighty from ubuntu official repo. I can get version number if necessary in the morning.

TY. And I like the webserver very much- much more admin friendly than "the other guys". :)


Replies (5)

RE: Lighty exposing port on all domains? - Added by gstrauss about 7 years ago

However, I can also now access mydomain2.tld:8080 (it loads the expected document root fine, but I wouldn't necessarily expect the conditional to allow this behaviour).

Please provide the lighttpd version (lighttpd -v). Some condition matching in the config was fixed in lighttpd 1.4.40, so if you're running a version earlier than that, please test with a more recent version and file an issue with ubuntu to upgrade lighttpd. (https://launchpad.net/ubuntu/trusty/+source/lighttpd suggests that you're running lighttpd 1.4.33, which is incredibly old -- over 3 1/2 years old) Latest version of lighttpd is currently 1.4.45.

I noticed as well this spawned another lighttpd proc that had to be killed to reload subsequent changes to the config (service lighttpd stop didnt seem to have any effect with the second process which I presume was for :8080).

A single lighttpd process can listen on multiple IPs and ports, so that's not it. Not properly shutting down lighttpd would be a bug with ubuntu's start and stop script. More recent versions of lighttpd also improve process management, so using a less ancient lighttpd is highly recommended.

RE: Lighty exposing port on all domains? - Added by Anonymous about 7 years ago

Oh yes. Your assumption was correct completely. Total n00bery on my part XD. I'll update, give it another shot, should report back in about an hour.

Thank you for the very prompt answer. I appreciate your hard work :)

RE: Lighty exposing port on all domains? - Added by Anonymous about 7 years ago

Hmm.. well building it myself I don't think has gone very well. lol.

RE: Lighty exposing port on all domains? - Added by gstrauss almost 7 years ago

You might also try the packages built by lighttpd developers at https://debian.lighttpd.net/ (not official Debian or Ubuntu packages)

    (1-5/5)