Unable to use MPM worker/event in Ubuntu 16

I've posted it here: in [https://askubuntu.com/questions/1140169/what-is-the-way-to-enable-mpm-worker-event-in-ubuntu-16](Ask Ubuntu)

Unfortunately I'm not able to do away with preform MPM causing my Linode's Apache to choke up during high burst of requests at 12pm.

Any Linode image where the MPM by default will be worker?

1 Reply

For Apache2, mpm_event, mpm_prefork and mpm_worker are all included (but not enabled) by default, unless you've removed them:

Modules your Apache has loaded at runtime:
$ apache2ctl -M

You can convert apache to event or worker using a2enmod:

Lists modules
$ ls -la /etc/apache2/mods-available

Shows the current MPM:
$ apachectl -V | grep -i mpm

Disables prefork and enables event
$ a2dismod mpm_prefork && a2enmod mpm_event
$ sudo service apache2 restart

Disables prefork and enables worker
$ a2dismod mpm_prefork && a2enmod mpm_worker
$ sudo service apache2 restart

Disables event and enables worker
$ a2dismod mpm_event && a2enmod mpm_worker
$ sudo service apache2 restart

We reviewed the links that you provided. We can see that you've completed the steps in this post here and experienced the following outcome when you attempt to restart:

May 3 13:53:57 host apache2[15732]: [Fri May 03 13:53:57.270545 2019] [:crit] [pid 15741:tid 139828766218112] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.

I recommend reviewing your apache 2 configuration to understand your current state better:
$ apache2ctl configtest

It is generally not recommended to run threaded MPM in production with Apache2. You are able to resolve this error by using php7.0-fpm if you still want to run threaded mpm with the worker or event module:

$ sudo apt-get install php7.0
$ sudo apt-get install php7.0-fpm
$ sudo a2enmod php7.0

You can then confirm that mpm_prefork is disabled and your preferred module enabled and then attempt restarting again.
Collapse −


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct