nginx停止后再启动出现: [error] open() "/usr/local/nginx/logs/nginx.pid" failed错误的解决方法

为了备份数据 手动停止了服务器的nginx 结果启动时报错

 

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

错误的原因就是配置文件无法找到

解决办法

使用nginx -c 来指定配置文件的地址

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

前面为nginx目录 -c 后为配置的目录

指定配置文件之后 重启即可

nginx -s reload

 

posted @ 2016-12-03 16:16  long隆  阅读(571)  评论(0编辑  收藏  举报