nginx: [error] open() “/run/nginx.pid” failed (2: No such file or directory)

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

解决方法:找到你的nginx.conf的文件夹目录,然后运行类似如下命令

nginx -c etc/nginx/nginx.conf

再运行nginx -s reload,就可以了。

如下图:

nginx: [error] open() “/run/nginx.pid” failed (2:

案例2:

如果启动Nginx出现如下错误:

原因:当前用户对该位置没有写入权限,输入su和密码进入root模式后,重新启动服务器就好了,原因是因为没有权限。

nginx: [error] open() “/run/nginx.pid” failed (2:

注:以非root权限启动时,会出现 nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied) 错误。那就以root权限启动就好。

猜你喜欢

转载自www.linuxidc.com/Linux/2018-11/155150.htm