Nginx Restart Issues

nginxterminal

All of the sudden when restarting Nginx I get the following error:

Restarting nginx: [alert]: could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2011/02/16 17:20:58 [warn] 23925#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
the configuration file /etc/nginx/nginx.conf syntax is ok
2011/02/16 17:20:58 [emerg] 23925#0: open() "/var/run/nginx.pid" failed (13: Permission denied)
configuration file /etc/nginx/nginx.conf test failed

On the front end part of the site loads but some files such as the CSS in particular are not loading. They exist on the server but when loading the resources directly in Chrome they say "Oops this page can't be found."

I set a special group and user to run my apache files using suexec for my domain files. I think the nginx are owned by root however which I'm assuming is the problem but which nginx file ownerships would I change?

Best Answer

Or, you can change the nginx.log file permissions so they match your current user which you use to start nginx:

chown your_user /var/log/nginx/error.log

I suggest you add this permisions to the entire nginx log dir

chown -R your_user /var/log/nginx/