“未加载MPM”,但我什至不使用MPM


10

在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!我将其粘贴在此处,但会产生大量帖子...

我尝试查找错误日志,但在任何地方都找不到。救命?

编辑: 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且未提及MPM,为什么仍会看到此错误?


1
dpkg -l'apache2-mpm *'的输出是什么
sciurus

对我来说,清除,重新安装和复制旧的配置文件就足够了,无论罪魁祸首是什么;)
Melissa Loos

Answers:


10

apache2 -t -D DUMP_MODULES(或-M)应为您提供模块列表。您应该看到worker.c或prefork.c或event.c。使用它来确定您正在使用的MPM。

在配置文件中查找是否有类似内容(如果使用prefork MPM)。

这是一个例子:

<IfModule mpm_prefork_module>
StartServers          5
MinSpareServers       5
MaxSpareServers      10
MaxClients          150
MaxRequestsPerChild   0
</IfModule>

将这样的块添加到您的配置文件中,它应该可以工作。验证是否正确安装了apache2-mpm-prefork(或worker,或event)。

阅读此文档可帮助您选择(强制性的)适合您使用的MPM:http : //httpd.apache.org/docs/2.2/mpm.html


使用命令输出更新了原始问题...看起来根本没有MPM模型,因此我不明白为什么看到错误。任何的想法?
ezuk

1
您必须选择一个MPM模块,这是强制性的。
Vinz

嗨@Vinz。我实际上遇到了相同的问题(Ubuntu 13.10,Apache 2.4.6)并尝试了解决方案。我在配置文件中缺少该块,但是添加它并不能解决问题。还有其他想法吗?我有点在这里迷路了。
Itai Bar-Haim 2013年

@ ItaiBar-Haim:添加此块后的错误消息是什么?
Vinz 2013年

@Vinz是同样的错误。但是我发现,当我使用默认的Apache配置并且不尝试以任何方式覆盖它时,似乎一切正常。
Itai Bar-Haim

10

我遇到过同样的问题。我不小心改写了/etc/apache2/apache2.conf。要进行纠正,我必须先运行sudo apt-get purge apache2以完全删除apache,然后再运行sudo apt-get install apache2apache2.conf恢复原始文件。

注意/etc/apache2/sites-available清除之前,请备份所有自定义文件。


我在运行Vagrant时遇到了类似的问题,结果我不小心删除了apache2.conf中的所有内容。不过,还原起来要容易一些vagrant destroy && vagrant up
forsvunnet
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.