gpt4 book ai didi

nginx - CentOS 6.6 与 Nginx 1.6.2 - 突然无法重启 nginx - nginx : [emerg] open() “/usr/share/nginx/on” failed (13: Permission denied)

转载 作者:可可西里 更新时间:2023-11-01 01:00:18 28 4
gpt4 key购买 nike

这是一个新安装,之前 nginx 正常启动和停止。我相信这个错误是在启用成功测试(nginx -t)的服务器 block 之后出现的。然后我尝试重新启动 nginx 并收到此错误:

nginx: [emerg] open() "/usr/share/nginx/on"失败(13:权限被拒绝)

在尝试重新启动之前文件“on”不存在。它刚刚创建并且是空的。当我重新启动 php-fmp(成功)然后尝试重新启动 nginx 时,错误更改为:

nginx: [emerg] open() "/var/run/nginx.pid"失败(13:权限被拒绝)
nginx: 配置文件/etc/nginx/nginx.conf 测试失败

但同样,当我运行 nginx -t 时,我得到:

nginx: 配置文件/etc/nginx/nginx.conf 语法没问题
nginx: 配置文件/etc/nginx/nginx.conf 测试成功

我认为这可能是用户问题,但它作为 nginx 运行:

# ps -elf | grep nginx
5 S nginx 2774 2773 0 80 0 - 234152 skb_re 22:07 ? 00:00:00 php-fpm:池 www
5 S nginx 2775 2773 0 80 0 - 234152 skb_re 22:07 ? 00:00:00 php-fpm:池 www
5 S nginx 2776 2773 0 80 0 - 234152 skb_re 22:07 ? 00:00:00 php-fpm:池 www
5 S nginx 2777 2773 0 80 0 - 234152 skb_re 22:07 ? 00:00:00 php-fpm:池 www
5 S nginx 2778 2773 0 80 0 - 234152 skb_re 22:07 ? 00:00:00 php-fpm:池 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"失败(13:权限被拒绝)

删除 on 文件也没有任何区别。

最佳答案

确保您以 super 用户身份运行。

sudo nginx -t

关于nginx - CentOS 6.6 与 Nginx 1.6.2 - 突然无法重启 nginx - nginx : [emerg] open() “/usr/share/nginx/on” failed (13: Permission denied),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29190522/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com