【问题标题】:Apache2 service won't start in Ubuntu 15.10Apache2 服务不会在 Ubuntu 15.10 中启动
【发布时间】:2016-04-11 14:52:37
【问题描述】:

我已经安装了 apache2,但是当我安装时它不会启动

sudo service apache2 start

它给了我这个问题

Job for apache2.service failed because the control process exited with    error code. See "systemctl status apache2.service" and "journalctl -xe" for details.

所以当我输入这个命令时

 systemctl status apache2.service

它给了我这个消息

● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2)
Active: failed (Result: exit-code) since ن 2016-04-11 15:41:07 WEST; min  43s ago
 Docs: man:systemd-sysv-generator(8)
Process: 19644 ExecStart=/etc/init.d/apache2 start (code=exited, status=2)

11 15:41:07 oussama-UL50VT systemd[1]: Starting LSB: Apache2 web server...
11 15:41:07 oussama-UL50VT apache2[19644]: /etc/init.d/apache2: 64: .: Can't open /etc/apache2/envvars
11 15:41:07 oussama-UL50VT apache2[19644]: /etc/init.d/apache2: 76: .: Can't open /etc/apache2/envvars
11 15:41:07 oussama-UL50VT systemd[1]: apache2.service: Control process exited, code=exited status=2
11 15:41:07 oussama-UL50VT systemd[1]: Failed to start LSB: Apache2 web server.
11 15:41:07 oussama-UL50VT systemd[1]: apache2.service: Unit entered failed state.
11 15:41:07 oussama-UL50VT systemd[1]: apache2.service: Failed with result 'exit-code'.
11 15:41:07 oussama-UL50VT apache2[19644]: ERROR: APACHE_PID_FILE needs to be defined in /etc/apache2/envvars

【问题讨论】:

  • 如果您有相关的日志条目,或有关 Apache 配置的信息,可能有助于我们诊断问题。

标签: ubuntu apache2 ubuntu-15.10


【解决方案1】:

您的 apache 安装似乎已损坏...请尝试通过在终端中运行以下命令来重新安装 apache:

sudo apt-get purge apache2
sudo apt-get install apache2

【讨论】:

    【解决方案2】:

    运行此命令。

    • apachectl 启动

    输出应准确显示 mods 加载文件夹中缺少的内容。 再次安装指示的缺失 mod 运行命令安装缺失的 mod 直到 apache 启动。

    这在 linux mint 18 上对我有用

    【讨论】:

      猜你喜欢
      • 2016-05-15
      • 2016-03-08
      • 2020-09-20
      • 2016-02-29
      • 2016-06-09
      • 2014-08-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多