Is my Apache server running as the root user or not?

Jan Grant Jan.Grant at bristol.ac.uk
Sat Dec 4 04:23:59 PST 2004


On Sat, 4 Dec 2004, csnyder wrote:

> On Sat, 4 Dec 2004 04:47:49 -0500, Peter C. Lai <sirmoo at 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


More information about the freebsd-questions mailing list