yum 安装完nginx后启动时如果报错
[root@test ~]# nginx -t #测试配件文件是否正确
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol) #表示主机不支持ipv6
更改配置文件
/etc/nginx/conf.d/default.conf
server {
listen 80; #监听ipv4
# listen [::]:80 default_server; #监听ipv6
注释掉ipv6重启就ok