97: Address family not supported by protocol,nginx服务启动失败
Posted 执行の道术器
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了97: Address family not supported by protocol,nginx服务启动失败相关的知识,希望对你有一定的参考价值。
1、启动nginx服务报错
环境:centos 6.9,yum安装的nginx,启动报错
[root@lnmp ~]# 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)
nginx: configuration file /etc/nginx/nginx.conf test failed
2、尝试修改配置文件
vi /etc/nginx/nginx.conf
没发现要修改的端口信息
listen 80;
仔细查看nginx的主配置文件发现include选项,包含了nginx的其他配置文件
然后继续查看发现:
3、解决办法
vim /etc/nginx/conf.d/default.conf 将: listen 80 default_server; listen [::]:80 default_server; 改为: listen 80; #listen [::]:80 default_server;
启动nginx就成功了。
以上是关于97: Address family not supported by protocol,nginx服务启动失败的主要内容,如果未能解决你的问题,请参考以下文章