Re: Linux 2, Apache 1.2, fastCGI 2.0b2, fcgi apps won't stay up

Stanley Gambarin (stanleyg@cs.bu.edu)
Thu, 19 Jun 1997 11:38:01 -0400 (EDT)

From: Stanley Gambarin <stanleyg@cs.bu.edu>
Date: Thu, 19 Jun 1997 11:38:01 -0400 (EDT)
Message-Id: <199706191538.LAA26835@csa.bu.edu>
To: fastcgi-developers@OpenMarket.com, felix@crowfix.com
Subject: Re: Linux 2, Apache 1.2, fastCGI 2.0b2, fcgi apps won't stay up

Ok... I think I know what the possible problem might be.. let me try to remember
it correctly and explain...

	When mod_fastcgi starts up, it needs to create certain directories to
deposit socket and lock files into.  For the dynamic fastcgi applications, 
this directory is called "dynamic" and is a subdirectory of the FastCgiIpcDir.
At startup, mod_fastcgi must use the *absolute* pathname of the directory
because there is later a call to chdir() function (if i remember correctly)
so relative pathnames make absolutely no sense.  Note that we need to create
some defaults at this time, so that even if FastCgiIpcDir directive is not 
specified, we still get a working module.  In fact, if you trace the module,
you will see that the function that creates dynamic directory is invoked twice.
That should help you understand why absolute pathnames must be used.
	Now, to explain what i think is happenning when you run fastcgi...
If you start up as root, in ModFastCgiInit() function, the directory will be 
created as root.  Later on, when Apache does a setuid() and web server 
becomes www, any accesses of web server (i.e. mod_fastcgi) to directories
will not be permitted.. i.e you will get Permission Denied error message.
Same applies for the socket files and lock files, which will result in the death
of the fastcgi apps.  That also explains why certain stuff like directories 
 
	In any case this is what i think might be happenning..  Also, on linux
the socket files are ususally created with no permissions, so you either need to set umask or modify the code (although i thought it was fixed).  Finally,
you might create directories yourselves with permissions 755 and then see
what's going on.
					Hope that was of some help.
							Stanley.