Fcgi_accept() returning -1
Sekine Coulibaly <sekine.coulibaly-rrmP9QWoGMJWk0Htik3J/[email protected]> Sun, 6 Feb 2011 14:17:38 +0100
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi there,
I have the fastcgi module up un running with an Apache 2 server.
My apache2 configuration file apache2.conf regarding to fastcgi is as follow :
<IfModule mod_fastcgi.c>
Alias /cgi-bin/ /usr/cgi-bin/
<Directory /usr/cgi-bin/>
SetHandler fastcgi-script
Options +ExecCGI
allow from all
</Directory>
AddHandler fastcgi-script *
FastCgiServer /usr/cgi-bin/myprocess -processes 5
</IfModule>
In the /usr/cgi-bin, I have a binary name myprocess, written in C, as follows :
#include <stdio.h>
#include "fcgi_stdio.h"
int main ( int argc , char **argv )
while (FCGI_Accept() >= 0) {
printf("Content-type: text/html\r\n"
"\r\n"
"<title>FastCGI Hello! (C, fcgi_stdio library)</title>"
"<h1>FastCGI Hello! (C, fcgi_stdio library)</h1>"
"Request number %d running on host <i>%s</i>\n",
++count, getenv("SERVER_NAME"));
}
}
My problem is that myprocess returns after just one iteration of FCGI_Accept(), as if it was in "CGI" mode, not "FASTCGI". Looks like FCGI_Accept() returns -1.
No error in error or access Apache2 logs.
Any idea ? Shall I switch to a "fastcgi" mode anywhere ? Aditionnaly, can I set the module configuration in my Virtual Host instead ?
Thanks for your help !
_______________________________________________
FastCGI-developers mailing list
FastCGI-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org
http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers