解决nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)错误


服务器重启后,重启nginx时报错nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory),进入到logs目录发现确实没有nginx.pid文件

cd /usr/local/nginx/sbin/ ./nginx -s reload ngx_http_fastdfs_set pid=1412 ngx_http_fastdfs_set pid=1412 ngx_http_fastdfs_set pid=1412 ngx_http_fastdfs_set pid=1412 nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory) 

解决办法

使用指定nginx.conf文件的方式重启nginx

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf 

此时去logs目录下查看发现nginx.pid文件已经生成了


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM