Re: Unix-Apache: running apache as different user
| From: | Martin Luethi | Date: | Wed, 28 Jan 2004 15:43:32 +0000 |
| Subject: | Re: Unix-Apache: running apache as different user | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-176062@lists.php.net to get a copy of this message | ||
Wed, 28 Jan 2004 16:11:59 +0200 Lorderon <ighen@netvision.net.il>:
> "Mike Migurski" <mike@saturn5.com> wrote in message
> news:Pine.GSO.4.52.0401271049180.28783@atari...
>> >I have PHP installed on Apache and Unix with several vhosts so each vhost
>> >has its own user account on Unix. Now when accessing a webpage, Apache
>> >runs with user httpd.. but I want it to run as the user of the vhost
>> >account.. How can I do that?
>>
>> http://httpd.apache.org/docs/suexec.html
>>
>
> The SuEXEC is not good for my purpose, since I want to run PHP as Apache
> Module (and not CGI).
> I'm using Apache 1.3... does the User / Group directives change the
> user/group in case I use Apache Module for PHP?
yes
> Also, I read about the AssignUserID directive, but couldn't figure out if it
> affects Apache Module or only CGI module for PHP?
AssignUserID is for apache2
apache2 has a MPM called perchild. with this MPM you can assign a user/group to
each vhost (but there is still work in progress...)
-> http://httpd.apache.org/docs-2.0/en/mod/perchild.html
with apache1.3 and php as apache-module all vhosts have the same user/group
what you can do:
add the apache-user to each vhost-group and work with open_basedir:
<VirtualHost *:80>
...skip...
<Directory "/somedir">
...skip...
php_admin_value open_basedir "/somedir:/tmp"
</Directory>
</VirtualHost>
because some functions ignore open_basedir I also modified disable_functions in
php.ini:
disable_functions = "exec, passthru, shell_exec, system, proc_open, popen"
a more complicated way would be:
- create virtual-interfaces in linux
- run apache on each interface with different user/group
g. tinu