An Apache 2.x Webserver with default configurations from the ubuntu/debian repositories will use the www-data unix account for apache2 processes handling web requests. Assuming that apache is serving two different sites (domain1.com and domain2.com), is it possible for apache to use unix user www-data1 when handling requests to domain1.com, and use unix user www-data2 when handling requests to domain2.com? The motivation is to isolate the code for each domain name from one another.
Asked
Active
Viewed 4,339 times
3 Answers
1
suPHP is also a nice thing to look into:
"suPHP is a tool for executing PHP scripts with the permissions of their owners. It consists of an Apache module (mod_suphp) and a setuid root binary (suphp) that is called by the Apache module to change the uid of the process executing the PHP interpreter."

Dennis
- 394
- 1
- 6
0
You can use apache2-mpm-itk to achieve this.
You will be able to run each vhost using group and user of your choice.
Check this article for details:
I used this on my development machine (Ubuntu), If you're using for production please read this page carefully:

wesamly
- 1,484
- 1
- 16
- 23