hk77798
hk77798

Reputation: 25

not able to start nginx

i installed nginx in my machine and it installed correctly but not able to start nginx in my machine and whenever i try to start the nginx it shows error below i mentioned. whenever i run the command systemctl restart nginx && systemctl status nginx i got the error message :

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

after excuting the command : systemctl status nginx.service

following output is produces:

  `nginx.service - The NGINX HTTP and reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; disabled; vendor 
   preset: e Active: failed (Result: exit-code) since Mon 2018-09-10 
  14:57:14 IST;32s ago Process: 6321 ExecStartPre=/usr/sbin/nginx -t 
  (code=exited ,status=203/EXEC)`

`Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC systemd[1]: Starting The NGINX HTT
Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC systemd[1]: nginx.service: Control
Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC systemd[1]: Failed to start The NG
Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC systemd[1]: nginx.service: Unit en
Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC systemd[1]: nginx.service: Failed`

after excuting the command : journalctl -xe ,the output genreated is:

 `-- Unit nginx.service has begun starting up.
   Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC 
   systemd[6321]:nginx.service: Fail
   -- Subject: Process /usr/sbin/nginx could not be executed
   -- Defined-By: systemd
   -- Support: http://www.ubuntu.com/support
   -- 
   -- The process /usr/sbin/nginx could not be executed and failed.
   -- 
   -- The error number returned by this process is 2.
   Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC systemd[1]: 
   nginx.service: 
   Control
   Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC systemd[1]: Failed to 
   start The NG
   -- Subject: Unit nginx.service has failed
   -- Defined-By: systemd
   -- Support: http://www.ubuntu.com/support
   -- 
   -- Unit nginx.service has failed.
   -- 
   -- The result is failed.
   Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC systemd[1]: nginx.service: Unit en
   Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC systemd[1]:nginx.service: Failed 
   Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC polkitd(authority=local) [751]: Unr
   Sep 10 14:57:46 hk-HP-Pavilion-15-Notebook-PC systemd[1] Configuration file /li
   Sep 10 14:57:46 hk-HP-Pavilion-15-Notebook-PC systemd[1]:Configuration file /li`

search for the solution for this but didn't found any..Any help will be appreciated.

error log: 2018/09/10 15:50:47 [emerg] 7972#7972: bind() to 0.0.0.0:80 failed (98: Address already in use) 2018/09/10 15:50:47 [emerg] 7972#7972: bind() to [::]:80 failed (98: Address already in use) 2018/09/10 15:50:47 [emerg] 7972#7972: bind() to 0.0.0.0:80 failed (98: Address already in use) 2018/09/10 15:50:47 [emerg] 7972#7972: bind() to [::]:80 failed (98: Address already in use) 2018/09/10 15:50:47 [emerg] 7972#7972: bind() to 0.0.0.0:80 failed (98: Address already in use) 2018/09/10 15:50:47 [emerg] 7972#7972: bind() to [::]:80 failed (98: Address already in use) 2018/09/10 15:50:47 [emerg] 7972#7972: bind() to 0.0.0.0:80 failed (98: Address already in use) 2018/09/10 15:50:47 [emerg] 7972#7972: bind() to [::]:80 failed (98: Address already in use) 2018/09/10 15:50:47 [emerg] 7972#7972: bind() to 0.0.0.0:80 failed (98: Address already in use) 2018/09/10 15:50:47 [emerg] 7972#7972: bind() to [::]:80 failed (98: Address already in use) 2018/09/10 15:50:47 [emerg] 7972#7972: still could not bind()

Upvotes: 0

Views: 4966

Answers (1)

user10278644
user10278644

Reputation:

Like the last error says you are using the port 80, check if you have apache on port 80

userful command:

netstat -tlpn

Upvotes: 1

Related Questions