grrrero
By:
grrrero

Problems installing nginx on Ubuntu WordPress 4.9.1 on 16.04

January 23, 2018 136 views
Nginx Ubuntu Ubuntu 16.04

Tried following instructions from https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-14-04-lts

Jan 23 02:32:54 reasonstodothings nginx[16285]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
Jan 23 02:32:54 reasonstodothings nginx[16285]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
Jan 23 02:32:54 reasonstodothings nginx[16285]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
Jan 23 02:32:55 reasonstodothings nginx[16285]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
Jan 23 02:32:55 reasonstodothings nginx[16285]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
Jan 23 02:32:55 reasonstodothings nginx[16285]: nginx: [emerg] still could not bind()
Jan 23 02:32:55 reasonstodothings systemd[1]: nginx.service: Control process exited, code=exited status=1
Jan 23 02:32:55 reasonstodothings systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Jan 23 02:32:55 reasonstodothings systemd[1]: nginx.service: Unit entered failed state.
Jan 23 02:32:55 reasonstodothings 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.3-0ubuntu0.16.04.2) | nginx-full (>= 1.10.3-0ubuntu0.16.04.2) | nginx-light (>= 1.10.3-0ubuntu0.16.04.2) | nginx-extras (>= 1.10.3-0ubuntu0.16.04.2); 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.3-0ubuntu0.16.04.2.1~) | nginx-full (<< 1.10.3-0ubuntu0.16.04.2.1~) | nginx-light (<< 1.10.3-0ubuntu0.16.04.2.1~) | nginx-extras (<< 1.10.3-0ubuntu0.16.04.2.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.
                                                                                                          Errors were encountered while processing:
 nginx-core
 nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)
1 Answer

Did you attempt to follow these instructions on a server that already has Apache or another web server installed?

Because another server is already using port 80, Nginx cannot get access to that port. Before you continue you will want to remove any existing web server other than Nginx from your server.

apt-get update;
apt-get remove apache2;
Have another answer? Share your knowledge.