Nginx启动在Mac OS X 10.9上失败 [英] nginx startup fail on mac osx 10.9 mavericks

查看:114
本文介绍了Nginx启动在Mac OS X 10.9上失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用nginx几个月了,但是没有问题,但是在升级到Mac OS X 10.9 Mavericks之后,尝试启动nginx时我得到了:

I've been using nginx for a few months without issue, but after upgrading to Mac OS X 10.9 Mavericks, when trying to start nginx I get this:

nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] still could not bind()

我试图遵循

I tried to follow these directions, but I'm not having much luck as my outputs seem a little different.

输出:

ps ax -o pid,ppid,%cpu,vsz,wchan,command|egrep '(nginx|PID)'

是:

  PID  PPID  %CPU      VSZ WCHAN  COMMAND
 15015 12765  0.0  2432784 -      egrep (nginx|PID)

我尝试使用该PID终止进程,但它似乎从未消失……关于如何使nginx再次运行的任何想法?任何帮助都将不胜感激!

I've tried killing the process using that PID, but it never seems to die... Any ideas on how to get nginx running again? Any help is greatly appreciated!!

推荐答案

您的ps ... | egrep命令正在查找自身,而不是nginx的实例(请查看"COMMAND"列).由于使用了端口80,因此可能正在运行其他程序(也许是操作系统随附的Apache?).要找出答案,请运行:

Your ps ... | egrep command is finding itself, not an instance of nginx (look at the "COMMAND" column). Since port 80 is in use, it's likely some other program (maybe the Apache that comes with the OS?) is running and grabbing it. To find out, run:

sudo lsof -i:80

如果它是系统Apache("httpd")程序,则可以使用以下命令将其关闭:

If it's the system Apache ("httpd") program, you can probably shut it down with:

sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

如果这样做不行,则将需要更多信息来找出正在占用端口80的端口以及它是如何启动的.

If that doesn't do it, more info will be needed to figure out what's grabbing port 80 and how it's getting started.

这篇关于Nginx启动在Mac OS X 10.9上失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆