3

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.

BrainCore
  • 5,214
  • 4
  • 33
  • 38

3 Answers3

2

Take a look at suEXEC.

innaM
  • 47,505
  • 4
  • 67
  • 87
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."

-http://www.suphp.org/

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:

http://www.howtoforge.com/running-vhosts-under-separate-uids-gids-with-apache2-mpm-itk-on-ubuntu-9.04

I used this on my development machine (Ubuntu), If you're using for production please read this page carefully:

http://mpm-itk.sesse.net/

wesamly
  • 1,484
  • 1
  • 16
  • 23