nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)
问题场景
服务器重启后,重启nginx时报错nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory),进入到logs目录发现确实没有nginx.pid文件

解决办法
使用指定nginx.conf文件的方式重启nginx
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
还有一种可能就是nginx.conf的nginx.pid被注释了,将下图中pid前的#去掉,保存退出再次启动nginx

此时去logs目录下查看发现nginx.pid文件已经生成了
nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)的更多相关文章
- nginx报错 [error] open() “/usr/local/var/run/openresty.pid” failed (2: No such file or directory)
解决: 服务没有启动 使用start启动服务,因为没有start而直接使用stop或者reload报错这个问题: 如果方法一没有解决,使用方法二:-C 指定配置文件nginx.conf或者weblua ...
- nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory)
nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory) ...
- nginx启动或者重启失败,报错nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory)
第一种方案: 1. 执行命令 :open /usr/local/etc/nginx 打开nginx安装目录 nginx安装目录默认位置有:(找到适合你的) /etc/nginx/nginx.conf, ...
- nginx启动报错nginx: [error] open() "/usr/local/etc/nginx/logs/nginx.pid" failed
问题:nginx启动的时候会报丢失pid的错误 nginx: [error] open() “/usr/local/var/run/nginx.pid” failed 解决方案: sudo nginx ...
- Nginx 报错: nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory) 的解决方法
今天测试域名访问不了,登陆 Linux(Ubuntu)重启Nginx: nginx -s reload 结果报错: nginx: [error] open() : No such file or di ...
- nginx [error] open() "/usr/local/nginx/logs/nginx.pid" failed的解决
今天关闭nginx后重启不了: nginx -s reload 结果报错: nginx: [error] open() "/usr/local/nginx/logs/nginx.pid&qu ...
- 新装NGINX重启,出现错误 nginx: [error] open() "/usr/local/nginx/logs/nginx.pid"
重装nginx出现,重启出现错误 ./nginx -s reload nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" ...
- nginx ../logs/nginx.pid" failed (2: No such file or directory)
[1]nginx.pid相关 (1)可能出现两种场景: 1.1 nginx.pid文件不存在 发生现象:nginx: [error] open() "/usr/local/lib/ubcsr ...
- nginx: [error] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)
在重启nginx服务的时候,出现了这个错误. [root@izuf68g6a94fj32w0afx00z etc]# nginx -c /var/run/nginx/nginx.pid nginx: ...
随机推荐
- AT2699 [ARC081D] Flip and Rectangles
以下是简要题解: 首先思考如何判定一个矩形是否能通过操作变成全黑. 首先从简单而又特殊的 \(2 \times 2\) 的矩形开始,不难发现只要其中黑色数量不为奇数即可. 近一步拓展可以发现,一个矩形 ...
- Vue项目history模式下微信分享总结
原文 : http://justyeh.top/post/39/ 2019-07-02 Vue微信分享 每回遇到微信分享都是一个坑,目前的商城项目使用Vue开发,采用history的路由模式,配置微信 ...
- 简单实现UITableView索引功能(中英文首字母索引) (二) By HL
简单实现UITableView索引功能(中英文首字母索引)(一) ByH罗 相关类: NSString+PinYing(获取中英文首字母) 参考上面链接 #import "ViewCon ...
- 替小白整理的 linux基操命令 切勿扣6 不用感谢
Linux --------小白必会的基本命令 命令行提示字符[root@localhost ~]#[当前登录系统的用户@主机名称 当前所在的目录]## 表示为管理员登录$ 表示为普通用户登录 切 ...
- linux中可以查看端口占用的方法
在自己搭建的服务器中,经常容易出现端口被占用的问题,那么怎么知道自己的端口是否被占用了呢? 可以使用下面的方法: linux中可以查看端口占用的方法. netstat -ant | grep 80 ( ...
- 《PHP程序员面试笔试宝典》——如何应对自己不会回答的问题?
如何巧妙地回答面试官的问题? 本文摘自<PHP程序员面试笔试宝典> 在面试的过程中,对面试官提出的问题求职者并不是都能回答出来,计算机技术博大精深,很少有人能对计算机技术的各个分支学科了如 ...
- Argo workflow 案例练习和配置详细解析
参数化 - parameters hello-world-parameters.yaml文件解析 apiVersion: argoproj.io/v1alpha1 kind: Workflow met ...
- 基于nodejs的阿里云DDNS服务,支持多网卡绑定
前段几天写的,自用. 想着也许有和我一样需求的同学,所以开源发出来了. 提供阿里云的DDNS设置,支持多网卡多域名绑定. 特性 支持阿里云DDNS设置 支持针对多个线路多个网卡单独设置域名 支持IPv ...
- ctf平台
CTF靶场 蓝鲸安全:http://whalectf.xin bugku:https://ctf.bugku.com XCTF攻防世界:https://adworld.xctf.org.cn/ i春秋 ...
- [题解]第十一届北航程序设计竞赛预赛——A.模式
题目描述 输入一个学号,判断是计算机系or软件学院or其他院系. 解题思路 水题,直接判断or除以10000都可以.不废话,直接上代码. 1 #include <iostream> 2 # ...