From owner-freebsd-questions@FreeBSD.ORG Sat Dec 4 12:23:59 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 027D216A4CE for ; Sat, 4 Dec 2004 12:23:59 +0000 (GMT) Received: from dirg.bris.ac.uk (dirg.bris.ac.uk [137.222.10.102]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D0F443D62 for ; Sat, 4 Dec 2004 12:23:58 +0000 (GMT) (envelope-from Jan.Grant@bristol.ac.uk) Received: from mail.ilrt.bris.ac.uk ([137.222.16.62]) by dirg.bris.ac.uk with esmtp (Exim 4.34) id 1CaYx6-0005Wf-GY; Sat, 04 Dec 2004 12:23:55 +0000 Received: from cmjg (helo=localhost) by mail.ilrt.bris.ac.uk with local-esmtp (Exim 4.34) id 1CaYx0-0000kC-Uc; Sat, 04 Dec 2004 12:23:51 +0000 Date: Sat, 4 Dec 2004 12:23:46 +0000 (GMT) From: Jan Grant X-X-Sender: cmjg@mail.ilrt.bris.ac.uk To: csnyder In-Reply-To: Message-ID: References: <1164.213.112.198.152.1102141467.squirrel@mail.hackunite.net> <20041204094749.GA268@cowbert.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Jan Grant X-Spam-Score: -2.8 X-Spam-Level: -- cc: "Peter C. Lai" cc: freebsd-questions@freebsd.org Subject: Re: Is my Apache server running as the root user or not? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2004 12:23:59 -0000 On Sat, 4 Dec 2004, csnyder wrote: > On Sat, 4 Dec 2004 04:47:49 -0500, Peter C. Lai 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