Re: fastcgi processes start but the web server doesn't

Stanley Gambarin (
Fri, 13 Dec 1996 13:49:49 -0500

Message-Id: <>
To: Michael Smith <>
Subject: Re: fastcgi processes start but the web server doesn't 
In-Reply-To: Your message of "Fri, 13 Dec 1996 09:54:44 GMT."
Date: Fri, 13 Dec 1996 13:49:49 -0500
From: Stanley Gambarin <>

> Interesting little problem just discovered for apache mod_fastcgi.  If
> the web server does not have permission to write to the log files, httpd
> processes don't start up; however fastcgi processes do.  This is with
> apache 1.2b1.
> Mike

	Above statement is indeed true due to Apache's implementation.
The Apache call's the initialization routines for the modules before it 
actually opens any log files.  Since mod_fastcgi spawns another process
(the FastCGI process manager) in it's initialization routine, the server
dies, but the FastCGI does not.  There are a number of ways to "fix" the
problem, some of which are listed below:

	- since init routine for mod_fastcgi is called from read_config 
function, which is actually called twice, we can keep a variable inside
the initialization routine to only spawn FCGI process manager on the second
try.  This however breaks, when you are running in the debug mode, in which
case, you will not be able to start any FastCGI procs (very bad).
	- patch Apache code to open it's logs (call to open_logs()) to be 
made before the call to read_config(), which calls initialization routines
in the modules.
	- another alternative is to check for parent pid of the 
FastCGI process manager usign getppid().  If it is 1 (no parent), then 
we can assume that httpd daemon is not running and die.

	For now, I am open  to suggestions as to other ways to "fix" this
bug, which will then hopefully make it into next patch for mod_fastcgi.

* Stanley Gambarin			Open Market Inc.		      *
* FastCGI (soon-to-be) Guru		245 First St. Cambridge MA 02142      *
*					(617) - 949 - 7487		      *
*					      *
* (school)    *
*		      *