Staff Member

PHP handler options such as suPHP or FCGI only show processes running as the user for PHP processes, while other Apache processes such as HTML pages or download links will run as the user nobody. To overcome this issue, MPM ITK is an MPM for Apache that runs user processes as the user and group set in "AssignUserID" field set in the VirtualHost directive, forcing all user requests to run as that user and group. This MPM also allows setting "MaxClientsVHost" within each VirtualHost to restrict a user's processes at the Apache level.

In order to use MPM ITK until it is in EasyApache itself, there is currently the option to download it from the cPanel documentation site and install it as a Custom Opt Module. Unfortunately, due to the fact that ZTS support is set to on for MPMs other than Prefork, this means that DSO will be disabled during the compile of MPM ITK. Since MPM ITK will only work properly when using mod_php (DSO), this guide will enable using this MPM until it goes into EasyApache.

Please note that MPM ITK and recompiling PHP are both experimental customizations, which are not supported by cPanel itself. This guide would be used at your own risk. If you run into any issues, simply remove the customizations and revert to your prior EasyApache settings.

The above code copies libphp5.so back into /usr/local/apache/modules folder at the end of the build, restarts Apache, and re-enables dso for the PHP handler as it will switch to suPHP during the EasyApache build but dso will become available again after the libphp5.so is copied back to /usr/local/apache/modules folder. If you use PHP 4 as well, you may need to revise the last line to put something other than none for the PHP 4 handler.

After saving the file, ensure it can execute:

Code:

chmod +x /scripts/posteasyapache

Of note, I previously was adding the LoadModule to /usr/local/apache/conf/includes/pre_main_global.conf file, but this isn't necessary due to the fact that it will be added to /usr/local/apache/conf/php.conf file once libphp5.so is moved back to /usr/local/apache/modules folder.

Adding MPM ITK VirtualHost Directives

Finally, to enable individual VirtualHost directives for MPM ITK, use the following steps:

I would strongly advise against using MPM ITK at this point for any reason.

Why? Our developers reviewed and considered both MPM ITK and mod_ruid2 for inclusion to the cPanel product a few months back. Both provide similar behavior/changes to Apache.

Our developers sided with mod_ruid2 and it is now included and available via the latest EasyApache (as of v3.8.2). Although, note that you must be running cPanel 11.31.3.* or higher (Currently in EDGE only as of this posting) for mod_ruid2 to be available in EasyApache as a selection. This is due to product changes that were required to support mod_ruid2.

Essentially, wait for 11.31.3.* or higher to hit your chosen cPanel tier and then utilize mod_ruid2 if you're looking for MPM ITK type behaviors. In this fashion, you will be using a cPanel sanctioned module vs. a custom opt mod that requires a decent amount of manual work arounds to even get working.