Re: SETUID Apache
| From: | Kristian Köhntopp | Date: | Wed, 05 Jul 2000 15:14:49 +0000 |
| Subject: | Re: SETUID Apache | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-23597@lists.php.net to get a copy of this message | ||
Andre Labonte wrote:
> I am running PHP on Apache. Apache is running as DAEMON user. I dont
> want all commands executed on the system to be executed as DAEMON. I am
> trying to use POSIX_SETUID to actually downgrade the user to his limited
> privileges.
This is not an Apache support list. Please choose an appropriate list
for your question.
> I get this error.
>
> << Warning: posix_setuid(#UID) failed with 'Not owner'. Must be root in
> /dir/file.php3 on line # >>
The setuid() system call is restricted to the superuser. You
cannot call it as daemon.
Apache is running as the User and Group named by the directives
of the same name at configuration file level. If you do not
want to run Apache as daemon, change these directives in your
httpd.conf.
Apache is running CGI programs as the User and Group named by
the directives of the same name at virtual host level, if the
suexec extension is installed. If you want to run CGI programs
as a different user than Apache, change these directives in
the VirtualHost blocks in your httpd.conf.
If you are using mod_php, PHP will run as part of the Apache
process, and will run as daemon. There is no way to change that.
If you are using CGI PHP, PHP will run as a CGI program, and
with the UID set for that VirtualHost.
Kristian
--
Kristian Köhntopp, NetUSE AG Siemenswall, D-24107 Kiel
Tel: +49 431 386 436 00, Fax: +49 431 386 435 99
Using PHP3? See our web development library at http://phplib.netuse.de/