【发布时间】:2015-05-25 06:41:10
【问题描述】:
这是一个新的安装,其中 nginx 之前正常启动和停止。我相信在启用成功测试(nginx -t)的服务器块后会出现此错误。然后我尝试重新启动 nginx 并收到此错误:
nginx: [emerg] open() "/usr/share/nginx/on" failed (13: Permission denied)
在尝试重新启动之前,文件“on”不存在。它刚刚创建并且是空的。当我重新启动php-fmp(成功)然后尝试重新启动nginx时,错误变为:
nginx: [emerg] open() "/var/run/nginx.pid" failed (13: Permission denied)
nginx: configuration file /etc/nginx/nginx.conf test failed
但同样,当我运行 nginx -t 时,我得到:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
我认为这可能是用户问题,但它是作为 nginx 运行的:
# ps -elf | grep nginx
5 S nginx 2774 2773 0 80 0 - 234152 skb_re 22:07 ? 00:00:00 php-fpm: pool www
5 S nginx 2775 2773 0 80 0 - 234152 skb_re 22:07 ? 00:00:00 php-fpm: pool www
5 S nginx 2776 2773 0 80 0 - 234152 skb_re 22:07 ? 00:00:00 php-fpm: pool www
5 S nginx 2777 2773 0 80 0 - 234152 skb_re 22:07 ? 00:00:00 php-fpm: pool www
5 S nginx 2778 2773 0 80 0 - 234152 skb_re 22:07 ? 00:00:00 php-fpm: pool www
0 R root 2940 2472 0 80 0 - 25811 - 22:18 pts/0 00:00:00 grep nginx
另外,使用sudo nginx -t 不会改变任何东西。同样奇怪的是,即使 nginx 没有运行,也有一个 nginx.pid 。删除 pid 文件只会将错误消息改回:
nginx: [emerg] open() "/usr/share/nginx/on" failed (13: Permission denied)
删除on 文件也没有区别。
【问题讨论】: