Warren Young
2014-Dec-11 03:48 UTC
[CentOS] httpd listening only on IPv6 interface on CentOS 7
I?ve held off reporting this since I thought it might just be some kind of fluke, but I?ve seen it now on three different boxes. The symptom is that the stock configuration of Apache only listens for IPv6 connections: $ netstat -na | grep :80.*LISTEN tcp6 0 0 :::80 :::* LISTEN You should see a second line there for IPv4, but you don't: tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN The stock httpd.conf file just says ?Listen 80? which is documented as listening on both IPv4 and IPv6. [1] You?re supposed to need to go out of your way to get it to listen on just one or the other, but somehow CentOS 7?s Apache manages it. Since I only need IPv4, I?ve managed to hack it into working by changing that line in /etc/httpd/conf/httpd.conf to: Listen 0.0.0.0:80 Why do I need to do this? [1] https://httpd.apache.org/docs/2.4/mod/mpm_common.html#listen
Alexander Dalloz
2014-Dec-11 10:10 UTC
[CentOS] httpd listening only on IPv6 interface on CentOS 7
Am 11.12.2014 um 04:48 schrieb Warren Young:> I?ve held off reporting this since I thought it might just be some kind of fluke, but I?ve seen it now on three different boxes. > > The symptom is that the stock configuration of Apache only listens for IPv6 connections: > > $ netstat -na | grep :80.*LISTEN > tcp6 0 0 :::80 :::* LISTENNo, that's just the way it is displayed for apache. In fact the service listens on IPv4 as well (given we speak about the default configuration with `Listen 80'). Easy to verify.> You should see a second line there for IPv4, but you don't: > > tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN > > The stock httpd.conf file just says ?Listen 80? which is documented as listening on both IPv4 and IPv6. [1] You?re supposed to need to go out of your way to get it to listen on just one or the other, but somehow CentOS 7?s Apache manages it. > > Since I only need IPv4, I?ve managed to hack it into working by changing that line in /etc/httpd/conf/httpd.conf to: > > Listen 0.0.0.0:80 > > Why do I need to do this? > > > > [1] https://httpd.apache.org/docs/2.4/mod/mpm_common.html#listenAlexander
Warren Young
2014-Dec-11 17:35 UTC
[CentOS] httpd listening only on IPv6 interface on CentOS 7
On Dec 11, 2014, at 3:10 AM, Alexander Dalloz <ad+lists at uni-x.org> wrote:> Am 11.12.2014 um 04:48 schrieb Warren Young: >> >> the stock configuration of Apache only listens for IPv6 connections: > > No, that's just the way it is displayed for apache. In fact the service listens on IPv4 as well (given we speak about the default configuration with `Listen 80'). > > Easy to verify.We noticed this problem when web browsers would refuse to connect to the server. *Then* we discovered the netstat oddity, and *then* we found that changing the Listen line in httpd.conf fixed it. That leaves me still wanting an explanation for what happened. New guess: there?s a difference between the IPv4 and v6 firewalls, so that changing the Listen line caused Apache to avoid the problem on the v6 side. I guess we?ll just keep an eye out when we build our next EL7 box...