I am trying to restart nginx with the command systemctl restart nginx
but I am unable to do this.
Error
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.constantly getting an error for this.
Then I typed in systemctl status nginx.service
and I got this
systemctl status nginx.service
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2018-02-11 22:19:23 UTC; 12s ago
Process: 25401 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
Process: 18943 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 27943 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Main PID: 18947 (code=exited, status=0/SUCCESS)
Can you please tell what's going on as I am trying to setup SSL on nginx from Namecheap when all this happened. For which I already have a question here.
Updated: I used the command nginx -t
which came out with the message below.
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2018/02/12 05:46:36 [warn] 29804#29804: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
2018/02/12 05:46:36 [emerg] 29804#29804: open() "/etc/nginx/sites-enabled/nano.save" failed (13: Permission denied) in /etc/nginx/nginx.conf:62
nginx: configuration file /etc/nginx/nginx.conf test failed