3

具有来自 ubuntu/debian 存储库的默认配置的 Apache 2.x Web 服务器将使用 www-data unix 帐户来处理 Web 请求的 apache2 进程。假设 apache 服务于两个不同的站点(domain1.com 和 domain2.com),apache 是否可以在处理对 domain1.com 的请求时使用 unix 用户 www-data1,在处理对 domain2 的请求时使用 unix 用户 www-data2 .com?其动机是将每个域名的代码相互隔离。

4

3 回答 3

2

看看suEXEC

于 2009-08-16T10:25:19.257 回答
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/

于 2010-06-17T22:50:48.587 回答
0

您可以使用 apache2-mpm-itk 来实现这一点。

您将能够使用您选择的组和用户运行每个虚拟主机。

查看这篇文章了解详情:

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

我在我的开发机器(Ubuntu)上使用了它,如果您用于生产,请仔细阅读此页面:

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

于 2014-05-07T12:53:41.170 回答