在Vagrant的Ubuntu Precise64上运行Apache2。 当我尝试启动它时,它说:
vagrant@precise64:/etc/apache2$ /etc/init.d/apache2 start * Starting web server apache2 * * The apache2 configtest failed. Output of config test was: AH00534: apache2: Configuration error: No MPM loaded. Action 'configtest' failed. The Apache error log may have more information.
但事情是,我的/etc/apache2/apache2.conf文件不要求MPM在任何地方! 我会粘贴在这里,但它会使一个巨大的职位…
我试图查找错误日志,但我无法find任何地方,无论是。 帮帮我?
编辑: apache2 -l给出了这个:
vagrant@precise64:/$ apache2 -l Compiled in modules: core.c mod_so.c mod_watchdog.c http_core.c mod_log_config.c mod_logio.c mod_version.c mod_unixd.c mod_unixd.c
所以看起来没有安装mpm,对吧? 如果没有安装MPM,也没有在我的configuration文件中提到的MPM,为什么我仍然看到这个错误?
apache2 -t -D DUMP_MODULES(或-M)应该给你一个模块列表。 您应该看到worker.c或prefork.c或event.c。 用这个来确定你正在使用哪个MPM。
看看你的configuration文件,如果有类似的(如果你使用prefork MPM)。
这是一个例子:
<IfModule mpm_prefork_module> StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 150 MaxRequestsPerChild 0 </IfModule>
像这样的块添加到你的configuration文件,它应该工作。 validationapache2-mpm-prefork(或worker,或事件)是否已正确安装。
阅读本文档以帮助您select(这是强制性的)适合您的使用的MPM: http : //httpd.apache.org/docs/2.2/mpm.html
我遇到过同样的问题。 我不小心覆盖了/etc/apache2/apache2.conf 。 为了纠正,我不得不运行sudo apt-get purge apache2来彻底删除apache,然后运行sudo apt-get install apache2来获取原始的apache2.conf文件。
注 :在清除之前备份/etc/apache2/sites-available下的所有自定义文件。