欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

nginx: [emerg] open() "/var/run/nginx/nginx.pid" failed (2: No such file or dire

程序员文章站 2022-03-24 11:03:48
...

启动nginx报错

写道
nginx: [emerg] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)

 因为centos7(估计所有linux)下,创建了/var/run/nginx/目录存放nginx.pid,每次重启后,/var/run目录下都会清空。

 

修改vi nginx.conf

写道
#pid logs/nginx.pid;
pid /export/servers/nginxlog/nginx.pid;

 目录随便定,再启动就可以了