nginx一直报错, 请帮忙看看日志,怎么解决

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
weizhao029
帖子: 6
注册时间: 2010-11-26 15:48

nginx一直报错, 请帮忙看看日志,怎么解决

#1

帖子 weizhao029 » 2011-09-27 14:02

nginx的error日志里经常报错

2011/09/27 13:03:47 [error] 17493#0: *7438996 connect() failed (111: Connection refused) while connecting to upstream, client: 180.168.109.106, server: mysite.com, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "mysite.com"
2011/09/27 13:03:48 [error] 17493#0: *7438996 connect() failed (111: Connection refused) while connecting to upstream, client: 180.168.109.106, server: mysite.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "mysite.com"
2011/09/27 13:03:49 [error] 17493#0: *7438996 connect() failed (111: Connection refused) while connecting to upstream, client: 180.168.109.106, server: mysite.com, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "mysite.com"

php-fpm的 ERROR级别的日志是,

[27-Sep-2011 12:08:02] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
[27-Sep-2011 12:30:04] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
[27-Sep-2011 12:40:04] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
[27-Sep-2011 12:50:04] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
[27-Sep-2011 12:57:04] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
[27-Sep-2011 13:03:04] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
[27-Sep-2011 13:03:04] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)

偶尔出现
[26-Sep-2011 17:48:24] ERROR: ptrace(PEEKDATA) failed: Input/output error (5)
[26-Sep-2011 17:49:04] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
[26-Sep-2011 17:49:32] ERROR: ptrace(PEEKDATA) failed: Input/output error (5)
[26-Sep-2011 17:49:33] ERROR: ptrace(PEEKDATA) failed: Input/output error (5)
[26-Sep-2011 17:49:42] ERROR: ptrace(PEEKDATA) failed: Input/output error (5)
头像
missU
帖子: 1610
注册时间: 2010-03-28 16:16
来自: 你知道么?

Re: nginx一直报错, 请帮忙看看日志,怎么解决

#2

帖子 missU » 2011-09-27 20:40

ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
很明显9000端口被占用。
3个解决办法
1 在nginx.conf中换个php的端口试试
2 实在不行还有sock方式。
3 杀死那个占用9000端口的程序。

选择题,lz去选吧。

代码: 全选

shutdown -h now && 睡觉
weizhao029
帖子: 6
注册时间: 2010-11-26 15:48

Re: nginx一直报错, 请帮忙看看日志,怎么解决

#3

帖子 weizhao029 » 2011-09-30 14:16

sock方式应该怎么做呢?
怎么做到在出现错误的时候自动杀死那个占用9000端口的程序,然后能正常启动
头像
missU
帖子: 1610
注册时间: 2010-03-28 16:16
来自: 你知道么?

Re: nginx一直报错, 请帮忙看看日志,怎么解决

#4

帖子 missU » 2011-09-30 19:53

怎么做到在出现错误的时候自动杀死那个占用9000端口的程序,然后能正常启动
人工智能?

俺不会。

代码: 全选

shutdown -h now && 睡觉
weizhao029
帖子: 6
注册时间: 2010-11-26 15:48

Re: nginx一直报错, 请帮忙看看日志,怎么解决

#5

帖子 weizhao029 » 2011-09-30 21:11

那sock方式应该怎么做呢?
wx2236y
帖子: 3
注册时间: 2011-10-23 17:58

Re: nginx一直报错, 请帮忙看看日志,怎么解决

#6

帖子 wx2236y » 2011-10-24 23:43

。。。配置 php-fpm 文件 将 127.0.0.1:9000 换掉 可以换 端口 也可 换sock 的 绝对 路径
头像
xyy_xx
帖子: 344
注册时间: 2008-09-17 13:37
系统: arch|centos

Re: nginx一直报错, 请帮忙看看日志,怎么解决

#7

帖子 xyy_xx » 2012-04-25 21:08

代码: 全选

sudo vim /etc/php/php-fpm.conf

代码: 全选

listen = 127.0.0.1:9000
listen = /var/run/php-fpm/php-fpm.sock
拥有书籍并不表示拥有知识;拥有知识并不表示拥有技能;拥有技能并不表示拥有文化;拥有文化并不表示拥有智慧
渣浪:@CodewalkerDotMe
推特:@codewalkertse
博客:http://codewalker.me/
回复