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

栏目: 服务器 · Nginx · 发布时间: 7年前

内容简介:CentOS 7.5下启动Nginx出现如下错误:nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory)解决方法:找到你的nginx.conf的文件夹目录,然后运行类似如下命令

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,就可以了。

如下图:

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

案例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模式后,重新启动服务器就好了,原因是因为没有权限。

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

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

Linux公社的RSS地址https://www.linuxidc.com/rssFeed.aspx

本文永久更新链接地址: https://www.linuxidc.com/Linux/2018-11/155150.htm


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

数据结构与算法

数据结构与算法

张铭、王腾蛟、赵海燕 / 高等教育出版社 / 2008-6 / 34.00元

《数据结构与算法》是普通高等教育“十一五”国家级规划教材,也是北京市精品课程主讲教材。《数据结构与算法》按照IEEE/ACM CC20025和教育部教指委关于“计算机科学与技术专业规范”(CCC2005)的要求编写,力求使学生较全面地理解数据结构的概念、掌握各种数据结构与算法的实现方式,同时比较不同数据结构和算法的特点,重点强调实践教学和学生动手能力的培养。 《数据结构与算法》的内容涉及基本......一起来看看 《数据结构与算法》 这本书的介绍吧!

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具