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服务启动失败的主要内容,如果未能解决你的问题,请参考以下文章

nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)

阿里云ECS在CentOS 6.9中使用Nginx提示:nginx: [emerg] socket() [::]:80 failed (97: Address family not supported

启动nfs服务时报错 systemd: rpcbind.socket failed to listen on sockets: Address family not supported by pro

C语言socket()函数解析(创建套接字)af地址族,ip地址类型(Address Family)INET(Inetnet)PF(Protocol Family)

[FAQ] Member "address" not found or not visible after argument-dependent lookup in address

java.sql.SQLException: Incorrect string value: ‘xE5x8Dx97xE6x98x8C‘ for column ‘address‘ at ro