Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Dec 2004 12:23:46 +0000 (GMT)
From:      Jan Grant <Jan.Grant@bristol.ac.uk>
To:        csnyder <chsnyder@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Is my Apache server running as the root user or not?
Message-ID:  <Pine.GSO.4.61.0412041219490.27997@mail.ilrt.bris.ac.uk>
In-Reply-To: <b76252690412040351228c4b8@mail.gmail.com>
References:  <1164.213.112.198.152.1102141467.squirrel@mail.hackunite.net>  <20041204094749.GA268@cowbert.net> <b76252690412040351228c4b8@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 4 Dec 2004, csnyder wrote:

> On Sat, 4 Dec 2004 04:47:49 -0500, Peter C. Lai <sirmoo@cowbert.net> wrote:
> > This isn't on-topic for the list, but I'll answer it anyway. The Apache
> > parent runs as root so that it can attach to port 80. 
> > [...]
> > 
> > On Sat, Dec 04, 2004 at 07:24:27AM +0100, Jesper Wallin wrote:
> > > [...]
> > > If I got a lot of users connecting to my server on port 80, will
> > > thier requests ever be answered by the root fork or the www:www forks?
> > >[...]
> 
> If this is really a nagging question, enable the mod_status in
> httpd.conf, then watch http://yourserver/server-status while you pound
> the server with apache/bin/ab -- you'll see exactly which PIDs are
> answering queries.

There's a description of what you're seeing here:
	http://httpd.apache.org/docs-2.0/mod/prefork.html
which, although it's apache 2 documentation, also describes the apache 
1.3 preforking behaviour.

The root process creates sockets and log files, then forks child worker 
processes which retain the open file handles. However, it is only the 
child processes that ever call "accept":
	ps axlw | grep httpd

-- 
jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/
Tel +44(0)117 9287864 or +44 (0)117 9287088 http://ioctl.org/jan/
"I think therefore I am." -- Ronnie Descartes



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.61.0412041219490.27997>