How to change MPM in ubuntu

Run the following command to know the current MPM apache using.

root@ip-172-31-93-7:/home/ubuntu# apachectl -V | grep -i mpm
Server MPM: event

The current MPM is apache using is an event module. Available MPM are listed over here.

ls /etc/apache2/mods-available/mpm*
/etc/apache2/mods-available/mpm_event.conf /etc/apache2/mods-available/mpm_prefork.conf /etc/apache2/mods-available/mpm_worker.conf
/etc/apache2/mods-available/mpm_event.load /etc/apache2/mods-available/mpm_prefork.load /etc/apache2/mods-available/mpm_worker.load

If you wish to change the MPM module from event to worker please follow the below steps.

root@ip-172-31-93-7:/home/ubuntu# a2dismod mpm_event
Module mpm_event disabled.

root@ip-172-31-93-7:/home/ubuntu# a2enmod mpm_worker
Considering conflict mpm_event for mpm_worker:
Considering conflict mpm_prefork for mpm_worker:
Enabling module mpm_worker.

To activate the new configuration, you need to run:
systemctl restart apache2

root@ip-172-31-93-7:/home/ubuntu# apachectl -V | grep -i mpm
Server MPM: worker

Post navigation

Leave a Reply