Where I can get information about what kind of MPM Apache is using in my Linux system?
5 Answers
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"
-
Similarly to what was mentioned in the comments beneath the currently accepted answer, on some systems (such as Ubuntu) you should use
apache2 -V
. Nov 3, 2014 at 17:28 -
12
apache2 -V
does not look anything like the output above (for me), howeverapachectl -V
do.– ZitraxApr 28, 2015 at 14:57
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
-
Another 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.– sactiwJul 28, 2014 at 12:29 -
@okwap as from @JorgeeFG answer this
a2query -M
works on Ubuntu Mar 23, 2016 at 18:39 -
1For 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. May 7, 2020 at 10:28
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.
-
1Exactly what I needed! Thanks!– user405398Mar 23, 2016 at 9:02
-
For 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.– msanfordAug 15, 2016 at 21:54
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
.
-
I like @user131003's answer because it tells you in plain english: "Server MPM: Prefork threaded: no" Jan 23, 2014 at 7:14
If it is linux,it should be prefork by default. Read here for more information about apache mpm.