GNU/Linux >> Linux の 問題 >  >> Ubuntu

Ubuntu 16.04にNginxをインストールするときにエラーが発生しますか?

nginxをインストールしようとすると、このエラーが発生し続けます。何度か再インストールしようとしましたが、このエラーが引き続き表示され、nginxを起動できません。

助けに感謝します!

Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
invoke-rc.d: initscript nginx, action "start" failed.
● 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 Mon 2017-03-27 21:38:51 PHT; 10ms ago
  Process: 28178 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
  Process: 28174 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)

Mar 27 21:38:49 nico-Aspire-E5-575G nginx[28178]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Mar 27 21:38:49 nico-Aspire-E5-575G nginx[28178]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Mar 27 21:38:50 nico-Aspire-E5-575G nginx[28178]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Mar 27 21:38:50 nico-Aspire-E5-575G nginx[28178]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Mar 27 21:38:51 nico-Aspire-E5-575G nginx[28178]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Mar 27 21:38:51 nico-Aspire-E5-575G nginx[28178]: nginx: [emerg] still could not bind()
Mar 27 21:38:51 nico-Aspire-E5-575G systemd[1]: nginx.service: Control process exited, code=exited status=1
Mar 27 21:38:51 nico-Aspire-E5-575G systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Mar 27 21:38:51 nico-Aspire-E5-575G systemd[1]: nginx.service: Unit entered failed state.
Mar 27 21:38:51 nico-Aspire-E5-575G systemd[1]: nginx.service: Failed with result 'exit-code'.
dpkg: error processing package nginx-core (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of nginx:
 nginx depends on nginx-core (>= 1.10.0-0ubuntu0.16.04.4) | nginx-full (>= 1.10.0-0ubuntu0.16.04.4) | nginx-light (>= 1.10.0-0ubuntu0.16.04.4) | nginx-extras (>= 1.10.0-0ubuntu0.16.04.4); however:
  Package nginx-core is not configured yet.
  Package nginx-full is not installed.
  Package nginx-light is not installed.
  Package nginx-extras is not installed.
 nginx depends on nginx-core (<< 1.10.0-0ubuntu0.16.04.4.1~) | nginx-full (<< 1.10.0-0ubuntu0.16.04.4.1~) | nginx-light (<< 1.10.0-0ubuntu0.16.04.4.1~) | nginx-extras (<< 1.10.0-0ubuntu0.16.04.4.1~); however:
  Package nginx-core is not configured yet.
  Package nginx-full is not installed.
  Package nginx-light is not installed.
  Package nginx-extras is not installed.

dpkg: error processing package nginx (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Processing triggers for systemd (229-4ubuntu16) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Errors were encountered while processing:
 nginx-core
 nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)

承認された回答:

ポート80で何かがすでに実行されているため、nginxが起動してそのポートを取得しようとすると、失敗します。ポート80で何が実行されているかを確認し、停止します。ポート80を使用しているものを次のように確認できます:

sudo netstat -lnp | grep 0.0.0.0:80

ポートを使用しているものを見つけたら、systemctl stopを実行します それを停止し、nginxを再起動してみてください。 nginxが正しく機能するには、他のサービスを永続的に無効にする必要があることに注意してください。

関連:Unity greeterの背景は、アップグレード後にユーザーに対して自動的に変更されませんか?
Ubuntu
  1. Ubuntu12.10へのVirtualBox4.2のインストール

  2. Ubuntu13.10にGoogleChromeをインストールするエラー[ハウツー]?

  3. Lua5.2対のインストール。 Ubuntu 16.10のLua5.3?

  1. Ubuntu18.04へのSNMPのインストール

  2. Ubuntu20.04へのPhpとNginxのインストールとセットアップ

  3. Ubuntu 12.04.02をUefiモードでインストールしますか?

  1. Ubuntu 11.10に起動音がありませんか?

  2. Ubuntu14.04にQt5.5.1をインストールする–ターミナルでQt.network.sslエラーをスローしますか?

  3. Dockerのインストール(Ubuntu)