nginx falha instalação no Debian estável

1

Quando tento instalar nginx com apt , este é o erro que recebo:

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)
    
por Emil Zahariev 03.01.2018 / 09:29

1 resposta

2

A mensagem de erro diz que nginx não pode ligar (à porta 80).

A causa mais provável é que você já tenha outro servidor da Web escutando na porta 80 - talvez apache ou uma versão mais antiga de nginx .

Se for esse o caso, pare o servidor da web antigo e continue a instalação com:

dpkg --configure --pending

Outra alternativa seria configurar nginx (ou apache) para escutar em uma porta diferente. O 8080 é uma opção comum e popular para servidores Web "secundários". Ou em um endereço IP diferente, se a máquina host tiver vários endereços IP disponíveis para ele.

    
por 03.01.2018 / 09:58

Tags