Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Feb 2003 11:16:09 -0600
From:      Kirk Strauser <kirk@strauser.com>
To:        freebsd-questions@freebsd.org
Subject:   Is Apache+Perl behaving correctly?  Am I insane?
Message-ID:  <871y1wjn6u.fsf@strauser.com>

index | next in thread | raw e-mail

[-- Attachment #1 --]
I'm trying to enable mod_perl support for my TWiki-based website
(http://subwiki.honeypot.net/).  I'm seeing some really strange behaviour,
though, and I don't know which of mod_perl or I are going insane.

In my httpd.conf, I have:

    User www
    Group www

and it behaves in the expected way.  TWiki ships with a script called
`testenv' that shows some information about the current Apache environment,
and it calls some very simple code to determine the user its running as:

    my $usr = lc( getlogin || getpwuid($<) );
    print "<tr><th align=\"right\">User:</th><td>$usr</td></tr>\n";

When I execute that script from a browser, I see "User: root", and I'm not
sure where that's coming from.  Right now, the following httpd processes are
running on the server:

    # ps auxwww | grep -- -DSSL
    root   34839  0.0  0.9 14092 7032  ??  Ss   10:55AM   0:00.95 /usr/local/sbin/httpd -DSSL
    www    35394  0.0  0.9 14100 7068  ??  I    11:11AM   0:00.01 /usr/local/sbin/httpd -DSSL
    www    35395  0.0  0.9 14100 7064  ??  I    11:11AM   0:00.01 /usr/local/sbin/httpd -DSSL
    www    35396  0.0  0.9 14160 7112  ??  I    11:11AM   0:00.02 /usr/local/sbin/httpd -DSSL
    www    35397  0.0  0.9 14160 7120  ??  I    11:11AM   0:00.02 /usr/local/sbin/httpd -DSSL
    www    35398  0.0  0.9 14160 7120  ??  I    11:11AM   0:00.02 /usr/local/sbin/httpd -DSSL
    www    35403  0.0  0.9 14092 7040  ??  I    11:12AM   0:00.01 /usr/local/sbin/httpd -DSSL

Doesn't the process running as root exist solely to spawn other children?
If so, why does Perl (both with and without mod_perl enabled) think that
it's running as root instead of www?
-- 
Kirk Strauser
In Googlis non est, ergo non est.

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQA+W6Tc5sRg+Y0CpvERApfJAJ0TDbnjlUwNoG5Q3mGqD4iU1vmFOgCdFJSU
/KvBlKx0c/L66hyOstLqljc=
=5Q7G
-----END PGP SIGNATURE-----
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?871y1wjn6u.fsf>