In Apache Web Server, is there a way to set user and group differently between virtual hosts? I want to run PHP script with the owner's permission (in mod_php).
Use one of the following:
These will run PHP as the user you specify in your VirtualHosts configuration.
Chances are your linux distro will already have these available in a repository somewhere.
You can use apache2-mpm-itk which allows to customize Apache user and group used for each virtual host.
apt-get install apache2-mpm-itk
See Create and set up an Apache virtual host for more details.