Nginx Does Not Start in Ubuntu

Asked 2 years ago, Updated 2 years ago, 53 views

I'm trying to launch nginx on Ubuntu, but I get the following error message:

$sudo service nginx start

Job for nginx.service failed cause the control process expired with error code.See "systemctl status nginx.service" and "journalctl-xe" for details.

So I ran "systemctl status nginx.service".
Then the message came to the following:

$systemctl status nginx.service
● nginx.service-nginx-high performance web server
   Loaded: loaded(/lib/systemd/system/nginx.service; enabled; vendor preset:en
enabled)
   Active: failed (Result: exit-code) since water 2018-10-3109:08:49 JST; 9minago
     Docs: http://nginx.org/en/docs/
  Process: 19669 ExecStart=/usr/sbin/nginx-c/etc/nginx/nginx.conf (code=exited)
, status=1/FAILURE)

October 31 09:08:47 ubuntunginx [19669]: nginx: [emerg] bind() to 0.0.0.0:80 failed
 (98: Address already in use)
October 31 09:08:47 ubuntunginx [19669]: nginx: [emerg] bind() to 0.0.0.0:80 failed
 (98: Address already in use)
October 31 09:08:48 ubuntunginx [19669]: nginx: [emerg] bind() to 0.0.0.0:80 failed
 (98: Address already in use)
October 31 09:08:48 ubuntunginx [19669]: nginx: [emerg] bind() to 0.0.0.0:80 failed
 (98: Address already in use)
October 31 09:08:49 ubuntunginx [19669]: nginx: [emerg] bind() to 0.0.0.0:80 failed
 (98: Address already in use)
October 31 09:08:49 ubuntunginx [19669]: nginx: [emerg] still could not bind()
October 31 09:08:49 ubuntu systemd[1]:nginx.service:Control process expired, code=
exited status = 1
October 31 09:08:49 ubuntu systemd[1]—Failed to start nginx-high performance web
 server.
October 31 09:08:49 ubuntu systemd[1]:nginx.service:Unit entered failed state.
October 31 09:08:49 ubuntu systemd[1]: nginx.service: Failed with result' exit-code
'.

Next, we ran aljournalctl-xe 」.
Then the message came to the following:

$journalctl-exe


    -- Unit nginx.service has been started up.
    October 31 09:08:47 ubuntunginx [19669]: nginx: [emerg] bind() to 0.0.0.0:80 failed
    October 31 09:08:47 ubuntunginx [19669]: nginx: [emerg] bind() to 0.0.0.0:80 failed
    October 31 09:08:48 ubuntunginx [19669]: nginx: [emerg] bind() to 0.0.0.0:80 failed
    October 31 09:08:48 ubuntunginx [19669]: nginx: [emerg] bind() to 0.0.0.0:80 failed
    October 31 09:08:49 ubuntunginx [19669]: nginx: [emerg] bind() to 0.0.0.0:80 failed
    October 31 09:08:49 ubuntunginx [19669]: nginx: [emerg] still could not bind()
    October 31 09:08:49 ubuntu systemd[1]:nginx.service:Control process expired, code=
    October 31 09:08:49 ubuntu systemd[1]—Failed to start nginx-high performance web
    -- Subject: Unit nginx.service has failed
    -- Defined-By:systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    -- 
    -- Unit nginx.service has failed.
    -- 
    -- The result is failed.
    October 31 09:08:49 ubuntu systemd[1]:nginx.service:Unit entered failed state.
    October 31 09:08:49 ubuntu systemd[1]: nginx.service: Failed with result' exit-code
    October 31 09:08:49 ubuntu sudo [19637]: pam_unix(sudo:session): session closed for 
    October 31 09:09:22 ubuntu wpa_supplicant [2635]:wlp2s0:WPA:Group rekeying complete
    October 31 09:09:42 ubuntu sudo [19968]: flickfit: TTY=pts/2; PWD=/home/fl
    October 31 09:09:42 ubuntu sudo [199698]: pam_unix(sudo:session): session opened for 

There seems to be something wrong with the settings, but I don't know what's wrong or what to do.
If you know anything, please take care of me.
The environment is as follows:

·ubuntu 16.04
·nginx/1.14.0

This matter has been resolved by itself, so I will close it.
Thank you for your cooperation.

ubuntu nginx

2022-09-30 11:56

1 Answers

The reason is that other applications were using port 80.
(From the comments section)


2022-09-30 11:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.