Nginx系列(6)- nginx: [error] CreateFile() "D:\nginx-1.20.1/logs/nginx.pid" failed (2: The system cannot find the file specified)
背景
修改nginx配置文件nginx.conf后,想要重启nginx使配置生效。cmd进入nginx安装目录,输入命令: nginx -s reload
报错:nginx: [error] CreateFile() "D:\nginx-1.20.1/logs/nginx.pid" failed (2: The system cannot find the file specified)
原因分析
- 问题的直接原因就是在nginx的安装目录下的logs目录里面没有nginx.pid这个文件,一般情况下nginx启动时会自动创建nginx.pid文件的
- nginx启动或者重启需要杀掉原来的nginx进程,需要根据nginx.pid找到原来的进程,其中pid其实就是原来的进程ID了
- 出现这种情况的原因可能是nginx未启动或者nginx.pid被手动删除掉,有时候在windows系统通过双击方式启动nginx会有无法在logs目录下自动生成nginx.pid文件的情况
- 在没有启动nginx的情况下(以及你不清楚有没有启动),不要使用nginx -s reload命令来作为启动命令,可以避免这个报错发生
解决方法
1.任务管理器里面找到原来的nginx进程(如果有的话)并关掉,然后使用cmd命令的方式启动nginx 2.cmd 进入 nginx安装目录 3.输入命令 start nginx 或者 nginx.exe 启动nginx 4.去nginx目录下logs目录下看看有没有nginx.pid的文件;如果没有重复123操作 5.如果nginx.pid已经生成,再去修改配置文件后就可以正常重启了 6.nginx -s reload
Nginx系列(6)- nginx: [error] CreateFile() "D:\nginx-1.20.1/logs/nginx.pid" failed (2: The system cannot find the file specified)的更多相关文章
- nginx报错[error] CreateFile() "D:\Java-windows\nginx-1.16.0/logs/nginx.pid" failed (2: The system cannot find the file specified)
无论是nginx -s stop还是nginx -s reload命令,都会出现这个错误. 解决方法:使用命令创建/logs/nginx.pid文件,命令如下所示: nginx -c conf/ngi ...
- Nginx错误:nginx: [error] OpenEvent("Global\ngx_reload_6252") failed (2: The system cannot find the file specified)
执行nginx -s reload命令: nginx: [error] OpenEvent("Global\ngx_reload_6252") failed (2: The sys ...
- nginx错误: [error] OpenEvent("Global\ngx_reload_10444") failed (2: The system cannot find the file specified)
执行nginx -s reload命令: nginx: [error] OpenEvent("Global\ngx_reload_10444") failed (2: The sy ...
- Nginx报错 nginx: [error] open() "/usr/local/nginx-1.6.3/logs/nginx.pid" failed (2: No such file or directory)
问题: 解决: http://www.jianshu.com/p/918eb337a206 dd
- Nginx系列(4)- Nginx安装 | Windows
下载 访问官网,选择稳定版对应的Windows系列 安装解压即可 启动nginx 有很多种方法启动nginx 直接双击nginx.exe,双击后一个黑色的弹窗一闪而过 打开cmd命令窗口,切换到ngi ...
- Windows下nginx报错解决:CreateFile() "xxx/logs/nginx.pid" failed
写在前面 本文给出Windows下nginx报错:CreateFile() "xxx/logs/nginx.pid" failed 的解决方法并分析了出错原因,其中 xxx 表示n ...
- 解决nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed错误
重新启动服务器,访问web服务发现无法浏览,登陆服务器之 后进到nginx使用./nginx -s reload重新读取配置文件,发现报nginx: [error] open() "/usr ...
- 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] CreateFile() "E:\nginx\nginx-1.9.3/logs/nginx.pid" failed
nginx: [error] CreateFile() "E:\nginx\nginx-1.9.3/logs/nginx.pid" failed nginx: [error] Op ...
随机推荐
- SpringBoot开发七-开发注册功能
需求介绍-开发注册功能 首先访问注册页面-点击顶部的链接,打开注册页面 提交注册数据 通过表单提交数据 服务端验证账号是否存在,邮箱是否已经注册 服务端发送激活邮件 激活注册账号 点击邮件中的链接,访 ...
- LoadableComponent类的使用
通过继承LoadableComponent类,测试程序可以判断浏览器是否加载了正确的页面,只需要重写isLoaded和load二个方法,此方法有助于页面对象的页面访问操作更加稳定 1.LoginPag ...
- Blazor Server 应用程序中进行 HTTP 请求
翻译自 Waqas Anwar 2021年5月4日的文章 <Making HTTP Requests in Blazor Server Apps> [1] Blazor Server 应用 ...
- 单链表(Java--尚硅谷)
基础知识 大体结构和C++的链表差不多 补充之前不知道的:链表分两类,带和不带头结点的链表 现在才知道,Java没有像C/C++那样的指针 首先创建一个LinkList类,然后把链表的各个功能添加进去 ...
- spring cloud 网管篇zuul
1, consul 2, zuul 程序的yml 文件 server: port: 8083spring: application: name: zuulInfo # 应用名称 cloud: cons ...
- java 内存泄露的几种情况
内存泄漏定义(memory leak):一个不再被程序使用的对象或变量还在内存中占有存储空间. 一次内存泄漏似乎不会有大的影响,但内存泄漏堆积后的后果就是内存溢出.内存溢出 out of memory ...
- HDFS Shell基本操作
1.目录操作 hdfs dfs [命令] [命令] 等价于 hadoop fs [] [] 1 ./bin/hdfs dfs -mkdir -p /user ...
- maven思维导图梳理
图片可能稍微有点模糊,附上xmind下载地址: 补上面漏掉的Jetty,可以参照这位博主的博客
- AI 常见术语总结
BN(Batch-normalization)在一层的输出上计算所有特征映射的均值和标准差,并且使用这些值规范化它们的响应.因此使得所有神经图(neural maps)在同样范围有响应,而且是零均 ...
- tomcat漏洞总结
描述 Tomcat是Apache 软件基金会(Apache Software Foundation)的Jakarta 项目中的一个核心项目,由Apache.Sun 和其他一些公司及个人共同开发而成.由 ...