Help with Apache 2 MPM prefork + mod_fcgid + suEXEC + PHP 5.5 opcode cache!

pincom_stu

Member
Oct 24, 2013
7
2
51
cPanel Access Level
Website Owner
Hey all,

After several hours of searching/reading and not being able to find a conclusive answer, I decided it would probably be best to ask the experts on this forum. I'll try to make my question brief:

My websites are currently running PHP 5.4 + Apache 2.4 (prefork) + suPHP. Now, I'm about to upgrade everything to PHP 5.5 and I'd like to take advantage of the built-in opcode caching, but still have 100% thread safety (due to some old PHP libraries we use) and also have each PHP process execute as a certain user/group (which I currently use suPHP for, but hoping suEXEC will work just as well). Is this possible to achieve reliably?

I'm pretty sure the configuration that would achieve this is Apache 2 MPM prefork + mod_fcgid + suEXEC, but I'm unsure about some of the "gotchas" and other details of configuring this setup. I know one thing that MUST be done is to make sure PHP does not spawn of child processes...basicall let mod_fcgid handle all the PHP process management.

Will the PHP 5.5 opcode cache work well with mod_fcgid and MPM prefork?

Will this setup allow simultaneously webpage requests to actually process simultaneously and not block if one PHP script takes an extra long time?

Lastly, I assume in each VirtualHost I'll have to change the relevant suPHP config

<IfModule mod_suphp.c>
suPHP_UserGroup user1 group1
</IfModule>

to
SuexecUserGroup user1 group1


Any help answering these questions or elaborating on a setup to achieve the desired results would be GREATLY APPRECIATED. Thank you!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello :)

Have you considered using DSO and Mod_Ruid2 instead of Mod_FCGI? You can find documentation on Mod_Ruid2 at:

Apache Module: Ruid2

Thank you.
 

pincom_stu

Member
Oct 24, 2013
7
2
51
cPanel Access Level
Website Owner
Hello :)

Have you considered using DSO and Mod_Ruid2 instead of Mod_FCGI? You can find documentation on Mod_Ruid2 at:

Apache Module: Ruid2

Thank you.
Thanks for the suggestion on Ruid2, but we'd like to use mod_fcgid if possible. I'm still wondering if the setup posted in my original question will work well.

cPanelMichael, is it possible to move this thread up one level to the "cPanel & WHM Discussions" area since it tends to get a little more activity it seems. I figure maybe someone who knows the answer will see it there...
 

pincom_stu

Member
Oct 24, 2013
7
2
51
cPanel Access Level
Website Owner
Thanks for moving this thread.

I also wanted to add the reason we haven't considered Ruid2 is because we would prefer to run mod_fcgid over mod_php.