Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have switched recently to nginx from Apache2.

I have setup everything and when I sudo nginx -t it says everything is fine.

but when I just do nginx -t I get the following errors:

nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2012/10/24 12:22:16 [warn] 23075#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
2012/10/24 12:22:16 [emerg] 23075#0: SSL_CTX_use_PrivateKey_file("/etc/ssl/private/myapp.key") failed (SSL: error:0200100D:system library:fopen:Permission denied error:20074002:BIO routines:FILE_CTRL:system lib error:140B0002:SSL routines:SSL_CTX_use_PrivateKey_file:system lib)

Respectively the following seem also to restart without any error:

sudo service nginx reload
sudo service nginx restart
sudo service php5-fpm restart

Is this expected?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Yes, it is expected if you run nginx -t as a non-privileged user. When running the commands with sudo(8), you run them as the root-user and you will have access to open the logfiles which you don't seem to have as your personal user.

nginx -t should be run as the same user as you start nginx from for correct results.

share|improve this answer
add comment

Your Answer

 
discard

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.