【问题标题】:Nginx installation errors in debian 8.3debian 8.3 中的 Nginx 安装错误
【发布时间】:2016-02-20 21:06:28
【问题描述】:
Setting up nginx-full (1.6.2-5+deb8u1) ...
Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.
invoke-rc.d: initscript nginx, action "start" failed.
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.6.2-5+deb8u1) | nginx-light (>= 1.6.2-5+deb8u1) | nginx-extras (>= 1.6.2-5+deb8u1); 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.6.2-5+deb8u1.1~) | nginx-light (<< 1.6.2-5+deb8u1.1~) | nginx-extras (<< 1.6.2-5+deb8u1.1~); 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 libc-bin (2.19-18+deb8u3) ...
Processing triggers for systemd (215-17+deb8u3) ...
Errors were encountered while processing:
 nginx-full
 nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)

上面是运行 sudo apt-get install nginx 时给我的错误。我尝试同时删除 apache 和 nginx 并重新安装,但它给出了相同的错误。

【问题讨论】:

    标签: nginx debian


    【解决方案1】:

    对我的帮助:

    service apache2 stop
    apt-get remove apache2*
    apt-get autoremove
    

    【讨论】:

    • 我只需要运行第一行来解决信息问题
    【解决方案2】:

    我遇到了同样的问题。 我没有 Apache,没有其他东西阻塞了我的 80 端口。 我无法使用

    安装 nginx
    sudo apt-get install nginx
    

    也没有

    sudo apt-get install nginx-common nginx-full
    

    一周后,我偶然发现了这个小博客:https://etc.banana.fish/?p=75

    在这篇博客中,解决方法是:

    1. 安装nginx-common:sudo apt-get install nginx-common
    2. /etc/nginx/sites-enabled/default 中删除 listen [::]:80 default_server;(我是使用 root 用户完成的)
    3. 为了确定,我确实重新启动了我的服务器。
    4. 为了确定两次,我做了sudo apt-get update,然后是sudo apt-get upgrade
    5. 现在我终于打电话给sudo apt-get install nginx-full,它成功了!

    后记,当我输入远程服务器的 IP 时,我可以看到 nginx 的 Titlescreen!

    【讨论】:

    • 非常感谢您的支持。
    【解决方案3】:

    您没有发布 systemctl status nginx.service 的输出,所以这可能不对,但我遇到了这个问题,因为我忘记了旧安装的 nginx。

    所以,我清除了 nginx 并重新安装:

        apt-get purge nginx-full nginx-common
        apt-get install nginx-full
    

    然后我收到另一个错误,得到了详细信息:systemctl status nginx.service

    就我而言

    nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)

    所以我有另一个 Web 服务器在端口 80 上侦听。

    为了解决这个问题,我编辑了默认的 nginx 站点 nano /etc/nginx/sites-available/default 并删除了监听端口 80。

    我只需要 SSL,所以:

        server {
            listen 443 ssl;
            //rest of config....
        }
    

    【讨论】:

      【解决方案4】:

      我在 ubuntu16 Amazon EC2 实例上安装 nginx 时遇到了类似的问题,原因似乎是我在我的安全组设置下摆弄了入站端口 理想情况下,它们应该是: HTTP TCP 80 0.0.0.0/0 和

      HTTP TCP 80 ::/0

      由于某种原因,我错误地删除了其中一个,当我修复所有内容都已排序时,它出现了

      【讨论】:

      • 我设法通过遵循与您类似的 ElectRocnic 的答案来解决问题。感谢您的支持:)
      猜你喜欢
      • 2016-02-29
      • 2016-06-07
      • 2018-11-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多