nginx启动报错 : [emerg] open() “/var/run/nginx/nginx.pid” failed (2: No such file or directory)

今天爱分享给大家带来nginx启动报错 : [emerg] open() “/var/run/nginx/nginx.pid” failed (2: No such file or directory),希望能够帮助到大家。

nginx启动报错 : [emerg] 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

人已赞赏
Nginx

nginx: [error] invalid PID number "" in "/usr/local/nginx-1.12.2/nginx_my.pid"解决方法

2020-10-21 18:22:50

Nginx

nginx/tengine服务器重启 /“var/run/nginx/nginx.pid" no such file or directory问题解决

2020-10-21 18:31:46

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧