httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Kokoska <kokos...@seznam.cz>
Subject [users@httpd] IPv4 mixed with IPv6: Address already in use
Date Wed, 13 Oct 2004 12:18:02 GMT
Hi,

I run Apache 2.0.52-1 on Debian unstable with a custom 2.6.8 kernel. On
another machine with the same Apache and system packages and a custom
2.4.25-pre4 kernel, the problem is exactly the same.

I cannot specify IP to listen to using "Listen x.x.x.x:80", localhost,
catch-all, everything fails the same [0]. It appears that the IPv4
socket fails because the IPv6 socket is already bound to the port on the
same IP. 

Is this a bug? It would have to be notoriously known, so I assume
misconfiguration on my side..

Do I have to disable IPv6 altogether on my system (no I don't use it for
anything, but so far it was no trouble) to be able to bind to a single
IPv4 address? Hopefully not.

Do I have to re-compile Apache with --disable-v4-mapped to make the IPv6
socket stop bugging my IPv4? Then this would most likely be a Debian bug
as I am using a distro package.

Or alternatively, how do I tell Apache to give IPv6 a break and not ever
possibly use it? Documentation [1] says I should be able to do so by
"Listen 0.0.0.0:80", which unfortunately fails like I already described.

[0] error
---
(98)Address already in use: make_sock: could not bind to address
127.0.0.1:80
no listening sockets available, shutting down
Unable to open logs

[1] http://httpd.apache.org/docs-2.0/bind.html

Regards,
Jan Kokoska



strace
---
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 4
...
socket(PF_INET6, SOCK_STREAM, IPPROTO_IP) = 6
bind(6, {sa_family=AF_INET6, sin6_port=htons(0), inet_pton(AF_INET6,
"::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = 0
close(6)                                = 0
socket(PF_INET6, SOCK_STREAM, IPPROTO_IP) = 6
brk(0)                                  = 0x8118000
brk(0x813a000)                          = 0x813a000
brk(0)                                  = 0x813a000
brk(0x815c000)                          = 0x815c000
setsockopt(6, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(6, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
setsockopt(6, SOL_TCP, TCP_NODELAY, [1], 4) = 0
bind(6, {sa_family=AF_INET6, sin6_port=htons(80), inet_pton(AF_INET6,
"::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = 0
listen(6, 511)                          = 0
setsockopt(4, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(4, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
setsockopt(4, SOL_TCP, TCP_NODELAY, [1], 4) = 0
bind(4, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr
("127.0.0.1")}, 16) = -1 EADDRINUSE (Address already in use)
write(2, "(98)Address already in use: make"..., 78(98)Address already in
use: make_sock: could not bind to address 127.0.0.1:80
) = 78
close(4)                                = 0
write(2, "no listening sockets available, "..., 46no listening sockets
available, shutting down
) = 46
write(2, "Unable to open logs\n", 20Unable to open logs
)   = 20
close(6)                                = 0
---

Netcat has no trouble listening there:
---
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(3, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr
("127.0.0.1")}, 16) = 0
listen(3, 1)                            = 0



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message