sm702 发表于 2018-11-22 11:45:04

Apache(httpd)监听标准

关于httpd服务监听地址的问题,查看了一些资料和做个相关实验,下面总结下:
1、Httpd默认是监听的IPv6地址上的,但这样子并不影响对IPv4地址的识别。
    IPv4 connections can be handled with the v6 API by using the v4-mapped-on-v6 address type; thus a program only needs to support this API type to support both protocols.This is handled transparently by the address handling functions in the C library.
    IPv4andIPv6 share the local port space.When you get an IPv4connection or packet to a IPv6 socket, its source address will be mapped tov6 and it will be mapped to v6.
这是IPv6的描述,man ipv6可以获取。
我的理解只要应用程序支持这个API就可以完成对4到6的转换,既即使监听在IPv6地址也可以识别IPv4
2、不同地址的监听方式
IPv4:    Listen   IPv4_IP:80
Ipv6:    Listen   :80   #IPv6需要方括号
如果需要同时监听,上面两种一起写即可。默认的 “:80”只工作在IPv6模式。






才疏学浅,如果理解错的,忘诸位好汉能不吝赐教。



页: [1]
查看完整版本: Apache(httpd)监听标准