[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#690232: apache2: Apache2 listens on tcp6 only



On 10/11/2012 2:11 PM, Olaf Zaplinski wrote:

> after restarting apache2, I see:
> 
> # netstat -tanp
> ESTABLISHED 4229/1
> tcp6       0      0 :::80                   :::*                    LISTEN
>     10525/apache2
> tcp6       0      0 :::22                   :::*                    LISTEN
>     1415/sshd
> 
> ports.conf is default:
> NameVirtualHost *:80
> Listen 80
> 
> 
> So I did a
> "echo net.ipv6.conf.all.disable_ipv6=1 > /etc/sysctl.d/disableipv6.conf &&
> reboot" with the following result:
> 
> # netstat -tanp
> Active Internet connections (servers and established)
> Proto Recv-Q Send-Q Local Address           Foreign Address         State 
>     PID/Program name
> tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
>     1249/apache2
> tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
>     1521/sshd
> tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN
>     1655/master
> tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN
>     1489/mysqld
> tcp        0     52 10.52.152.164:22        10.52.81.146:50385     
> ESTABLISHED 1742/0
> 

Unless you have:

cat /proc/sys/net/ipv6/bindv6only
0

set to 1, you are simply misreading the output of netstat.

If bindv6only is to 0 a socket listening to :::80 means that it is
operating on both IPv4 and IPv6.

By default the kernel sets bindv6only to 0 on linux.

Fabio


Reply to: