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 ...
随机推荐
- 长亭xray被动扫描
为了实现点到哪里扫到哪里,用长亭xray配合burp suite插件 插件名为Passive Scan Client https://github.com/lilifengcode/Burpsuite ...
- msql中@RequestParam、@Param、@PathVariable的用法
@RequestParam的用法 1.可以对传入参数指定参数名,将请求参数绑定至方法参数 // 下面的对传入参数指定为aa,如果前端不传aa参数名,会报错 @RequestParam(value=&q ...
- 【VLC开发】libvlc_new函数参数
项目中有视频监控的需求,找了vlc这个开源视频工具,在获取实例参数时遇到了问题, 要得到VLC的全部参数有两种方法, 1 只要在创建时加上"--longhelp"和"-- ...
- 使用Hugo和GitHub搭建博客
折腾了几天博客的框架终于搭建起来了.研究了一番之后,最终还是选择使用Hugo和GitHub来搭建博客.本文介绍了如何使用Hugo来搭建静态博客网站,并将其部署在GitHub上.使用https://&l ...
- promise链式调用的应用
then在链式调用时,会等前一个then或者函数执行完毕,返回状态,才会执行回调函数. (1)代码顺序执行,第一步调用了函数cook ,cook执行返回了一个promise,promise返回的是成功 ...
- 地图控件:overview、scale、toolbar
地图常用控件: 1.AMap.MapType:地图类型切换插件,用来切换固定的几个常用图层 2.AMap.OverView:地图鹰眼插件,默认在地图右下角显示缩略图 3.AMap.Scale:地图比例 ...
- asp获取当前页面url
<%Function GetLocationURL() Dim Url Dim ServerPort,ServerName,ScriptName,QueryString ServerName = ...
- 问题:idea 中文无法使用
1. 问题--idea无法使用中文输入 原因:idea本身版本过高,所以需要你强制减低它的jdk版本 解决:使用配置idea环境变量解决 ps:目前适用于任何版本的jdk和idea 步骤: 1.新建 ...
- openresty lua-resty-string md5 sha aes random string
安装 https://github.com/openresty/lua-resty-string $ sudo opm get openresty/lua-resty-string $ ls -al ...
- CSS 是啥?前端小白入门级理解
What is CSS? CSS stands for Cascading Style Sheets CSS describes how HTML elements are to be display ...