nginx 启动报错 “/var/run/nginx/nginx.pid" failed” 解决方法
2023-09-14 08:57:05 时间
问题:
重启虚拟机后,再次重启nginx会报错: open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)
解决方法:
(1)进入 cd /usr/local/nginx/conf/ 目录,编辑配置文件nginx.conf ;
(2)在配置文件中有个注释的地方: #pid logs/nginx.pid;
(3)将注释放开,并修改为:pid /usr/local/nginx/logs/nginx.pid;
(4)在 /usr/local/nginx 目录下创建 logs 目录:mkdir /usr/local/nginx/logs
(5)启动nginx服务:/usr/local/nginx/sbin/nginx
相关文章
- LoadLibrary failed with error 1114:动态链接库(DLL)初始化例程失败 解决方法「建议收藏」
- Ubuntu “Failed to fetch”错误的解决方法
- 【 Linux学习】SSH连接时出现Host key verification failed的原因及解决方法以及ssh-keygen命令的用法
- 【Linux】——在Xshell输入ssh root@公网ip进行远程连接Linux失败,显示(port 22): Connection failed的完美解决方法
- 【错误记录】Android Studio 向 GitHub 提交代码报错 ( Push failed: Failed with error: Could not read from remote )
- 【错误记录】Android Studio 向 GitHub 提交代码报错 ( Push failed: Failed with error: Could not read | 使用命令行提交代码 )
- ORA-27605: Smart I/O failed as a handle could not be obtained to the cell “string” as the cell is not accessible. ORACLE 报错 故障修复 远程处理
- ORA-27609: Smart I/O failed due to a network error to the cell “string”. error code “string”, “string” ORACLE 报错 故障修复 远程处理
- MySQL Error number: MY-011348; Symbol: ER_XPLUGIN_FAILED_TO_UNREGISTER_UDF; SQLSTATE: HY000 报错 故障修复 远程处理
- MySQL Error number: MY-011367; Symbol: ER_KEYRING_FAILED_TO_TRUNCATE_FILE; SQLSTATE: HY000 报错 故障修复 远程处理
- MySQL Error number: MY-011520; Symbol: ER_GRP_RPL_START_FAILED; SQLSTATE: HY000 报错 故障修复 远程处理
- ORA-09218: sfrfs: failed to refresh file size ORACLE 报错 故障修复 远程处理
- ORA-16250: Failed to acquire starting scn of new log stream ORACLE 报错 故障修复 远程处理
- Xshell7远程连接失败(connection failed)的问题解决
- 状态Linux查看Nginx服务状态的简单方法(linux查看nginx)
- Linux下删除Nginx服务器的方法(linux删除nginx)