In apache 2.4, multiple MPMs are supported when compiled as shared modules. The choice of MPM is then made at runtime using LoadModule (see URL).
This doesn't work in Gentoo:
$ APACHE2_MPMS="worker prefork" emerge -1 apache
* You have selected more then one mpm USE-flag.
* Only one MPM is supported.
* ERROR: www-servers/apache-2.4.9-r3::gentoo failed (setup phase):
* more then one mpm was specified
There's a restriction in the eclass, but to support more than one, the --enable-shared-mpms configure option will need to be used.
Note: at the moment, this gives us a correspondence between USE=threads and APACHE2_MPMS; i.e. I can tell if the user has a threaded MPM selected by the presence of USE=threads, since he can have only one MPM selected. I'm going to abuse that fact in the mpm_itk ebuild, so if we ever allow multiple MPMs, please ping me to update the USE depencency.
Woah... this will require quite some changes in apache-2.eclass. I cannot promise a quick fix.
No problem, I'm not asking for one. Nobody else missed it, and it can't affect upgraders.
I opened this mostly so I wouldn't feel guilty depending on apache[-threads] in mpm_itk.
Created attachment 449894 [details, diff]
Here are small changes to apache-2.eclass to support multiple MPMs by a variable in the ebuild