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.

Share:
55,830

Related videos on Youtube

zim32
Author by

zim32

Updated on July 09, 2022

Comments

  • zim32
    zim32 almost 2 years

    Where I can get information about what kind of MPM Apache is using in my Linux system?

  • Tyler Collier
    Tyler Collier over 10 years
    I like @user131003's answer because it tells you in plain english: "Server MPM: Prefork threaded: no"
  • sactiw
    sactiw almost 10 years
    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.
  • Tom Fenech
    Tom Fenech over 9 years
    Similarly to what was mentioned in the comments beneath the currently accepted answer, on some systems (such as Ubuntu) you should use apache2 -V.
  • Zitrax
    Zitrax about 9 years
    apache2 -V does not look anything like the output above (for me), however apachectl -V do.
  • Admin
    Admin over 8 years
    Exactly what I needed! Thanks!
  • NineCattoRules
    NineCattoRules over 8 years
    @okwap as from @JorgeeFG answer this a2query -M works on Ubuntu
  • msanford
    msanford almost 8 years
    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.
  • randomcontrol
    randomcontrol about 4 years
    For 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.