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

1、启动nginx服务报错

环境:centos 6.9,yum安装的nginx,启动报错

[[email protected] ~]# 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就成功了。



原文地址:https://www.cnblogs.com/yihr/p/9588964.html

时间: 2024-08-02 15:59:46

97: Address family not supported by protocol,nginx服务启动失败的相关文章

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

1.nginx报错信息 早上通过LNMP部署owncloud 10.0.2的云盘环境,修改nginx配置文件后,重启报错:nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol) 2.分析并解决报错 看到 socket() [::]:80 failed,第一反应就是好像与IPV6有关,Address family not supported by protocol也进一步印证了我的想

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

说明: 1.[::]:80这个是IPv6的地址. 2.阿里云截至到今天还不支持IPv6. 解决方式: 1.普通解决方式:开启IPv6的支持,不过这个方法在阿里云行不通. vim /etc/nginx/conf.d/default.conf #找到并替换为以下: listen 80; listen [::]:80 ipv6only=on default_server; 2.极端方式:直接屏蔽IPv6,全部服务器都适用. vim /etc/nginx/conf.d/default.conf #找到并

LNMP环境搭建之Nginx服务启动失败

错误提示: Starting nginx:nginx:[emerg]bind()to 0.0.0.0:80 failed(98:Address alreadr in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)nginx: [emerg] bind(

inux : inet_protocols: IPv6 support is disabled: Address family not supported by protocol

在sendmail,命令发送邮件时提示 inux : inet_protocols: IPv6 support is disabled: Address family not supported by protocol vim /etc/postfix/main.cf inet_protocols = all --改为->inet_protocols = ipv4 service postfix restar 1. Edit the main Postfix configuration : Co

模拟Nginx服务启动关闭

已知Nginx管理命令为: 启动:/application/nginx/sbin/nginx 停止:/application/nginx/sbin/nginx -s stop 重新加载:/application/nginx/sbin/nginx -s reload 请用case脚本模拟Nginx服务启动关闭: /etc/init.d/nginx {start|stop|reload|restart},并可通过chkconfig管理. [[email protected] ~]# cat /etc

Nginx系列~Nginx服务启动不了

1.错误:No mapping for the Unicode character exists in the target multi-byte code page) 解决方法:安装路径具有中文字符   2.错误:An attempt was made to access a socket in a way forbidden by its access permissions) 应为nginx默认使用的端口80端口,停止80端口   无法终止pid为4的system占用80端口进程 解决方法

Nginx服务启动脚本

#!/bin/sh#filename:rsync_start.sh#date:2015-12-23#作者:linuxzkq#Email:[email protected]#version:v1.0 .  /etc/init.d/functionspath=/application/nginx/sbin/nginxpid=/application/nginx/logs/nginx.pidprocess=`ps -ef|grep nginx|grep -v grep|wc -l` #USAGEfun

tengine/nginx服务启动管理脚本(未使用系统funtions函数)

tengine是淘宝对于nginx1.6.2的一个二次开发,性能比原生态nginx更好,这几天在做测试,想应用到现有的架构里.源码包安装后就牵涉到一个添加到系统服务方便管理问题,到网上搜nginx启动脚本一大堆,但不是自己写的总归不放心,再者好多用的是系统的/etc/rc.d/init.d/funtions函数来实现的,虽然看着很健壮,但想到出了问题后又得研究怎么排查,一不做二不休干脆写一个,把脚本和添加到系统服务的过程分享一下. 功能主要有:service tengine start serv

发送邮件时,报postdrop: warning: inet_protocols: IPv6 support is disabled: Address family not supported by

Linux6.5发送邮件时,异常postdrop: warning: inet_protocols: IPv6 support is disabled: Address family not supported by 报错信息: sendmail: warning: inet_protocols: IPv6 support is disabled: Address family not supported by protocol App 12838 stdout: sendmail: warni