mac 上nginx的错误 nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
来源:互联网 发布:什么移动电源 知乎 编辑:程序博客网 时间:2024/06/06 20:12
今天在mac上运行nginx,发现一直报错:
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
查到的解决方法是nginx自己占用了80端口,又把自己block住,只要killall -9 nginx 即可。
试了下,发现根本找不到nginx进程。
使用ps -ef | grep nginx 也同样找不到。
于是查看是哪些进程占用了80端口:lsof -i:80
把对应的程序都关闭掉,发现依然不行。
通过浏览器访问http://localhost发现得到的页面根本没有在nginx的任何地方定义过。也就是说当前服务器启动的并不是nginx。
用chrome的开发者工具查看了下响应消息,响应消息的powdered-by字段赫然写着apache。
猛然想起来前不久为了测试一个php项目,启用了mac自带的apache服务器。
于是果断 sudo apachectl stop终止掉apache服务。问题解决。
顺带提一句,当nginx -s reload命令出现:nginx: [error] open()"/opt/local/var/run/nginx/nginx.pid" failed (2: No such file ordirectory)错误的话,解决办法:
nginx -c /opt/local/etc/nginx/nginx.conf(your/path/to/config/file)
- mac 上nginx的错误 nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
- Mac上启动nginx报错:nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
- nginx错误之 nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
- mac中nginx报错“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 (98: Address already 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() 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() 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() 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() 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() 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() to 0.0.0.0:80 failed (98: Address already in use)
- IBM db2 修改 数据库表结构或字段数据类型后报错
- 毕业五年决定你的命运
- 命令行简介之命令行补全和后台程序
- myeclipse安装svn插件的多种方式
- 代码执行时间评测系统
- mac 上nginx的错误 nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
- c# i++与++i的区别
- Asp.net控件开发学习笔记(九)----服务器控件事件
- Extents
- Java实现封装的步骤
- C# yield 关键字 使用
- 闪回表(DML)操作的一个实例
- linux virtio
- Ubuntu下Samba服务器的搭建