Hello, When I do sudo nginx -t, I get told this: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
But, when I do
service nginx restart I get:
But, when I do sudo service nginx restart I get:
Lastly, if I do niginx -t without “sudo” I get: nginx: [alert] could not open error log file: open() “/var/log/nginx/error.log” failed (13: Permission denied) 2016/04/30 12:11:48 [warn] 16918#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 2016/04/30 12:11:48 [emerg] 16918#0: open() “/run/nginx.pid” failed (13: Permission denied) nginx: configuration file /etc/nginx/nginx.conf test failed
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $100 of credit to try our products over 60 days!