Centos7下nginx启动提示Can't open PID file /var/run/nginx.pid
作者:
来源:本站原创
点击数: 次
发布时间:2022年09月14日
错误截图如下:
1.nginx -V;查看默认的PID路径;并检查该路径下是否存在nginx.pid文件;
2.找到/usr/lib/systemd/system/nginx.service;修改PIDFile=/etc/nginx/logs/nginx.pid
3.vim /usr/lib/systemd/system/nginx.service;
4.vim /etc/nginx/nginx.conf;添加pid /etc/nginx/logs/nginx.pid ;
5.sudo systemctl daemon-reload
nginx -s reload
6.重新启动nginx即可 systemctl restart nginx