无法启动Apache,configurationtesting失败:“env:apache2ctl:没有这样的文件或目录”

$ apache2 -v Server version: Apache/2.4.7 (Ubuntu) Server built: Jan 14 2016 17:45:23 

我的Ubuntu版本是14.04。

我正在修复/etc/apache2/sites-available/000-default.conf上的一些东西,然后下一次我重新启动Apache,我不断得到这个奇怪的错误:

 $ sudo service apache2 reload * Reloading web server apache2 [fail] * * The apache2 configtest failed. Not doing anything. Output of config test was: env: apache2ctl: No such file or directory 

我还恢复了000-default.conf所有更改,但问题没有得到解决。

我不明白我是如何造成这个问题,也不知道如何解决这个问题。

帮助将不胜感激。


最新的Apache错误日志:

 [Sun Jun 05 11:50:26.341221 2016] [mpm_worker:notice] [pid 6035:tid 118764177487744] AH00292: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations [Sun Jun 05 11:50:26.341266 2016] [core:notice] [pid 6035:tid 118764177487744] AH00094: Command line: '/usr/sbin/apache2' [Sun Jun 05 12:15:51.071093 2016] [mpm_worker:notice] [pid 6035:tid 118764177487744] AH00295: caught SIGTERM, shutting down 

您缺lessapache2ctl脚本和apachectl的符号链接。 对于Ubuntu 14.04,两者都应该位于/usr/sbin/目录下,具有以下date(正常安装,升级)和权限:

 -rwxr-xr-x 1 root root 6402 Jan 3 2014 /usr/sbin/apache2ctl lrwxrwxrwx 1 root root 10 Jan 14 17:46 /usr/sbin/apachectl -> apache2ctl 

如果您有系统的备份,则应该恢复。 如果没有,您将需要修复Apache2安装。

还要注意/usr/sbin/目录是一个共享目录,其中包含通常以root权限访问的所有脚本。 考虑到你不知道apache2文件如何丢失,你可能会遇到这个问题,甚至超出apache2

env:apache2ctl:没有这样的文件或目录

我没有一个Ubuntu系统,但它看起来像PATH可能是畸形的, env无法findapache2ctl