首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >nginx: [error] open() “/run/nginx.pid” failed (2: No such file or directory)

nginx: [error] open() “/run/nginx.pid” failed (2: No such file or directory)

作者头像
星哥玩云
发布2022-07-20 16:27:07
发布2022-07-20 16:27:07
2.7K0
举报
文章被收录于专栏:开源部署开源部署

CentOS 7.5下启动Nginx出现如下错误:

nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory)

解决方法:找到你的nginx.conf的文件夹目录,然后运行类似如下命令

nginx -c etc/nginx/nginx.conf

再运行nginx -s reload,就可以了。

如下图:

案例2:

如果启动Nginx出现如下错误:

[linuxidc@localhost www.linuxidc.com]$ nginx -s reload nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied) 2018/11/03 10:26:00 [warn] 21354#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:5 2018/11/03 10:26:00 [notice] 21354#0: signal process started 2018/11/03 10:26:00 [alert] 21354#0: kill(21052, 1) failed (1: Operation not permitted)

原因:当前用户对该位置没有写入权限,输入su和密码进入root模式后,重新启动服务器就好了,原因是因为没有权限。

注:以非root权限启动时,会出现 nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied) 错误。那就以root权限启动就好。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档