如何找到Apache在Linux中使用的MPM模型(worker,prefork或event)

zim*_*m32 38 apache apache2

在哪里可以获得有关Apache Linux系统中使用何种MPM的信息?

小智 62

httpd -V
Run Code Online (Sandbox Code Playgroud)

然后找Server MPM行.

例:

# httpd -V
Server version: Apache/2.2.15 (Unix)
Server built:   Aug  2 2013 08:02:15
Server's Module Magic Number: 20051115:25
Server loaded:  APR 1.3.9, APR-Util 1.3.9
Compiled using: APR 1.3.9, APR-Util 1.3.9
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
Run Code Online (Sandbox Code Playgroud)

  • `apache2 -V`看起来不像上面的输出(对我来说),但是`apachectl -V`做. (9认同)

Dav*_*Lam 40

注意到以前的答案没提 apachectl !

[dlam @ some-ubuntu-box~] $ apachectl -V | grep -i mpm

服务器MPM:事件

-

[dlam @ some-fedora-box:〜] $ httpd -V | grep -i mpm

Server MPM:Prefork


Jor*_*eFG 31

在Ubuntu 14.04中

a2query -M
Run Code Online (Sandbox Code Playgroud)

告诉event,prefork,worker

您可以通过添加mpm_<chosen>from mods-availablemods-enabledin的符号链接来更改它/etc/apache2.

一次只允许一个.


小智 12

您可以通过检查使用Apache编译的模块来查看.

请参阅以下命令的输出:

# httpd -l
Run Code Online (Sandbox Code Playgroud)

从那里寻求prefork.c.