Ngnix,无法安装

时间:2019-02-27 15:58:18

标签: apache ubuntu nginx

我在Ubuntu中安装了Nginx,但未按预期工作,因此我删除并尝试再次安装它,但未安装并引发一些异常:

我使用的命令:sudo apt install nginx

root@INDSRV09:~# sudo apt install nginx
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libgd3 libvpx3 nginx-common nginx-core
Suggested packages:
  libgd-tools fcgiwrap nginx-doc
The following NEW packages will be installed:
  libgd3 libvpx3 nginx nginx-common nginx-core
0 upgraded, 5 newly installed, 0 to remove and 138 not upgraded.
Need to get 0 B/1,316 kB of archives.
After this operation, 4,247 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Preconfiguring packages ...
Selecting previously unselected package libvpx3:amd64.
(Reading database ... 78639 files and directories currently installed.)
Preparing to unpack .../libvpx3_1.5.0-2ubuntu1_amd64.deb ...
Unpacking libvpx3:amd64 (1.5.0-2ubuntu1) ...
Selecting previously unselected package libgd3:amd64.
Preparing to unpack .../libgd3_2.1.1-4ubuntu0.16.04.10_amd64.deb ...
Unpacking libgd3:amd64 (2.1.1-4ubuntu0.16.04.10) ...
Selecting previously unselected package nginx-common.
Preparing to unpack .../nginx-common_1.10.3-0ubuntu0.16.04.3_all.deb ...
Unpacking nginx-common (1.10.3-0ubuntu0.16.04.3) ...
Selecting previously unselected package nginx-core.
Preparing to unpack .../nginx-core_1.10.3-0ubuntu0.16.04.3_amd64.deb ...
Unpacking nginx-core (1.10.3-0ubuntu0.16.04.3) ...
Selecting previously unselected package nginx.
Preparing to unpack .../nginx_1.10.3-0ubuntu0.16.04.3_all.deb ...
Unpacking nginx (1.10.3-0ubuntu0.16.04.3) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for systemd (229-4ubuntu21.4) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Setting up libvpx3:amd64 (1.5.0-2ubuntu1) ...
Setting up libgd3:amd64 (2.1.1-4ubuntu0.16.04.10) ...
Setting up nginx-common (1.10.3-0ubuntu0.16.04.3) ...
Setting up nginx-core (1.10.3-0ubuntu0.16.04.3) ...
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 2019-02-27 09:42:27 CST; 14ms ago
  Process: 9655 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
  Process: 9649 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)

Feb 27 09:42:25 INDSRV09 nginx[9655]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Feb 27 09:42:25 INDSRV09 nginx[9655]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Feb 27 09:42:26 INDSRV09 nginx[9655]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Feb 27 09:42:26 INDSRV09 nginx[9655]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Feb 27 09:42:27 INDSRV09 nginx[9655]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Feb 27 09:42:27 INDSRV09 nginx[9655]: nginx: [emerg] still could not bind()
Feb 27 09:42:27 INDSRV09 systemd[1]: nginx.service: Control process exited, code=exited status=1
Feb 27 09:42:27 INDSRV09 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Feb 27 09:42:27 INDSRV09 systemd[1]: nginx.service: Unit entered failed state.
Feb 27 09:42:27 INDSRV09 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.3) | nginx-full (>= 1.10.3-0ubuntu0.16.04.3) | nginx-light (>= 1.10.3-0ubuntu0.16.04.3) | nginx-extras (>= 1.10.3-0ubuntu0.16.04.3); 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.3.1~) | nginx-full (<< 1.10.3-0ubuntu0.16.04.3.1~) | nginx-light (<< 1.10.3-0ubuntu0.16.04.3.1~) | nginx-extras (<< 1.10.3-0ubuntu0.16.04.3.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 libc-bin (2.23-0ubuntu10) ...
Processing triggers for systemd (229-4ubuntu21.4) ...
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)

然后我安装了Apache,后来又停止了它。

另一个困惑甚至是我手动卸载和删除了文件夹,当我尝试访问时,可以在UI上看到Nginx: enter image description here

最近4天,我一直在努力解决这个问题。

有人可以帮我吗?

预先感谢。

嗨,

感谢您的回复:

root@INDSRV09:~# service nginx status
● 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 2019-02-27 09:42:27 CST; 18h ago

Feb 27 09:42:25 INDSRV09 nginx[9655]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Feb 27 09:42:25 INDSRV09 nginx[9655]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Feb 27 09:42:26 INDSRV09 nginx[9655]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Feb 27 09:42:26 INDSRV09 nginx[9655]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Feb 27 09:42:27 INDSRV09 nginx[9655]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Feb 27 09:42:27 INDSRV09 nginx[9655]: nginx: [emerg] still could not bind()
Feb 27 09:42:27 INDSRV09 systemd[1]: nginx.service: Control process exited, code=exited status=1
Feb 27 09:42:27 INDSRV09 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Feb 27 09:42:27 INDSRV09 systemd[1]: nginx.service: Unit entered failed state.
Feb 27 09:42:27 INDSRV09 systemd[1]: nginx.service: Failed with result 'exit-code'.

0 个答案:

没有答案