apt升级后Apache2没有启动

时间:2017-02-05 16:16:02

标签: apache2

我在Rapsberry Pi上更新了Apache2(使用:apt install apache2 --only-upgrade),现在它没有启动:

root@pi:/etc/apache2 # service apache2 start
Job for apache2.service failed. See 'systemctl status apache2.service' and 'journalctl -xn' for details.
root@pi:/etc/apache2 # systemctl status apache2.service
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled)
   Active: failed (Result: resources) since Sun 2017-02-05 16:19:48 CET; 28min ago

Feb 05 16:47:44 pi systemd[1]: Starting The Apache HTTP Server...
Feb 05 16:47:44 pi systemd[1]: apache2.service failed to run 'start' task: No such file or directory
Feb 05 16:47:44 pi systemd[1]: Failed to start The Apache HTTP Server.

apache2的版本:

Server version: Apache/2.4.25 (Raspbian)
Server built:   2017-01-25T22:59:26

apache2ctl -t显示:

Syntax OK

我尝试禁用所有虚拟主机(仅默认为左侧),但它没有改变任何内容。

apache2的输出:

[Mon Feb 06 01:25:09.079790 2017] [core:warn] [pid 2954] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot

1 个答案:

答案 0 :(得分:0)

Dockerfile从14.04升级到17.04后,我遇到了同样的问题。 我的解决方案是在/var/run中手动添加apache目录 所以修复是:

mkdir /var/run/apache2

DefaultRuntimeDir设置为/var/run/apache2,但文件夹丢失了。