609926202 发表于 2017-5-2 15:50:13

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

如下:
$ sudo service nginx restart
Stoping nginx... nginx: kill(10537, 15) failed (3: No such process)
failed. Use force-quit
Starting nginx... nginx (pid ) already running.
$ nginx -v
nginx version: nginx/1.12.0
$ sudo service nginx restart
Stoping nginx... nginx: kill(10537, 15) failed (3: No such process)
failed. Use force-quit
Starting nginx... nginx (pid ) already running.
$ cd /app
-bash: cd: /app: No such file or directory
$ sudo service nginx stop
Stoping nginx... nginx: kill(10537, 15) failed (3: No such process)
failed. Use force-quit
求解军哥什么情况,,还有nginx日志文件在哪儿,,

609926202 发表于 2017-5-2 16:24:46

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

$ ps aux | grep nginx
root   259450.00.0227521052 ?      Ss   16:13   0:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
www      259460.01.143964 22580 ?      S    16:13   0:00 nginx: worker process                                          
dev      259900.00.0 103304   888 pts/1    S+   16:15   0:00 grep nginx
$ 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: bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: still could not bind()
failed
Starting MySQL.. SUCCESS!
Starting php-fpmdone

licess 发表于 2017-5-2 20:17:06

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

建议先ps aux 看进程和netstat -ntl 确定是否有其他程序占用443、80端口
页: [1]
查看完整版本: 服务器突然奔溃然后重启后nginx坏掉了。。。