In his quest for a secure method of server-side security in addition to PHP, Ben Ramsey stumbled across Peruser MPM, an Apache security module, seemingly with PHP in mind. In this latest blog post he details what lead him there.
A while back, when I was doing some research for a talk on server-side security for PHP, I looked into various "secure" methods for setting up a server for multiple users. Despite my search, I couldnâ€™t find a simple and effective solution for managing a server with a large (and untrusted) user base (as is the case with many virtual hosting companies).
Sure, thereâ€™s PHPâ€™s safe_mode, but its "safety" is misleading at best. Thereâ€™s also open_basedir, which helps a little, but itâ€™s not quite enough. For my research, I also looked at and tested mod_security, and the Hardened PHP Projectâ€™s Hardening Patch.
Eventually, through this comment, he found Peruser MPM, a module that runs each Apache process with its own user/group combination. He notes a few issues that it still has (breaking mod_ssl and making Apache less scalable), but overall, it does sound pretty cool...