httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Christophe Montigny <...@assoces.com>
Subject Re: [users@httpd] Vhost and Multiple Users
Date Fri, 31 Dec 2004 13:18:00 GMT
Hello,

Davy Durham wrote:

> It would just be fantastic if the real mod_php could fork and change 
> user/group ID before doing it's thing.. this would obviously only work 
> when apache was running as root.  Is that a definate no-no, never to 
> do?  I wonder if that'd be a significantly difficult hack of the mod_php 
> code--or is it as simple as putting a if(fork()==0) { 
> setuid();setguid(); ... }  around a certain section of code?
That'd mean that apache would need to be ran as root . . . even though 
the first apache process is owned by root, the processes that actually 
serve the pages are owned by www-data, so it can't fork. So it needs to 
either use the suphp method or else, use something like apache2's 
perchild mpm, that actually creates apache processes ran as different 
UID/GIDs.

Problem : it is under heavy development, and it requires a threadsafe 
PHP version. In debian for instance, the PHP package is NOT threadsafe, 
so you can't use apache2 + perchild + php with debian packages.
Else I tried to compile PHP and it worked fine with the perchild mpm... 
Gone, your problems of unix rights, and I found that fantastic, too bad 
the perchild mpm development is stalled according to apache2's 
documentation. But I think it creates at least one process for each 
vhost... I am not sure, because I only did a test with 2 vhosts. If 
somebody from the apache development team could confirm...
Of course, it's unacceptable to have 1 process per vhost. Imagine when 
you have 200 vhosts, like me...

> 
> -- Davy
> 
> Ivan Barrera A. wrote:
> 
>> there is a mod, called phpexec (or phpsuexec) that does that.
>> If i find the page, ill post it.
>>
>> Davy Durham wrote:
>>
>>> |*Ok, for a good while now I've been trying to figure this out, but I 
>>> cannot find a way.
>>>
>>> With apache-2.0.48 is there any way possible to have apache (running 
>>> as root I would suppose) to execute a vhost's php scripts (using 
>>> mod_php) as a particular user?  And I have many vhosts configured, I 
>>> would like them all to run as their respective user.
>>>
>>> Thank you VERY much in advance,
>>>   Davy
>>>
>>>
>>> *|
>>>
>>> ---------------------------------------------------------------------
>>> The official User-To-User support forum of the Apache HTTP Server 
>>> Project.
>>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server 
>> Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


-- 
Jean-Christophe Montigny
Responsable serveurs assoces.com
Etudiant à Grenoble Ecole de Management

Mime
View raw message