Mailing List Archive

suexec and mod_perl does not work together???
Hello!


I have troubles with running mod_perl (1.21) apache (1.3.11) server with
suexec capabilities. Does perl scripts served by mod_perl use User and Group
Directive and run under SUEXECed uids?

Mod_perl is enabled only in one virtual_host, and this virtual has distinct
from main server user and groups directives.

Whats strange, without mod_perl scripts runs ok (means with correct uid).

Any ideas?

PLEASE CC answer to my e-mail.

--
radoslaw.stachowiak.................................................[ALTERsc]
Re: suexec and mod_perl does not work together??? [ In reply to ]
Hi there,

On Sat, 19 Feb 2000, Radoslaw Stachowiak wrote:

> The problem is: perl scripts run WITHOUT mod perl, switch UID and
> GID according to User and Group directive (suexec), but WITH
> mod_perl they run as standard server uid (nobody).

Ah, I see! The light is dawning on me, sorry to be so dense.

It does not surprise me that suexec does not behave as you expect
under mod_perl. Without mod_perl, Apache has to load and run the
interpreter for each script invocation. It is the interpreter which
has the notion of a UID and GID, not the script which it is executing,
and it is the interpreter (or its parent) which has to do suexec to
switch IDs. After suexec it is quite possible that an Apache child
might not have permission to read one of your scripts. When Apache
runs with mod_perl, it goes to a lot of truoble to avoid reading
time-consuming configurations and suchlike. It loads one and only one
copy of the interpreter which compiles scripts once and leaves them in
memory. If it were to do suexec AFTER compiling a script, who is to
say that it would even have had permission to read or execute that
script if it had had the new UID when it needed to read it in the
first place?

Maybe I'm missing something here.

Stas, I can find nothing about this in the Guide, any comments? If
this hasn't been discussed on the List before, I guess it will be now.
======================================================================
73,
Ged.