我遵循此过程在Ubuntu 10.04 Lucid Server http://library.linode.com/web-servers/nginx/installation/ubuntu-10.04-lucid上安装nginx
在创建用于启动nginx的初始化脚本然后调用/etc/init.d/nginx start之后,我迷路了。当我这样做时,出现以下错误:
Starting nginx_main: Starting /opt/nginx/sbin/nginx...
nginx: [alert] could not open error log file: open() "/opt/nginx/logs/error.log" failed (13: Permission denied)
2012/03/16 18:17:27 [emerg] 859#0: open() "/opt/nginx/logs/access.log" failed (13: Permission denied)
我可以运行它的唯一方法是,如果我使用sudo
它root
,并且它以的方式运行该进程,那是我不想要的。
我已经建立chown
了整个目录(chown -R nginx:nginx /opt/nginx
),也已经建立chmod -R 755
了目录。
user
按照CS3的建议添加指令也给了我这个错误,但是还有一行。
Starting nginx_main: Starting /opt/nginx/sbin/nginx...
nginx: [alert] could not open error log file: open() "/opt/nginx/logs/error.log" failed (13: Permission denied)
2012/03/16 18:48:34 [warn] 1606#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /opt/nginx/conf/nginx.conf:2
2012/03/16 18:48:34 [emerg] 1606#0: open() "/opt/nginx/logs/access.log" failed (13: Permission denied)
有任何想法吗?
and I've also chmod -R 755 the directory as well
继续这样做,最终您将为此付出代价。目睹互联网上有多少人建议将其作为“解决”任何问题的第一电话口,实在令人震惊。如果您做一些事,Unix不会给出友好的反馈。