-1

I shutdown and powered on my linode server that I setup via Serverpilot because it was going online and offline. However, since the reboot I am unable to access my website.

I can access files via FTP and SSH. But, the website is down.

it is using letsencpt SSL.

To troubleshoot the issue, I ran a few commands:

**I tried to restart nginx and got this**

root@localhost:~# sudo service nginx-sp restart
Job for nginx-sp.service failed because the control process exited with error code. See "systemctl status nginx-sp.service" and "journalctl -xe" for details.


root@localhost:~# systemctl status nginx-sp.service
? nginx-sp.service - nginx-sp
Loaded: loaded (/lib/systemd/system/nginx-sp.service; enabled; vendor preset: enabled)
Active: failed (Result: start-limit-hit) since Tue 2021-01-05 08:33:24 UTC; 49s ago
Process: 1928 ExecStartPre=/opt/sp/nginx/sbin/nginx -t (code=exited, status=1/FAILURE)

Jan 05 08:33:23 localhost systemd[1]: nginx-sp.service: Control process exited, code=exited status=1
Jan 05 08:33:23 localhost systemd[1]: Failed to start nginx-sp.
Jan 05 08:33:23 localhost systemd[1]: nginx-sp.service: Unit entered failed state.
Jan 05 08:33:23 localhost systemd[1]: nginx-sp.service: Failed with result 'exit-code'.
Jan 05 08:33:24 localhost systemd[1]: nginx-sp.service: Service hold-off time over, scheduling restart.
Jan 05 08:33:24 localhost systemd[1]: Stopped nginx-sp.
Jan 05 08:33:24 localhost systemd[1]: nginx-sp.service: Start request repeated too quickly.
Jan 05 08:33:24 localhost systemd[1]: Failed to start nginx-sp.
Jan 05 08:33:24 localhost systemd[1]: nginx-sp.service: Unit entered failed state.
Jan 05 08:33:24 localhost systemd[1]: nginx-sp.service: Failed with result 'start-limit-hit'.

The command sudo nginx-sp -t return the following error

root@localhost:~# sudo nginx-sp -t
nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx-sp/v hosts.d/phoencurrent-ssl.conf:6
nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx-sp/v hosts.d/techswatch-ssl.conf:6
nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx-sp/v hosts.d/thetechminute-ssl.conf:6
nginx: the configuration file /etc/nginx-sp/nginx.conf syntax is ok
nginx: [emerg] open() "/srv/users/serverpilot/log/phoencurrent/dev_nginx.access.log" failed (2: No such file o r directory)
nginx: configuration file /etc/nginx-sp/nginx.conf test failed

Any help in this regard is highly appreciated.

  • 2
    `nginx: [emerg] open() "/srv/users/serverpilot/log/phoencurrent/dev_nginx.access.log" failed (2: No such file o r directory)`. It seems obvious what to check next. – Gerald Schneider Jan 05 '21 at 10:40
  • Can you please be a more specific about what should I check next? I am new to this SSH thing. – Tecchi Techi Jan 05 '21 at 12:52
  • Does the directory where the log file should be written to exist? Does the user nginx is running under have the permissions to enter and write to the directory? – Gerald Schneider Jan 05 '21 at 12:54
  • Does the directory where the log file should be written to exist? I checked through the FTP client and no such directory exists.. Does the user nginx is running under have the permissions to enter and write to the directory? I am not sure how to check this one. PS: I had multiple domains on this server, but currently only one, which is www.thetechminute.com. – Tecchi Techi Jan 05 '21 at 13:03
  • Sorry, but we are not doing Linux basic courses on this site. You should know the way around the servers you manage. If you need help about creating directories and setting permissions please google for Linux beginner tutorials. – Gerald Schneider Jan 05 '21 at 13:11
  • That's all right. I was able to resolve the issue by creating two missing directories and then restarting Nginx. Thank you for pointing in the right direction. – Tecchi Techi Jan 05 '21 at 16:03

1 Answers1

0

I was able to resolve the issue by creating two new directories that the error message was showing as Non-existing.

nginx: [emerg] open() "/srv/users/serverpilot/log/phoencurrent/dev_nginx.access.log" failed (2: No such file o r directory) nginx: configuration file /etc/nginx-sp/nginx.conf test failed

So all I had to create was a new directory named phoencurrent under /srv/users/serverpilot/log. Restarted Nginx and the issue resolved now.