VPS侦探论坛

 找回密码
 注册
查看: 3252|回复: 2

服务器突然奔溃然后重启后nginx坏掉了。。。

[复制链接]
发表于 2017-5-2 15:50:13 | 显示全部楼层 |阅读模式

如下:
[dev@AMZ-IAD12-ADWORDS-35-240 ~]$ sudo service nginx restart
Stoping nginx... nginx: [alert] kill(10537, 15) failed (3: No such process)
failed. Use force-quit
Starting nginx... nginx (pid ) already running.
[dev@AMZ-IAD12-ADWORDS-35-240 ~]$ nginx -v
nginx version: nginx/1.12.0
[dev@AMZ-IAD12-ADWORDS-35-240 ~]$ sudo service nginx restart
Stoping nginx... nginx: [alert] kill(10537, 15) failed (3: No such process)
failed. Use force-quit
Starting nginx... nginx (pid ) already running.
[dev@AMZ-IAD12-ADWORDS-35-240 ~]$ cd /app
-bash: cd: /app: No such file or directory
[dev@AMZ-IAD12-ADWORDS-35-240 ~]$ sudo service nginx stop
Stoping nginx... nginx: [alert] kill(10537, 15) failed (3: No such process)
failed. Use force-quit
求解军哥什么情况,,还有nginx日志文件在哪儿,,
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2017-5-2 16:24:46 | 显示全部楼层


我通过sudo /etc/init.d/nginx restart启动成功了。但是通过sudo service nginx resatrt不能启动。现在sudo lnmp restart也有问题了。

[dev@AMZ-IAD12-ADWORDS-35-240 vhost]$ ps aux | grep nginx
root     25945  0.0  0.0  22752  1052 ?        Ss   16:13   0:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
www      25946  0.0  1.1  43964 22580 ?        S    16:13   0:00 nginx: worker process                                          
dev      25990  0.0  0.0 103304   888 pts/1    S+   16:15   0:00 grep nginx
[dev@AMZ-IAD12-ADWORDS-35-240 vhost]$ sudo lnmp restart
+-------------------------------------------+
|    Manager for LNMP, Written by Licess    |
+-------------------------------------------+
|              https://lnmp.org             |
+-------------------------------------------+
Stoping LNMP...
Stoping nginx... nginx is stopped.
Shutting down MySQL. SUCCESS!
Gracefully shutting down php-fpm . done
Starting LNMP...
Starting nginx... nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 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:443 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:443 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:443 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:443 failed (98: Address already in use)
nginx: [emerg] still could not bind()
failed
Starting MySQL.. SUCCESS!
Starting php-fpm  done
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2017-5-2 20:17:06 | 显示全部楼层

lnmp的都是/etc/init.d/xxx 或lnmp 进行管理,官网文档有明确说明:https://lnmp.org/faq/lnmp-status-manager.html
如果有其他程序占用或者nginx已经启动的话肯定会显示nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

建议先ps aux 看进程和netstat -ntl 确定是否有其他程序占用443、80端口
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-17 14:36 , Processed in 0.025811 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表