环境: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的其他配置文件

97: Address family not supported by protocol,nginx服务启动失败

然后继续查看发现:

97: Address family not supported by protocol,nginx服务启动失败

 

3、解决办法

   vim /etc/nginx/conf.d/default.conf
将:
    listen       80 default_server;
    listen       [::]:80 default_server;
改为:
    listen       80;
    #listen     [::]:80 default_server;

启动nginx就成功了。

 

 


 
                    
            
                

相关文章:

  • 2021-06-12
  • 2022-12-23
  • 2021-06-16
  • 2021-12-07
  • 2021-10-14
  • 2021-12-16
  • 2022-01-23
  • 2021-12-29
猜你喜欢
  • 2021-08-24
  • 2022-12-23
  • 2021-09-17
  • 2021-10-10
  • 2022-12-23
相关资源
相似解决方案