apache2-mpm-itk is an MPM module for the apache web server which allows you to run each of your virtual host under a separate uid and gid
Installation
sudo apt-get install apache2-mpm-itk
sudo apt-get install libapache2-mpm-itk
If you face any issue while enabling the module, you are recommended to first disable mpm_prefork and then try to enable mpm_itk.
Now, we have to add few lines to our virtual host configuration file :
<IfModule mpm_itk_module>
AssignUserId username groupname
</IfModule>
[...]