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

发布于:2023-07-04 ⋅ 阅读:(122) ⋅ 点赞:(0)

重启nginx报错,提示:
[emerg] open() “/var/run/nginx/nginx.pid” failed (2: No such file or directory)
解决:在var/run/下建立一个文件夹命名为nginx,然后:

[root@localhost ~]# /usr/local/nginx/sbin/nginx 
[root@localhost ~]# /usr/local/nginx/sbin/nginx -s reload 

详细教程:
https://blog.csdn.net/qq_36004521/article/details/79583194

centos 6 7都基本一样,,,6里面没有nginx.pid。
还有要关掉防火墙。

在这里插入图片描述


网站公告

今日签到

点亮在社区的每一天
去签到