Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#564556: lighttpd: can't bind to port: :: 80 Address already in use

463 views
Skip to first unread message

Jonathan Nieder

unread,
Jan 10, 2010, 3:00:01 AM1/10/10
to
Package: lighttpd
Version: 1.4.25-2
Severity: minor

lighttpd refuses to install, seemingly because it is trying to bind
to port 80 twice:

| Setting up lighttpd (1.4.25-2) ...
| Starting web server: lighttpd2010-01-10 00:57:30: (network.c.345) can't bind to port: :: 80 Address already in use
| failed!

Invoking the init script by hand yields the same result:

| # /etc/init.d/lighttpd restart
| Stopping web server: lighttpd.
| Starting web server: lighttpd2010-01-10 01:24:05: (network.c.345) can't bind to port: :: 80 Address already in use
| failed!
| # echo $?
| 1

I do not have any other web server installed, nor is any other
program listening on port 80.

| $ netstat -a | awk '($1 != "unix") && ($6 == "LISTEN")'
| tcp 0 0 *:ssh *:* LISTEN
| tcp 0 0 localhost:smtp *:* LISTEN
| tcp6 0 0 [::]:ssh [::]:* LISTEN

The problem is that (why? I don't know, but that's a separate problem)
the bindv6only sysctl is not enabled. Enabling it fixes this.

A clearer error message would have made this easier to diagnose.
Even better, lighttpd could set the IPV6_V6ONLY option itself
and not rely on net.ipv6.bindv6only being set.

Thoughts?
Jonathan

--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Jonathan Nieder

unread,
Jan 13, 2010, 8:20:02 AM1/13/10
to
Hi,

For the morbidly curious:

Jonathan Nieder wrote:

> The problem is that (why? I don't know, but that's a separate problem)
> the bindv6only sysctl is not enabled. Enabling it fixes this.

I think the problem was that I compiled Linux with CONFIG_IPV6=m.
*sigh*

> Even better, lighttpd could set the IPV6_V6ONLY option itself
> and not rely on net.ipv6.bindv6only being set.

The next official version of lighttpd may do this [1], so our long
national nightmare might be over soon.

Regards,
Jonathan

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560837#38

Jonathan Nieder

unread,
Aug 31, 2010, 9:40:02 PM8/31/10
to
reopen 564556 lighttpd/1.4.28-1
quit

Thijs Kinkhorst wrote:

> lighttpd (1.4.28-1) unstable; urgency=low
> .
> [ Olaf van der Spek ]
> * New upstream release (closes: 521235, 572031, 564556)

$ cupt install lighttpd
[...]
Unpacking lighttpd (from .../lighttpd_1.4.28-1_i386.deb) ...
Setting up lighttpd (1.4.28-1) ...
Starting web server: lighttpd2010-08-31 20:21:48: (network.c.358) can't bind to port: 80 Address already in use
failed!
invoke-rc.d: initscript lighttpd, action "start" failed.
dpkg: error processing lighttpd (--configure):

Hmph. Actually though the symptoms are the same, the cause is
different.

# cat /proc/sys/net/ipv6/bindv6only
1
$ tail -1 /etc/sysctl.d/bindv6only.conf
net.ipv6.bindv6only = 1

Wait, wasn't that changed back in netbase? Well, yes, for _new_
installs, but this is a conffile so it keeps the existing value
for existing installations.

My own analysis is the same as before: relying on anything about
the bindv6only setting is just asking for trouble. lighttpd needs to
set or clear the IPV6_V6ONLY option itself for ipv6 sockets, or
autoconfigure correctly at runtime.

Hope that helps,

Jonathan Nieder

unread,
Sep 2, 2010, 8:20:02 AM9/2/10
to
notfound 564556 lighttpd/1.4.25-2
fixed 564556 lighttpd/1.4.25-2
close 564556
quit

Olaf van der Spek wrote:

> Eh, netstat -nlp | grep 80?

Sigh. Sorry to waste your time.

# killall apache2
# dpkg --configure -a


Setting up lighttpd (1.4.28-1) ...

Starting web server: lighttpd.
# echo $?

0

I had uninstalled but not purged apache and clearly I do not know
how to use netstat. :(

Jonathan Nieder

unread,
Sep 2, 2010, 8:40:02 AM9/2/10
to
Olaf van der Spek wrote:

> I guess uninstalling didn't succeed either.

Right, I removed the apache2 package but not the daemon (apache2-mpm-worker)
itself.

0 new messages