美文网首页nginx
解决nginx: [error] open() "/usr/lo

解决nginx: [error] open() "/usr/lo

作者: 杨建林 | 来源:发表于2018-08-20 17:06 被阅读0次

使用nginx -s reload重新读取配置文件,发现报

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

错误,进到logs文件发现没有nginx.pid文件

使用nginx -c的参数指定nginx.conf文件的位置

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

提示:nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

killall -9 nginx

杀掉nginx 进程 然后重启就行了。

service nginx restart

另外 还有一个很重要的可能

ps -ef | grep nginx 

看下主目录 是哪里 是不是装了两个可恶的 Nginx 哈哈nginx

相关文章

网友评论

    本文标题:解决nginx: [error] open() "/usr/lo

    本文链接:https://www.haomeiwen.com/subject/tfbliftx.html