не в состоянии запустить nginx - PullRequest
0 голосов
/ 10 сентября 2018

я установил nginx на мою машину, и он установился правильно, но не смог запустить nginx на моей машине, и всякий раз, когда я пытаюсь запустить nginx, отображается ошибка, о которой я упоминал. всякий раз, когда я запускаю команду systemctl restart nginx && systemctl status nginx я получил сообщение об ошибке:

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

после исключения команды: systemctl status nginx.service

следующий результат:

  `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`

после исключения команды: journalctl -xe, сгенерированный вывод:

 `-- 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`

ищите решение для этого, но не нашли ... Любая помощь будет оценена.

журнал ошибок: 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()

1 Ответ

0 голосов
/ 10 сентября 2018

Как в последней ошибке говорится, что вы используете порт 80, проверьте, есть ли у вас apache на порту 80

пользовательская команда:

netstat -tlpn

...