首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >nginx故障诊断Ubuntu 16.04 (依赖问题)

nginx故障诊断Ubuntu 16.04 (依赖问题)
EN

Ask Ubuntu用户
提问于 2017-01-09 22:42:21
回答 1查看 725关注 0票数 1

第一次尝试安装LEMP,而之前没有使用本教程的经验:如何在Ubuntu 16.04上安装Nginx

在新实例上运行Ubuntu16.04.1 LTS (scaleway VPS)

由于我有错误,所以我尝试删除和重新安装nginx。

代码语言:javascript
复制
apt purge nginx
apt autoremove
apt install nginx

但我还是有问题

代码语言:javascript
复制
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.
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-core (>= 1.10.0-0ubuntu0.16.04.4) | nginx-full (>= 1.10.0-0ubuntu0.16.04.4) | nginx-light (>= 1.10.0-0ubuntu0.16.04.4) | nginx-extras (>= 1.10.0-0ubuntu0.16.04.4); however:
  Package nginx-core is not installed.
  Package nginx-full is not configured yet.
  Package nginx-light is not installed.
  Package nginx-extras is not installed.
 nginx depends on nginx-core (<< 1.10.0-0ubuntu0.16.04.4.1~) | nginx-full (<< 1.10.0-0ubuntu0.16.04.4.1~) | nginx-light (<< 1.10.0-0ubuntu0.16.04.4.1~) | nginx-extras (<< 1.10.0-0ubuntu0.16.04.4.1~); however:
  Package nginx-core is not installed.
  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
Errors were encountered while processing:
 nginx-full
 nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)

运行systemctl状态nginx.service:

代码语言:javascript
复制
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2017-01-09 22:20:18 UTC; 5min ago
  Process: 15561 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

我还尝试过sudo apt install nginx-full,它有以下输出:

代码语言:javascript
复制
dpkg: error processing package nginx (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 nginx-full
 nginx
EN

回答 1

Ask Ubuntu用户

发布于 2017-02-04 13:12:32

检查/var/log/nginx/error.log,那里可能有一些线索。我有这样的经历:

2017/02/04 14:55:09 埃默格 25011#25011: mkdir() "/var/cache/nginx/microcache“失败(2:没有此类文件或目录)

因此,我手动创建了/var/cache/nginx子目录,并重新运行了安装,它成功了。

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/870004

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档