Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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/" 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?

share|improve this question

migrated from Feb 16 '11 at 22:55

This question came from our site for professional and enthusiast programmers.

up vote 9 down vote accepted

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/
share|improve this answer

Just start the nginx as the root user or using sudo

$>sudo /etc/init.d/nginx start

$>sudo service nginx start

Not sure on which operative system you are. Set the user owner in your nginx.conf,2664

share|improve this answer
Dheivame ye kadavule... realy your answer helped me alot :) Thanks – Abhiram Oct 6 '14 at 21:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.