首页 > 其他 > 详细

Nginx(二) nginx 无法启动

时间:2018-03-11 22:17:46      阅读:216      评论:0      收藏:0      [点我收藏+]

有时候在客户端输入:nginx

但是终端会输出以下,显示启动失败

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

这时候可以输入:ps -ef| grep nginx

 终端会输出以下,显示占用的端口

    0   551     1   0  9:22PM ??         0:00.01 nginx: master process nginx
   -2   614   551   0  9:26PM ??         0:00.00 nginx: worker process
    0   618   606   0  9:27PM ttys000    0:00.00 grep nginx

然后输入:kill 551

来停止该端口进程。

再在终端输入:nginx

然后在浏览器输入:http://127.0.0.1:8080/

就会显示启动正常。

 

Nginx(二) nginx 无法启动

原文:https://www.cnblogs.com/Jomini/p/8546282.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!