解决nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed错误

Posted 兵兵有你

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed错误相关的知识,希望对你有一定的参考价值。

重新启动服务器,访问web服务发现无法浏览啦!登陆服务器之后进到nginx使用./nginx -s reload重新读取配置文件,发现报nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)错误,进到logs文件发现的确没有nginx.pid文件
 
[[email protected] sbin]# ./nginx -s reload
nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)
 
解决方法:
[[email protected] nginx]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
 
使用nginx -c的参数指定nginx.conf文件的位置
 
[[email protected] nginx]# cd logs/
总用量 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: [error] open() "/usr/local/nginx/logs/nginx.pid" failed错误的主要内容,如果未能解决你的问题,请参考以下文章

解决 nginx: [error] open() /usr/local/nginx/logs/nginx.pid failed 错误

解决Nginx: [error] open() "/usr/local/Nginx/logs/Nginx.pid

解决Nginx: [error] open() "/usr/local/Nginx/logs/Nginx.pid

解决nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed错误

解决nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed错误

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