FCGI and Apache

James Cooper (pixel@tiger.coe.missouri.edu)
Fri, 10 May 1996 12:48:29 -0500 (CDT)

Date: Fri, 10 May 1996 12:48:29 -0500 (CDT)
From: James Cooper <pixel@tiger.coe.missouri.edu>
To: fcgi-developers@openmarket.com
Subject: FCGI and Apache
Message-Id: <Pine.SGI.3.93.960510123651.24517D-100000@rhino.coe.missouri.edu>


Hello,

First off, thanks to the Apache group and OpenMarket for their respective
contributions.  FastCGI seems like a great idea.  Unfortunately I can't
seem to get my server configured to use it.

I've installed the FastCGI module with Apache 1.0.5 and 1.1 (w/patch).
Both compile and run.  The problem arises when I try to configure srm.conf
to allow the execution of FastCGI processes.  Neither server seems to want
to run a FastCGI.

.........................

my srm.conf:

AddType application/x-httpd-fcgi   fcg fcgi
AppClass /Net/common/usr/people/pixel/www/fcgi/tiny-perl-fcgi.fcg
         -listen-queue-depth 10 -processes 1

...

tiny-perl-fcgi.fcg:

#!/usr/local/perl5-fcgi/bin/perl

use FCGI;

$cnt = 0;
while(FCGI::accept >= 0) {
	print "Content-type: text/html\r\n\r\n";
	print "<head>\n<title>FastCGI Demo Page (perl)</title>\n</head>\n";
	print  "<h1>FastCGI Demo Page (perl)</h1>\n";
	print "This is coming from a FastCGI server.\n<BR>\n";
	print "Running on <EM>$ENV{SERVER_NAME}</EM> to <EM>$ENV{REMOTE_HOST}</EM>\n<BR>\n";
	$cnt++;
	print "This is connection number $cnt\n";
}

....

tiny-perl-fcgi.fcg runs fine from the command line (ie. FCGI.pm is loading
properly).  When I start the server with this configuration I sometimes
get:

rhino 99# ../src/httpd -f /usr/local/apache/apache_1.0.5/conf/httpd.conf
Caught sig huh 
Terminated 
rhino 100# ../src/httpd -f /usr/local/apache/apache_1.0.5/conf/httpd.conf
Caught sig huh
rhino 101# 

So the first time it would try to start and then quickly terminate.  I
then tried starting again (waiting a few seconds first), and it starts up
(albiet with the Caught sig huh error).

The web server is running -- it will server up html files, and execute
normal CGI scripts, and it even spawned the FastCGI process.  But any time
it is executed I get a "Document contains no data" message, and a notice
in my root shell that a FastCGI process terminated.

The results are worse if I try to run the C fast-cgi.fcg.  I'm guessing I
compiled it wrong because it gets stuck in an infinite loop and pins my
machine's CPU (I guess it's not idling properly).

.....

Sorry for the verbosity of the message, but I'm not sure where I went
wrong.  I'm guessing that the module is compiled properly.  Are my
srm.conf settings wrong?

Thanks

-- James


.........................................................................
                        James Paul Cooper * Pixel
                         MU College of Education
       pixel@coe.missouri.edu - http://tiger.coe.missouri.edu/~pixel/
.........................................................................