Home  >  Q&A  >  body text

linux - httpd 443端口为什么只监听在tcp6上

系统redhat7
,httpd已经启动

[root@rhcsa conf.d]# netstat -tnpl | grep 443
tcp6       0      0 :::443                  :::*                    LISTEN      1229/httpd

为什么如上命令只显示tcp6,而没有tcp ?

PHPzPHPz2743 days ago920

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-04-17 15:57:34

    After monitoring tcp6, tcp can also be used.

    Although this only shows the IPv6 port listening, it does not mean that it only accepts IPv6 connections. In fact, apache will accept IPv4 connections in the mapped address (::FFFF:a.b.c.d) method. Except for a few platforms, such as FreeBSD, NetBSD, and OpenBSD, the --enable-v4-mapped option is enabled by default when Apache is compiled. Therefore, Apache will accept both IPv6 and IPv4 connection requests.
    Unless the IPV6_V6ONLY mode is turned on, two different sockets are needed to monitor IPv6 and IPv4 respectively. The IPV6_V6ONLY mode can be controlled through sysctl net.ipv6.bindv6only. It is turned off by default. If you are really willing to only see the monitoring of IPv4 ports in netstat, then you can modify apachezhttp.conf and change
    Listen 80
    to
    Listen 0.0.0.0:80

    For specific information, please refer to http://httpd.apache.org/docs/...

    reply
    0
  • Cancelreply