Debianの安定版でnginxのインストールが失敗する

Debianの安定版でnginxのインストールが失敗する

nginxをインストールしようとすると、apt次のエラーが発生します。

Selecting previously unselected package nginx-common.
(Reading database ... 137404 files and directories currently installed.)
Preparing to unpack .../00-nginx-common_1.10.3-1+deb9u1_all.deb ...
Unpacking nginx-common (1.10.3-1+deb9u1) ...
Selecting previously unselected package libnginx-mod-http-auth-pam.
Preparing to unpack .../01-libnginx-mod-http-auth-pam_1.10.3-1+deb9u1_amd64.deb ...
Unpacking libnginx-mod-http-auth-pam (1.10.3-1+deb9u1) ...
Selecting previously unselected package libnginx-mod-http-dav-ext.
Preparing to unpack .../02-libnginx-mod-http-dav-ext_1.10.3-1+deb9u1_amd64.deb ...
Unpacking libnginx-mod-http-dav-ext (1.10.3-1+deb9u1) ...
Selecting previously unselected package libnginx-mod-http-echo.
Preparing to unpack .../03-libnginx-mod-http-echo_1.10.3-1+deb9u1_amd64.deb ...
Unpacking libnginx-mod-http-echo (1.10.3-1+deb9u1) ...
Selecting previously unselected package libnginx-mod-http-geoip.
Preparing to unpack .../04-libnginx-mod-http-geoip_1.10.3-1+deb9u1_amd64.deb ...
Unpacking libnginx-mod-http-geoip (1.10.3-1+deb9u1) ...
Selecting previously unselected package libnginx-mod-http-image-filter.
Preparing to unpack .../05-libnginx-mod-http-image-filter_1.10.3-1+deb9u1_amd64.deb ...
Unpacking libnginx-mod-http-image-filter (1.10.3-1+deb9u1) ...
Selecting previously unselected package libnginx-mod-http-subs-filter.
Preparing to unpack .../06-libnginx-mod-http-subs-filter_1.10.3-1+deb9u1_amd64.deb ...
Unpacking libnginx-mod-http-subs-filter (1.10.3-1+deb9u1) ...
Selecting previously unselected package libnginx-mod-http-upstream-fair.
Preparing to unpack .../07-libnginx-mod-http-upstream-fair_1.10.3-1+deb9u1_amd64.deb ...
Unpacking libnginx-mod-http-upstream-fair (1.10.3-1+deb9u1) ...
Selecting previously unselected package libnginx-mod-http-xslt-filter.
Preparing to unpack .../08-libnginx-mod-http-xslt-filter_1.10.3-1+deb9u1_amd64.deb ...
Unpacking libnginx-mod-http-xslt-filter (1.10.3-1+deb9u1) ...
Selecting previously unselected package libnginx-mod-mail.
Preparing to unpack .../09-libnginx-mod-mail_1.10.3-1+deb9u1_amd64.deb ...
Unpacking libnginx-mod-mail (1.10.3-1+deb9u1) ...
Selecting previously unselected package libnginx-mod-stream.
Preparing to unpack .../10-libnginx-mod-stream_1.10.3-1+deb9u1_amd64.deb ...
Unpacking libnginx-mod-stream (1.10.3-1+deb9u1) ...
Selecting previously unselected package nginx-full.
Preparing to unpack .../11-nginx-full_1.10.3-1+deb9u1_amd64.deb ...
Unpacking nginx-full (1.10.3-1+deb9u1) ...
Selecting previously unselected package nginx.
Preparing to unpack .../12-nginx_1.10.3-1+deb9u1_all.deb ...
Unpacking nginx (1.10.3-1+deb9u1) ...
Processing triggers for ufw (0.35-4) ...
Setting up nginx-common (1.10.3-1+deb9u1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /lib/systemd/system/nginx.service.
Setting up libnginx-mod-http-image-filter (1.10.3-1+deb9u1) ...
Setting up libnginx-mod-http-subs-filter (1.10.3-1+deb9u1) ...
Processing triggers for systemd (232-25+deb9u1) ...
Setting up libnginx-mod-http-auth-pam (1.10.3-1+deb9u1) ...
Setting up libnginx-mod-http-dav-ext (1.10.3-1+deb9u1) ...
Setting up libnginx-mod-mail (1.10.3-1+deb9u1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up libnginx-mod-http-xslt-filter (1.10.3-1+deb9u1) ...
Setting up libnginx-mod-http-upstream-fair (1.10.3-1+deb9u1) ...
Setting up libnginx-mod-http-geoip (1.10.3-1+deb9u1) ...
Setting up libnginx-mod-stream (1.10.3-1+deb9u1) ...
Setting up libnginx-mod-http-echo (1.10.3-1+deb9u1) ...
Setting up nginx-full (1.10.3-1+deb9u1) ...
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 Wed 2018-01-03 08:12:19 GMT; 35ms ago
     Docs: man:nginx(8)
  Process: 1563 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
  Process: 1561 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)

Jan 03 08:12:17 testingBed nginx[1563]: nginx: [emerg] listen() to [::]:80, …se)
Jan 03 08:12:18 testingBed nginx[1563]: nginx: [emerg] listen() to 0.0.0.0:8…se)
Jan 03 08:12:18 testingBed nginx[1563]: nginx: [emerg] listen() to [::]:80, …se)
Jan 03 08:12:18 testingBed nginx[1563]: nginx: [emerg] listen() to 0.0.0.0:8…se)
Jan 03 08:12:18 testingBed nginx[1563]: nginx: [emerg] listen() to [::]:80, …se)
Jan 03 08:12:19 testingBed nginx[1563]: nginx: [emerg] still could not bind()
Jan 03 08:12:19 testingBed systemd[1]: nginx.service: Control process exite…us=1
Jan 03 08:12:19 testingBed systemd[1]: Failed to start A high performance w…ver.
Jan 03 08:12:19 testingBed systemd[1]: nginx.service: Unit entered failed state.
Jan 03 08:12:19 testingBed systemd[1]: nginx.service: Failed with result 'e…de'.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: error processing package nginx-full (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of nginx:
 nginx depends on nginx-full (<< 1.10.3-1+deb9u1.1~) | nginx-light (<< 1.10.3-1+deb9u1.1~) | nginx-extras (<< 1.10.3-1+deb9u1.1~); however:
  Package nginx-full is not configured yet.
  Package nginx-light is not installed.
  Package nginx-extras is not installed.
 nginx depends on nginx-full (>= 1.10.3-1+deb9u1) | nginx-light (>= 1.10.3-1+deb9u1) | nginx-extras (>= 1.10.3-1+deb9u1); however:
  Package nginx-full is not configured yet.
  Package nginx-light is not installed.
  Package nginx-extras is not installed.

dpkg: error processing package nginx (--configure):
 dependency problems - leaving unconfigured
Processing triggers for ufw (0.35-4) ...
Errors were encountered while processing:
 nginx-full
 nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)

ベストアンサー1

エラーメッセージはnginxポート80にバインドできないことを示しています。

最も可能性の高い原因は、すでにポート80を受信して​​いる他のWebサーバー(おそらくapache以前のバージョン)があることですnginx

この場合は、古いWebサーバーを停止してインストールを続行してください。

dpkg --configure --pending

nginx別のオプションは、別のポートでリスンするように設定(またはApache)することです。 8080は、「セカンダリ」Webサーバーで一般的で広く使用されている選択です。または、ホストに複数のIPアドレスがある場合は、別のIPアドレスを使用してください。

おすすめ記事