美文网首页
解决 nginx: [alert] kill(3185, 1)

解决 nginx: [alert] kill(3185, 1)

作者: zhaoxiaohui520 | 来源:发表于2020-06-25 21:20 被阅读0次

重新启动服务器,访问web服务发现无法浏览啦!登陆服务器之后进到nginx使用./nginx -s reload重新读取配置文件,发现报nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)错误,进到logs文件发现的确没有nginx.pid文件

[root@localhost sbin]# ./nginx -s reload

nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)

解决方法:

[root@localhost nginx]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

使用nginx -c的参数指定nginx.conf文件的位置

[root@localhost nginx]# cd logs/

[root@localhost logs]# ll

总用量 12

-rw-r--r-- 1 root root 1246 12月 9 18:10 access.log

-rw-r--r-- 1 root root 516 12月 10 15:39 error.log

-rw-r--r-- 1 root root 5 12月 10 15:38 nginx.pid

看nginx.pid文件已经有了。

解决 nginx: [alert] kill(3185, 1) failed (3: No such process)

[root@localhost/]# nginx -s reload
nginx: [alert] kill(3185, 1) failed (3: No such process) 杀死3185进程,可是并没有
[root@localhost /]# whereis ngnix
ngnix:[root@localhost/]#
[root@localhost /]# find / -name nginx
/usr/local/src/nginx/sbin/nginx
[root@localhost /]# find / -name nginx.conf
/usr/local/src/nginx/conf/nginx.conf
[root@localhost /]# /usr/local/src/nginx/sbin/nginx -c /usr/local/src/nginx/conf/nginx.conf
[root@localhost/]# nginx -s reload

我执行/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf再重启就好了

相关文章

网友评论

      本文标题:解决 nginx: [alert] kill(3185, 1)

      本文链接:https://www.haomeiwen.com/subject/bldefktx.html