yum安装nginx后主机ipv6不支持时报错解决过程

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

posted @ 2016-12-28 17:03  滕小白  阅读(3020)  评论(0编辑  收藏  举报