大家好,又见面了,我是你们的朋友全栈君。
服务器重启后,重启nginx时报错nginx: [error] open() “/usr/local/nginx/logs/nginx.pid” failed (2: No such file or directory),进入到logs目录发现确实没有nginx.pid文件
使用指定nginx.conf文件的方式重启nginx
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
如果还是不行可能就是nginx.conf的nginx.pid被注释了,将下图中pid前的#去掉,保存退出再次启动nginx
解决:查看端口
netstat -ntlp
找到80端口
杀掉进程
kill 6751
重新查看
重新启动
service nginx restart
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/170291.html原文链接:https://javaforall.cn
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有