Apache enable worker mpm
After some time of working i did it myself. You can find the steps below.
Check which MPM apache is currently running:
apachectl -V | grep -i mpm
Result:
Server MPM: prefork
List Available MPM Modules (Make sure mpm_worker is listed)
ls /etc/apache2/mods-available/mpm*
Result:
/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
List Enabled MPM Modules (If mpm_worker is not enabled we should enable it and disable the mpm_prefork module)
ls -l /etc/apache2/mods-enabled/mpm*
Result:
/etc/apache2/mods-enabled/mpm_prefork.conf -> ../mods-available/mpm_prefork.conf
/etc/apache2/mods-enabled/mpm_prefork.load -> ../mods-available/mpm_prefork.load
Disable MPM_PREFORK module
a2dismod mpm_prefork
Enable MPM_WORKER module
a2enmod mpm_worker
To check if Apache is running on MPM WORKER
apachectl -V | grep -i mpm
Result:
Server MPM: worker
If you get this error after executing these commands:
Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP
Try to remove libapache2 package:
apt-get remove libapache2-mod-php5
Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.