部署 nginx 配置文件测试不通过

Unknow user · March 03, 2013 · Last by guyanbiao replied at March 03, 2013 · 11968 hits

启动 Nginx 之前,可以用 nginx -t 检测一下配置文件是否正确。 以下是输出信息: nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied) 2013/03/03 11:57:32 [warn] 25539#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1 nginx: the configuration file /etc/nginx/nginx.conf syntax is ok 2013/03/03 11:57:32 [emerg] 25539#0: open() "/var/run/nginx.pid" failed (13: Permission denied) nginx: configuration file /etc/nginx/nginx.conf test failed

我曾经把默认用户从 www-data 改为我现时的用户名,nginx 对此有明确要求吗?其它的警告或错误该怎样修复?谢谢!

权限问题吧,就是说你现在的这个用户对 var/log/nginx/error.log 没有写的权限,用 chmod 加一下权限

You need to Sign in before reply, if you don't have an account, please Sign up first.