Nginx stopped working

Hi, on my server Nginx stopped. Restart doesn’t help. It seems that problem is with ports but don’t have any clue how to resolve this.

Results after Heartbeat check

STOPPED as of 10/10/2023, 09:35:51
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
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 Tue 2023-10-10 06:35:50 UTC; 1s ago
       Docs: man:nginx(8)
    Process: 1037 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 1038 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)

Oct 10 06:35:48 demo.lt nginx[1038]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Oct 10 06:35:48 demo.lt nginx[1038]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Oct 10 06:35:49 demo.lt nginx[1038]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Oct 10 06:35:49 demo.lt nginx[1038]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Oct 10 06:35:49 demo.lt nginx[1038]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Oct 10 06:35:49 demo.lt nginx[1038]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Oct 10 06:35:50 demo.lt nginx[1038]: nginx: [emerg] still could not bind()
Oct 10 06:35:50 demo.lt systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Oct 10 06:35:50 demo.lt systemd[1]: nginx.service: Failed with result 'exit-code'.
Oct 10 06:35:50 demo.lt systemd[1]: Failed to start A high performance web server and a reverse proxy server.

Hello @Romanas,

Have there been any services installed directly on the server via SSH recently?

no, but server was restarted (not by me). And I think the problem is that Apache web server is running

Hello @Romanas,

In that case, we would need to stop or uninstall Apache before we can restart NGINX.