Apache, suexec, and PHP -- A C Wrapper

Prior to moving to the VPS server, there were two instances of Apache running for borthermu.net. One was hosting the 'common' applications, like web-mail, mysqladmin, etc. The other was hosting the user sites (like this one). When moving the things over, I decided it would be nice to try and merge them together, and try to use only the Debian packaged Apache. This was mostly to get the benefit of security updates. In order to do this, I needed to find a way to merge the key feature of the 'hosting' Apache instance into the 'common' instance while maintaining the ability to run user site scripts to run in the same security context as the user. Previously the 'hosting' server was configured without mod_php, and instructed to use cgiexec with a simple shell script wrapper that invoked php as the user. Moving this over to the new server was simple enough. I simply configured the virtual hosting such that it called out to... The script in question was replaced with a some C code that seems to improve performance somewhat (though more can be done obviously). Anyway, here is the source. phpexec.01.tar.gz