How to find what MPM model Apache is using in Linux (worker, prefork or event)
55,830
Solution 1
You can see this by checking which modules are compiled with Apache.
See output of the following command:
# httpd -l
From there, seek for prefork.c
.
Solution 2
httpd -V
then look for the Server MPM
line.
Example:
# 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"
Solution 3
noticed the previous answers don't mention apachectl
!
[dlam@some-ubuntu-box~] $ apachectl -V | grep -i mpm
Server MPM: event
--
[dlam@some-fedora-box:~] $ httpd -V | grep -i mpm
Server MPM: Prefork
Solution 4
In Ubuntu 14.04
a2query -M
Tells event
, prefork
, worker
You can change it by adding symbolic links for mpm_<chosen>
from mods-available
to mods-enabled
in /etc/apache2
.
Only one is allowed in a time.
Solution 5
If it is linux,it should be prefork by default. Read here for more information about apache mpm.
Related videos on Youtube
Author by
zim32
Updated on July 09, 2022Comments
-
zim32 almost 2 years
Where I can get information about what kind of MPM Apache is using in my Linux system?
-
Tyler Collier over 10 yearsI like @user131003's answer because it tells you in plain english: "Server MPM: Prefork threaded: no"
-
sactiw almost 10 yearsAnother option is to list Compiled in modules using following command:
/usr/sbin/apache2 -l
And in the output look for worker.c, prefork.c or event.c as one only of them will be present indicating the respective MPM module your apache2 is using. -
Tom Fenech over 9 yearsSimilarly to what was mentioned in the comments beneath the currently accepted answer, on some systems (such as Ubuntu) you should use
apache2 -V
. -
Zitrax about 9 years
apache2 -V
does not look anything like the output above (for me), howeverapachectl -V
do. -
Admin over 8 yearsExactly what I needed! Thanks!
-
NineCattoRules over 8 years@okwap as from @JorgeeFG answer this
a2query -M
works on Ubuntu -
msanford almost 8 yearsFor some reason on my (AWS) Ubuntu 14.04, none of the required environment variables are defined, so none of the other solutions work. This one did.
-
randomcontrol about 4 yearsFor me that was the only working method, because all others did not show any MPM. apach2 -V showed "Server MPM:" and nothing more. In my case "event" was enabled.