A question for a guru

Hello there dear webmasters,
I hope this is the right place to post my question.

I have a question regarding mod_php and virtual hosts.

There is a security problem when you run mod_php on a machine where you have few virtual hosts.
Because of the fact that apache will execute all php commands as the user who runs the apache all created or generated files will be accessible by all other users on the machine. You won't be able to distinguish who runs what.
The very simple example is:
Client of mine running a php script which send emails through sendmail. Because I have mod_php installed all mail being delivered as from apache (this is the user who runs the apache and the php block of course). Now if the mail returns it wont return to the user but to the postmaster.
If I had suexec running on that this mail would have been delivered as the user running the script and all mail problems would have returned to him.


I know that I can switch to cgi-php and to force suexec on all scripts, but this will slow down the performance of the server and probably damage the comfortability of having mod_php (users will have to write php scripts without the ability to embed php into html).
After all mod_php is a very powerful add to the server. In today world where 80% of all websites requires mod_php, removing mod_php is not a good idea.

This question also affects mod_perl.

How do you overcome this problem ?
Is there a way to force mod_php to execute as user defined in virtual host configuration ?

Do you compile mod_php into apache at all ?

I would be more than interested to hear your opinion.

Thanks in advance
trusty
coming soon!!!

 

 

 

 

Top