From davidb at pins.net Thu Oct 2 10:10:51 2008 From: davidb at pins.net (David Birnbaum) Date: Thu, 02 Oct 2008 10:10:51 -0400 Subject: [FASTCGI] SNAP In-Reply-To: References: Message-ID: <48E4D66B.5080200@pins.net> Folks, This has gone well - can anybody in the 2.X world test the SNAP, and the patch-posters as well? The patches seem to fix up a couple of irritating edge/race conditions, should help improve stability for everyone in a heavily-loaded production environment. Cheers, David. ------------------------------------------------------------------------ David Birnbaum wrote: > Folks, > > I've got the 0809231057 SNAP running in development under Apache > 1.3...so far, so good. I'll put it under load in production and see > if there are any problems. > > David. -------------- next part -------------- An HTML attachment was scrubbed... URL: From amit.gupta at fnisindia.com Fri Oct 3 03:53:15 2008 From: amit.gupta at fnisindia.com (Amit Gupta) Date: Fri, 3 Oct 2008 13:23:15 +0530 Subject: [FASTCGI] Regarding GetOverlappedResult() failed error. Message-ID: <20081003075433.B252D4A79@smtp.chelsea.net> Hi I saw a post on http://www.fastcgi.com/archives/fastcgi-developers/2008-September/000030.htm l. This is the exact issue I am facing on Windows Apache 2. But could not find any reply to this. Could you please let me know the solution to this problem? I am stuck with this issue for quite a long time. Thanks in advance. Regards Amit "This e-mail is intended only for the use of the individual(s) named above. If you are not the intended recipient of this e-mail, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any dissemination or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, immediately notify the sender by e-mail and delete the copy you have received." -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidb at pins.net Fri Oct 3 08:39:55 2008 From: davidb at pins.net (David Birnbaum) Date: Fri, 03 Oct 2008 08:39:55 -0400 Subject: [FASTCGI] Regarding GetOverlappedResult() failed error. In-Reply-To: <20081003075433.B252D4A79@smtp.chelsea.net> References: <20081003075433.B252D4A79@smtp.chelsea.net> Message-ID: <48E6129B.3010107@pins.net> Amit, I haven't seen this error. Do you know where the GetOverlappedResult() error message is coming from? Is that from Apache or mod_fastcgi? David. ------------------------------------------------------------------------ Amit Gupta wrote: > > Hi > > > > I saw a post on > http://www.fastcgi.com/archives/fastcgi-developers/2008-September/000030.html. > This is the exact issue I am facing on Windows Apache 2. But could not > find any reply to this. > > > > Could you please let me know the solution to this problem? I am stuck > with this issue for quite a long time. > > > > Thanks in advance. > > > > Regards > > Amit > > > > > "This e-mail is intended only for the use of the individual(s) named > above. If you are not the intended recipient of this e-mail, or the > employee or agent responsible for delivering it to the intended > recipient, you are hereby notified that any dissemination or copying > of this e-mail is strictly prohibited. If you have received this > e-mail in error, immediately notify the sender by e-mail and delete > the copy you have received." > ------------------------------------------------------------------------ > > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers at mailman.fastcgi.com > http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amit.gupta at fnisindia.com Fri Oct 3 08:45:02 2008 From: amit.gupta at fnisindia.com (Amit Gupta) Date: Fri, 3 Oct 2008 18:15:02 +0530 Subject: [FASTCGI] Regarding GetOverlappedResult() failed error. In-Reply-To: <48E6129B.3010107@pins.net> Message-ID: <20081003124617.A9E7D4DDB@smtp.chelsea.net> I think it comes from FastCGI. Following is the log excerpt: [Fri Oct 03 17:00:35 2008] [notice] Child 3992: Starting thread to listen on port 80. [Fri Oct 03 17:01:11 2008] [warn] FastCGI: (dynamic) server "C:/Apache/fcgi-bin/IIPImageServer.fcgi" started (pid 284) [Fri Oct 03 17:01:11 2008] [warn] FastCGI: (dynamic) server "C:/Apache/fcgi-bin/IIPImageServer.fcgi" (pid 284) terminated with exit with status '1' [Fri Oct 03 17:01:16 2008] [warn] FastCGI: (dynamic) server "C:/Apache/fcgi-bin/IIPImageServer.fcgi" restarted (pid 3700) [Fri Oct 03 17:01:16 2008] [error] [client 127.0.0.1] (OS 109)The pipe has been ended. : FastCGI: comm with server "C:/Apache/fcgi-bin/IIPImageServer.fcgi" aborted: GetOverlappedResult() failed [Fri Oct 03 17:01:16 2008] [error] [client 127.0.0.1] FastCGI: incomplete headers (0 bytes) received from server "C:/Apache/fcgi-bin/IIPImageServer.fcgi" [Fri Oct 03 17:01:16 2008] [warn] FastCGI: (dynamic) server "C:/Apache/fcgi-bin/IIPImageServer.fcgi" (pid 3700) terminated with exit with status '1' It comes when a request for fcgi-bin/IIPImageServer.fcgi is sent. _____ From: David Birnbaum [mailto:davidb at pins.net] Sent: Friday, October 03, 2008 6:10 PM To: Amit Gupta Cc: fastcgi-developers at mailman.fastcgi.com Subject: Re: [FASTCGI] Regarding GetOverlappedResult() failed error. Amit, I haven't seen this error. Do you know where the GetOverlappedResult() error message is coming from? Is that from Apache or mod_fastcgi? David. _____ Amit Gupta wrote: Hi I saw a post on http://www.fastcgi.com/archives/fastcgi-developers/2008-September/000030.htm l. This is the exact issue I am facing on Windows Apache 2. But could not find any reply to this. Could you please let me know the solution to this problem? I am stuck with this issue for quite a long time. Thanks in advance. Regards Amit "This e-mail is intended only for the use of the individual(s) named above. If you are not the intended recipient of this e-mail, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any dissemination or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, immediately notify the sender by e-mail and delete the copy you have received." _____ _______________________________________________ FastCGI-developers mailing list FastCGI-developers at mailman.fastcgi.com http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers "This e-mail is intended only for the use of the individual(s) named above. If you are not the intended recipient of this e-mail, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any dissemination or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, immediately notify the sender by e-mail and delete the copy you have received." -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidb at pins.net Fri Oct 3 08:51:01 2008 From: davidb at pins.net (David Birnbaum) Date: Fri, 03 Oct 2008 08:51:01 -0400 Subject: [FASTCGI] Regarding GetOverlappedResult() failed error. In-Reply-To: References: Message-ID: <48E61535.2080102@pins.net> Amit, This looks like it's due to your application crashing (that's the exit status 1). FastCGI will have opened a socket to your application to pass data back and forth. When the application exits, the pipe is closed, and that error message is indicative of that. I would recommend attaching a debugger to your application and seeing why it's exiting before sending any valid data to the FastCGI pipe. David. ------------------------------------------------------------------------ Amit Gupta wrote: > > I think it comes from FastCGI. Following is the log excerpt: > > / / > > /[Fri Oct 03 17:00:35 2008] [notice] Child 3992: Starting thread to > listen on port 80./ > > /[Fri Oct 03 17:01:11 2008] [warn] FastCGI: (dynamic) server > "C:/Apache/fcgi-bin/IIPImageServer.fcgi" started (pid 284)/ > > /[Fri Oct 03 17:01:11 2008] [warn] FastCGI: (dynamic) server > "C:/Apache/fcgi-bin/IIPImageServer.fcgi" (pid 284) terminated with > exit with status '1'/ > > /[Fri Oct 03 17:01:16 2008] [warn] FastCGI: (dynamic) server > "C:/Apache/fcgi-bin/IIPImageServer.fcgi" restarted (pid 3700)/ > > /[Fri Oct 03 17:01:16 2008] [error] [client 127.0.0.1] (OS 109)The > pipe has been ended. : FastCGI: comm with server > "C:/Apache/fcgi-bin/IIPImageServer.fcgi" aborted: > GetOverlappedResult() failed/ > > /[Fri Oct 03 17:01:16 2008] [error] [client 127.0.0.1] FastCGI: > incomplete headers (0 bytes) received from server > "C:/Apache/fcgi-bin/IIPImageServer.fcgi"/ > > /[Fri Oct 03 17:01:16 2008] [warn] FastCGI: (dynamic) server > "C:/Apache/fcgi-bin/IIPImageServer.fcgi" (pid 3700) terminated with > exit with status '1'/ > > > > > > It comes when a request for fcgi-bin/IIPImageServer.fcgi is sent. > > > > ------------------------------------------------------------------------ > > *From:* David Birnbaum [mailto:davidb at pins.net] > *Sent:* Friday, October 03, 2008 6:10 PM > *To:* Amit Gupta > *Cc:* fastcgi-developers at mailman.fastcgi.com > *Subject:* Re: [FASTCGI] Regarding GetOverlappedResult() failed error. > > > > Amit, > > I haven't seen this error. Do you know where the > GetOverlappedResult() error message is coming from? Is that from > Apache or mod_fastcgi? > > David. > > ------------------------------------------------------------------------ > > > Amit Gupta wrote: > > Hi > > > > I saw a post on > http://www.fastcgi.com/archives/fastcgi-developers/2008-September/000030.html. > This is the exact issue I am facing on Windows Apache 2. But could not > find any reply to this. > > > > Could you please let me know the solution to this problem? I am stuck > with this issue for quite a long time. > > > > Thanks in advance. > > > > Regards > > Amit > > > > > "This e-mail is intended only for the use of the individual(s) named > above. If you are not the intended recipient of this e-mail, or the > employee or agent responsible for delivering it to the intended > recipient, you are hereby notified that any dissemination or copying > of this e-mail is strictly prohibited. If you have received this > e-mail in error, immediately notify the sender by e-mail and delete > the copy you have received." > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers at mailman.fastcgi.com > http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers > > > "This e-mail is intended only for the use of the individual(s) named > above. If you are not the intended recipient of this e-mail, or the > employee or agent responsible for delivering it to the intended > recipient, you are hereby notified that any dissemination or copying > of this e-mail is strictly prohibited. If you have received this > e-mail in error, immediately notify the sender by e-mail and delete > the copy you have received." -------------- next part -------------- An HTML attachment was scrubbed... URL: From amit.gupta at fnisindia.com Fri Oct 3 09:02:21 2008 From: amit.gupta at fnisindia.com (Amit Gupta) Date: Fri, 3 Oct 2008 18:32:21 +0530 Subject: [FASTCGI] Regarding GetOverlappedResult() failed error. In-Reply-To: <48E61535.2080102@pins.net> Message-ID: <20081003130337.0844D50E5@smtp.chelsea.net> This application is not created by me. I am trying to setup IIPImage Server from http://prdownloads.sourceforge.net/iipimage/IIPImageServer-0.9.7.zip?downloa d. Let me see how I can find out the root cause of this. If you get some more info, please share it with me. _____ From: David Birnbaum [mailto:davidb at pins.net] Sent: Friday, October 03, 2008 6:21 PM To: Amit Gupta Cc: fastcgi-developers at mailman.fastcgi.com Subject: Re: [FASTCGI] Regarding GetOverlappedResult() failed error. Amit, This looks like it's due to your application crashing (that's the exit status 1). FastCGI will have opened a socket to your application to pass data back and forth. When the application exits, the pipe is closed, and that error message is indicative of that. I would recommend attaching a debugger to your application and seeing why it's exiting before sending any valid data to the FastCGI pipe. David. _____ Amit Gupta wrote: I think it comes from FastCGI. Following is the log excerpt: [Fri Oct 03 17:00:35 2008] [notice] Child 3992: Starting thread to listen on port 80. [Fri Oct 03 17:01:11 2008] [warn] FastCGI: (dynamic) server "C:/Apache/fcgi-bin/IIPImageServer.fcgi" started (pid 284) [Fri Oct 03 17:01:11 2008] [warn] FastCGI: (dynamic) server "C:/Apache/fcgi-bin/IIPImageServer.fcgi" (pid 284) terminated with exit with status '1' [Fri Oct 03 17:01:16 2008] [warn] FastCGI: (dynamic) server "C:/Apache/fcgi-bin/IIPImageServer.fcgi" restarted (pid 3700) [Fri Oct 03 17:01:16 2008] [error] [client 127.0.0.1] (OS 109)The pipe has been ended. : FastCGI: comm with server "C:/Apache/fcgi-bin/IIPImageServer.fcgi" aborted: GetOverlappedResult() failed [Fri Oct 03 17:01:16 2008] [error] [client 127.0.0.1] FastCGI: incomplete headers (0 bytes) received from server "C:/Apache/fcgi-bin/IIPImageServer.fcgi" [Fri Oct 03 17:01:16 2008] [warn] FastCGI: (dynamic) server "C:/Apache/fcgi-bin/IIPImageServer.fcgi" (pid 3700) terminated with exit with status '1' It comes when a request for fcgi-bin/IIPImageServer.fcgi is sent. _____ From: David Birnbaum [mailto:davidb at pins.net] Sent: Friday, October 03, 2008 6:10 PM To: Amit Gupta Cc: fastcgi-developers at mailman.fastcgi.com Subject: Re: [FASTCGI] Regarding GetOverlappedResult() failed error. Amit, I haven't seen this error. Do you know where the GetOverlappedResult() error message is coming from? Is that from Apache or mod_fastcgi? David. _____ Amit Gupta wrote: Hi I saw a post on http://www.fastcgi.com/archives/fastcgi-developers/2008-September/000030.htm l. This is the exact issue I am facing on Windows Apache 2. But could not find any reply to this. Could you please let me know the solution to this problem? I am stuck with this issue for quite a long time. Thanks in advance. Regards Amit "This e-mail is intended only for the use of the individual(s) named above. If you are not the intended recipient of this e-mail, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any dissemination or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, immediately notify the sender by e-mail and delete the copy you have received." _____ _______________________________________________ FastCGI-developers mailing list FastCGI-developers at mailman.fastcgi.com http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers "This e-mail is intended only for the use of the individual(s) named above. If you are not the intended recipient of this e-mail, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any dissemination or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, immediately notify the sender by e-mail and delete the copy you have received." "This e-mail is intended only for the use of the individual(s) named above. If you are not the intended recipient of this e-mail, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any dissemination or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, immediately notify the sender by e-mail and delete the copy you have received." -------------- next part -------------- An HTML attachment was scrubbed... URL: From agalkin at audible.com Fri Oct 3 12:43:59 2008 From: agalkin at audible.com (Alexander Galkin (Audible US)) Date: Fri, 3 Oct 2008 12:43:59 -0400 Subject: [FASTCGI] Configuring FastCGI app Message-ID: <8AD089992055F0408126B89B3E407B67054C2446@EXVS02.HESungard.local> I have FastCGI app run on Apache 2.0 server on Solaris 10. How do I configure FastCGI to: 1. I want only once instance of the app to be running. If the instance crashes or is killed I want mod_fastcgi to restart it. 2. I want either start the app manually or let mod_fastcgi start it upon request but I do not want it to kill my app when apache server is shutting down. -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidb at pins.net Mon Oct 6 11:15:51 2008 From: davidb at pins.net (David Birnbaum) Date: Mon, 6 Oct 2008 11:15:51 -0400 (EDT) Subject: [FASTCGI] Configuring FastCGI app In-Reply-To: <8AD089992055F0408126B89B3E407B67054C2446@EXVS02.HESungard.local> References: <8AD089992055F0408126B89B3E407B67054C2446@EXVS02.HESungard.local> Message-ID: On Fri, 3 Oct 2008, Alexander Galkin (Audible US) wrote: > I have FastCGI app run on Apache 2.0 server on Solaris 10. How do I configure > FastCGI to: > >   1. I want only once instance of the app to be running. If the instance > crashes or is killed I want mod_fastcgi to restart it. This is controlled with the FastCGI dynamic parameters (see the man page). >   2. I want either start the app manually or let mod_fastcgi start it upon > request but I do not want it to kill my app when apache server is shutting > down.     You can't have mod_fastcgi manager you application and expect it to live when Apache is shut down. You have to manage it on your own in that case. David. From agalkin at audible.com Mon Oct 6 11:18:31 2008 From: agalkin at audible.com (Alexander Galkin (Audible US)) Date: Mon, 6 Oct 2008 11:18:31 -0400 Subject: [FASTCGI] Configuring FastCGI app In-Reply-To: References: <8AD089992055F0408126B89B3E407B67054C2446@EXVS02.HESungard.local> Message-ID: <8AD089992055F0408126B89B3E407B6706B534F5@EXVS02.HESungard.local> I am fine with starting my FastCGI app myself. However, when Apache server is shut down and restarted I want mod_fastcgi to re-connect to the running instance of my FastCGI app. -----Original Message----- From: David Birnbaum [mailto:davidb at pins.net] Sent: Monday, October 06, 2008 11:16 AM To: Alexander Galkin (Audible US) Cc: fastcgi-developers at mailman.fastcgi.com Subject: Re: [FASTCGI] Configuring FastCGI app On Fri, 3 Oct 2008, Alexander Galkin (Audible US) wrote: > I have FastCGI app run on Apache 2.0 server on Solaris 10. How do I configure > FastCGI to: > >   1. I want only once instance of the app to be running. If the instance > crashes or is killed I want mod_fastcgi to restart it. This is controlled with the FastCGI dynamic parameters (see the man page). >   2. I want either start the app manually or let mod_fastcgi start it upon > request but I do not want it to kill my app when apache server is shutting > down.     You can't have mod_fastcgi manager you application and expect it to live when Apache is shut down. You have to manage it on your own in that case. David. From davidb at pins.net Mon Oct 6 12:56:37 2008 From: davidb at pins.net (David Birnbaum) Date: Mon, 6 Oct 2008 12:56:37 -0400 (EDT) Subject: [FASTCGI] Configuring FastCGI app In-Reply-To: <8AD089992055F0408126B89B3E407B6706B534F5@EXVS02.HESungard.local> References: <8AD089992055F0408126B89B3E407B67054C2446@EXVS02.HESungard.local> <8AD089992055F0408126B89B3E407B6706B534F5@EXVS02.HESungard.local> Message-ID: Alexander, In that case, set it up as a FastCgiExternalServer and have mod_fastcgi connect to a UNIX or TCP socket. David. ----- On Mon, 6 Oct 2008, Alexander Galkin (Audible US) wrote: > I am fine with starting my FastCGI app myself. However, when Apache server is shut down and restarted I want mod_fastcgi to re-connect to the running instance of my FastCGI app. > > > > -----Original Message----- > From: David Birnbaum [mailto:davidb at pins.net] > Sent: Monday, October 06, 2008 11:16 AM > To: Alexander Galkin (Audible US) > Cc: fastcgi-developers at mailman.fastcgi.com > Subject: Re: [FASTCGI] Configuring FastCGI app > > On Fri, 3 Oct 2008, Alexander Galkin (Audible US) wrote: > >> I have FastCGI app run on Apache 2.0 server on Solaris 10. How do I configure >> FastCGI to: >> >>   1. I want only once instance of the app to be running. If the instance >> crashes or is killed I want mod_fastcgi to restart it. > > This is controlled with the FastCGI dynamic parameters (see the man page). > >>   2. I want either start the app manually or let mod_fastcgi start it upon >> request but I do not want it to kill my app when apache server is shutting >> down.     > > You can't have mod_fastcgi manager you application and expect it to live when > Apache is shut down. You have to manage it on your own in that case. > > David. > From robs at saccoccio.org Tue Oct 7 12:26:51 2008 From: robs at saccoccio.org (Rob Saccoccio) Date: Tue, 7 Oct 2008 12:26:51 -0400 Subject: [FASTCGI] SetHandler and AddHandler ignored In-Reply-To: <20080929073801.GS20331@femme.catnip.org.uk> References: <20080929073801.GS20331@femme.catnip.org.uk> Message-ID: <5E8B1005F2A44CB4B4E3951230DA18ED@maisel> I'm afraid your barking up the wrong tree. SetHandler/AddHandler don't set the content-type. Is your fastcgi application sending a content-type header? Rob > -----Original Message----- > From: fastcgi-developers-bounces+robs=fastcgi.com at mailman.fastcgi.com > [mailto:fastcgi-developers-bounces+robs=fastcgi.com at mailman.fastcgi.com] > On Behalf Of David Pashley > Sent: Monday, September 29, 2008 3:38 AM > To: fastcgi-developers at mailman.fastcgi.com > Subject: [FASTCGI] SetHandler and AddHandler ignored > > I've been looking at a problem I've been having with using > FastCGIExternalServer. The problem is that it ignores SetHandler and > AddHandler and passes everything through the fastcgi handler. I've > tracked this down to the fixups() function in mod_fastcgi.c, which looks > to see if the path is in one of the fastcgi handled paths and explicitly > sets the handler to fastcgi-script. This causes a problem when using php > in fastcgi mode, as the module forces every single request through the > php interpreter, rather than just the php files. The result is that > every request ends up having a content type of text/html. > > The fixups() function was added some time between 22-Sep-2002 and > 19-Oct-2002 with the change log entry of: > > *) Eliminate the need for SetHandler or AddHandler with static or > external applications. > > The solution would be to remove the fixups function and document that if > a users wants the old behaviour, they should add a Sethandler > fastcgi-script option in their apache config. > > I can provide a patch if needs be. > > -- > David Pashley > david at davidpashley.com > Nihil curo de ista tua stulta superstitione. > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers at mailman.fastcgi.com > http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers From agalkin at audible.com Tue Oct 7 13:20:56 2008 From: agalkin at audible.com (Alexander Galkin (Audible US)) Date: Tue, 7 Oct 2008 13:20:56 -0400 Subject: [FASTCGI] Configuring FastCGI app In-Reply-To: References: <8AD089992055F0408126B89B3E407B67054C2446@EXVS02.HESungard.local> <8AD089992055F0408126B89B3E407B6706B534F5@EXVS02.HESungard.local> Message-ID: <8AD089992055F0408126B89B3E407B6706BDFEE0@EXVS02.HESungard.local> I configured apache to use my FastCGI app as external server In httpd.conf LoadModule fastcgi_module /opt/apache/modules/mod_fastcgi.so FastCgiExternalServer /opt/apache/htdocs -host localhost:9005 I call FCGX_Init(); int socket = FCGX_OpenSocket(":9005", 100); In each thread of my multithreaed FastCGI app I call FCGX_InitRequest(&request, socket, 0); I start my FastCGI server and I verify it is listening on 9005 port. I start Apache server and everything seems to be OK [Tue Oct 07 13:02:16 2008] [notice] Digest: generating secret for digest authentication ... [Tue Oct 07 13:02:16 2008] [notice] Digest: done [Tue Oct 07 13:02:16 2008] [notice] FastCGI: process manager initialized (pid 20281) [Tue Oct 07 13:02:17 2008] [notice] Apache configured -- resuming normal operations Now when I try access URL that invokes the FastCGI app I get error in Apache log file bind/listen: Address already in use I am not why I am getting this error. -----Original Message----- From: David Birnbaum [mailto:davidb at pins.net] Sent: Monday, October 06, 2008 12:57 PM To: Alexander Galkin (Audible US) Cc: fastcgi-developers at mailman.fastcgi.com Subject: RE: [FASTCGI] Configuring FastCGI app Alexander, In that case, set it up as a FastCgiExternalServer and have mod_fastcgi connect to a UNIX or TCP socket. David. ----- On Mon, 6 Oct 2008, Alexander Galkin (Audible US) wrote: > I am fine with starting my FastCGI app myself. However, when Apache server is shut down and restarted I want mod_fastcgi to re-connect to the running instance of my FastCGI app. > > > > -----Original Message----- > From: David Birnbaum [mailto:davidb at pins.net] > Sent: Monday, October 06, 2008 11:16 AM > To: Alexander Galkin (Audible US) > Cc: fastcgi-developers at mailman.fastcgi.com > Subject: Re: [FASTCGI] Configuring FastCGI app > > On Fri, 3 Oct 2008, Alexander Galkin (Audible US) wrote: > >> I have FastCGI app run on Apache 2.0 server on Solaris 10. How do I configure >> FastCGI to: >> >>   1. I want only once instance of the app to be running. If the instance >> crashes or is killed I want mod_fastcgi to restart it. > > This is controlled with the FastCGI dynamic parameters (see the man page). > >>   2. I want either start the app manually or let mod_fastcgi start it upon >> request but I do not want it to kill my app when apache server is shutting >> down.     > > You can't have mod_fastcgi manager you application and expect it to live when > Apache is shut down. You have to manage it on your own in that case. > > David. > From robs at saccoccio.org Tue Oct 7 16:07:22 2008 From: robs at saccoccio.org (Rob Saccoccio) Date: Tue, 7 Oct 2008 16:07:22 -0400 Subject: [FASTCGI] SetHandler and AddHandler ignored In-Reply-To: <20081007184522.GG20331@femme.catnip.org.uk> References: <20080929073801.GS20331@femme.catnip.org.uk> <5E8B1005F2A44CB4B4E3951230DA18ED@maisel> <20081007184522.GG20331@femme.catnip.org.uk> Message-ID: <4414E2A8922A41ACB1C7283C82F37409@maisel> > On Oct 07, 2008 at 17:26, Rob Saccoccio praised the llamas by saying: > > I'm afraid your barking up the wrong tree. SetHandler/AddHandler don't > set > > the content-type. > > > > Is your fastcgi application sending a content-type header? > > Yes, that's the point. Everything is being sent through the fastcgi > application, irrespectively of whether apache is configured to do so. Well now you've really confused me. Are you having a problem with the content-type being wrong when its get to the browser or are document requests being sent to your fastcgi application that shouldn't be? Posting your config and what it is your trying to do would be helpful. Rob From robs at fastcgi.com Tue Oct 7 16:30:04 2008 From: robs at fastcgi.com (Rob Saccoccio) Date: Tue, 7 Oct 2008 16:30:04 -0400 Subject: [FASTCGI] Configuring FastCGI app In-Reply-To: <8AD089992055F0408126B89B3E407B6706BDFEE0@EXVS02.HESungard.local> References: <8AD089992055F0408126B89B3E407B67054C2446@EXVS02.HESungard.local><8AD089992055F0408126B89B3E407B6706B534F5@EXVS02.HESungard.local> <8AD089992055F0408126B89B3E407B6706BDFEE0@EXVS02.HESungard.local> Message-ID: That error is coming from the fastcgi library in your application. If the message is going to the httpd log (and you haven't piped output from your application there when you started it), then mod_fastcgi is starting it. Mod_fastcgi will bind and listen and then exec your application which of course tries to bind and listen again. FastCgiExternalServer won't start an application. So you've either got something else in your config or you've piped stderr to the httpd log when you started the application. If it’s the latter (you shouldn't do that), you've probably already got a copy of your application running. > -----Original Message----- > From: fastcgi-developers-bounces+robs=fastcgi.com at mailman.fastcgi.com > [mailto:fastcgi-developers-bounces+robs=fastcgi.com at mailman.fastcgi.com] > On Behalf Of Alexander Galkin (Audible US) > Sent: Tuesday, October 07, 2008 1:21 PM > To: David Birnbaum > Cc: fastcgi-developers at mailman.fastcgi.com > Subject: Re: [FASTCGI] Configuring FastCGI app > > I configured apache to use my FastCGI app as external server > > In httpd.conf > > LoadModule fastcgi_module /opt/apache/modules/mod_fastcgi.so > FastCgiExternalServer /opt/apache/htdocs -host localhost:9005 > > I call > > FCGX_Init(); > int socket = FCGX_OpenSocket(":9005", 100); > > In each thread of my multithreaed FastCGI app I call > FCGX_InitRequest(&request, socket, 0); > > I start my FastCGI server and I verify it is listening on 9005 port. I > start Apache server and everything seems to be OK > > [Tue Oct 07 13:02:16 2008] [notice] Digest: generating secret for digest > authentication ... > [Tue Oct 07 13:02:16 2008] [notice] Digest: done > [Tue Oct 07 13:02:16 2008] [notice] FastCGI: process manager initialized > (pid 20281) > [Tue Oct 07 13:02:17 2008] [notice] Apache configured -- resuming normal > operations > > Now when I try access URL that invokes the FastCGI app I get error in > Apache log file > bind/listen: Address already in use > > I am not why I am getting this error. > > -----Original Message----- > From: David Birnbaum [mailto:davidb at pins.net] > Sent: Monday, October 06, 2008 12:57 PM > To: Alexander Galkin (Audible US) > Cc: fastcgi-developers at mailman.fastcgi.com > Subject: RE: [FASTCGI] Configuring FastCGI app > > Alexander, > > In that case, set it up as a FastCgiExternalServer and have mod_fastcgi > connect > to a UNIX or TCP socket. > > David. > > ----- > > On Mon, 6 Oct 2008, Alexander Galkin (Audible US) wrote: > > > I am fine with starting my FastCGI app myself. However, when Apache > server is shut down and restarted I want mod_fastcgi to re-connect to the > running instance of my FastCGI app. > > > > > > > > -----Original Message----- > > From: David Birnbaum [mailto:davidb at pins.net] > > Sent: Monday, October 06, 2008 11:16 AM > > To: Alexander Galkin (Audible US) > > Cc: fastcgi-developers at mailman.fastcgi.com > > Subject: Re: [FASTCGI] Configuring FastCGI app > > > > On Fri, 3 Oct 2008, Alexander Galkin (Audible US) wrote: > > > >> I have FastCGI app run on Apache 2.0 server on Solaris 10. How do I > configure > >> FastCGI to: > >> > >>   1. I want only once instance of the app to be running. If the > instance > >> crashes or is killed I want mod_fastcgi to restart it. > > > > This is controlled with the FastCGI dynamic parameters (see the man > page). > > > >>   2. I want either start the app manually or let mod_fastcgi start it > upon > >> request but I do not want it to kill my app when apache server is > shutting > >> down. > > > > You can't have mod_fastcgi manager you application and expect it to live > when > > Apache is shut down. You have to manage it on your own in that case. > > > > David. > > > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers at mailman.fastcgi.com > http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers From robs at fastcgi.com Tue Oct 7 17:03:37 2008 From: robs at fastcgi.com (Rob Saccoccio) Date: Tue, 7 Oct 2008 17:03:37 -0400 Subject: [FASTCGI] SetHandler and AddHandler ignored In-Reply-To: <20081007203831.GH20331@femme.catnip.org.uk> References: <20080929073801.GS20331@femme.catnip.org.uk> <5E8B1005F2A44CB4B4E3951230DA18ED@maisel> <20081007184522.GG20331@femme.catnip.org.uk> <4414E2A8922A41ACB1C7283C82F37409@maisel> <20081007203831.GH20331@femme.catnip.org.uk> Message-ID: <0CE757914FCC4DC7AB066D4835B5D0EE@maisel> > Here's an example config. php-cgi is running in fastcgi mode on > localhost:9000. I want PHP files (*.php) to be sent to this php-cgi > daemon and everything else to be served statically by apache. The > AddHandler statement should do this. > > ---BEGIN--- > > ServerName www.example.com > DocumentRoot /home/user/webs/www.example.com > AddHandler fastcgi-script .php > > FastCGIExternalServer /home/user/webs/www.example.com -host 127.0.0.1:9000 > ---END--- > > What happens is that regardless of the file extention, everything is > passed to the php daemon running on localhost, php, javascript, images > and css. Unless you tell it otherwise, PHP serves content as text/html. > The result is that css and javascript have the wrong content type. To do what you want, the path in the FastCGIExternalServer directive should not be a directory. You want something like this (see http://www.fastcgi.com/docs/faq.html#PHP and the PHP docs): ServerName www.example.com DocumentRoot /home/user/webs/www.example.com Action php-fastcgi AddHandler php-fastcgi .php FastCGIExternalServer -host 127.0.0.1:9000 Where is someplace outside of your servers' document root or is inside but is not a directory. This will define a new handler type called php-fastcgi and associate it with php-path. > If you remove the fixups function, which explicitly sets the handler for > requests to fastcgi-script, everything works as it should. Funny how that is. From robs at fastcgi.com Wed Oct 8 08:50:11 2008 From: robs at fastcgi.com (Rob Saccoccio) Date: Wed, 8 Oct 2008 08:50:11 -0400 Subject: [FASTCGI] SetHandler and AddHandler ignored In-Reply-To: <20081007212527.GI20331@femme.catnip.org.uk> References: <20080929073801.GS20331@femme.catnip.org.uk> <5E8B1005F2A44CB4B4E3951230DA18ED@maisel> <20081007184522.GG20331@femme.catnip.org.uk> <4414E2A8922A41ACB1C7283C82F37409@maisel> <20081007203831.GH20331@femme.catnip.org.uk> <0CE757914FCC4DC7AB066D4835B5D0EE@maisel> <20081007212527.GI20331@femme.catnip.org.uk> Message-ID: > > To do what you want, the path in the FastCGIExternalServer directive > should > > not be a directory. You want something like this (see > > http://www.fastcgi.com/docs/faq.html#PHP and the PHP docs): > > > > > > ServerName www.example.com > > DocumentRoot /home/user/webs/www.example.com > > Action php-fastcgi > > AddHandler php-fastcgi .php > > > > FastCGIExternalServer -host 127.0.0.1:9000 > > > > Where is someplace outside of your servers' document root or > is > > inside but is not a directory. > > And this doesn't work. > > Using: > Action php-fastcgi /fastcgi/www.example.com > AddHandler php-fastcgi .php > > FastCGIExternalServer /fastcgi/www.example.com -host 127.0.0.1:9000 > > Going to http://www.example.com/journal/ results in: > > The requested URL /fastcgi/www.example.com/journal/index.php was not found > on this server. Did you try using a path that did exist? Did you try using the virtual option to the Action directive?: The optional virtual modifier turns off the check whether the requested file really exists. This is useful, for example, if you want to use the Action directive in virtual locations. > Because modules shouldn't be setting the handler themselves? That's what > SetHandler and AddHandler are for. > > I've spend a significant amount of time getting this to work, trying > many, many permutations of configurations. The only way I've got > FastCGIExternalServer to work is as I've explained. It's perfectly fine for a module to set the handler and many modules do it, including some inside the Apache distribution. It's a shame that you've had to spend a significant amount of time trying to get this to work, but that doesn't mean that your result is the only one or the right one. Rob From jpan at fudan.edu.cn Wed Oct 15 22:45:32 2008 From: jpan at fudan.edu.cn (Jie PAN) Date: Thu, 16 Oct 2008 10:45:32 +0800 Subject: [FASTCGI] Signal Uncaught Message-ID: Hi all. I tried to write some scirpts in php, and met a problem while using lighttpd with mod_fastcgi. Here's the code below: --------------------------------------------------- --------------------------------------------------- The issue is, the signal could only be caught for the first time, and then always failed until lighttpd was restarted. If I switched mod_fastcgi to mod_cgi in lighttpd.conf, the signal could be caught everytime without problem. I'm using lighttpd 1.4.20 & php 5.2.6 with default configuration. Thanks in advance. From robs at saccoccio.org Fri Oct 17 07:23:04 2008 From: robs at saccoccio.org (Rob) Date: Fri, 17 Oct 2008 07:23:04 -0400 Subject: [FASTCGI] Signal Uncaught In-Reply-To: References: Message-ID: This should be posted to the lighttpd forum: http://forum.lighttpd.net/forum/1/ > -----Original Message----- > From: fastcgi-developers-bounces+robs=fastcgi.com at mailman.fastcgi.com > [mailto:fastcgi-developers-bounces+robs=fastcgi.com at mailman.fastcgi.com] > On Behalf Of Jie PAN > Sent: Wednesday, October 15, 2008 10:46 PM > To: fastcgi-developers at mailman.fastcgi.com > Subject: [FASTCGI] Signal Uncaught > > Hi all. > > I tried to write some scirpts in php, and met a problem while using > lighttpd with mod_fastcgi. Here's the code below: > --------------------------------------------------- > declare(ticks = 1); > > function sig_handler($signo) > { > echo "Caught signal...\n"; > } > > echo "Installing signal handler...\n"; > > pcntl_signal(SIGUSR1, "sig_handler", FALSE); > > echo"Generating signal SIGTERM to self...\n"; > > echo posix_getpid(); > posix_kill(posix_getpid(), SIGUSR1); > > echo "Done\n" > > ?> > --------------------------------------------------- > The issue is, the signal could only be caught for the first time, and then > always failed until lighttpd was restarted. If I switched mod_fastcgi to > mod_cgi in lighttpd.conf, the signal could be caught everytime without > problem. I'm using lighttpd 1.4.20 & php 5.2.6 with default configuration. > > Thanks in advance. > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers at mailman.fastcgi.com > http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers From bryan at arcamax.com Fri Oct 17 10:56:59 2008 From: bryan at arcamax.com (Bryan White) Date: Fri, 17 Oct 2008 10:56:59 -0400 Subject: [FASTCGI] Unsubscribe is not working Message-ID: <48F8A7BB.2040001@arcamax.com> I am moving my mailing list email to another account. Toward that end I have been trying to unsub the FastCGI list from this account. It is not working. I have tried three times over the last month or so. The list volume is low enough that it often takes a week before I see new messages and learn that the unsub did not take. Twice I have used the HTTP link in the unsub confirmation email. The last time I replied to the confirmation email. That was on Oct 7th. Is there someone in a position to investigate what is going on? -- Bryan White, ArcaMax Publishing Inc. 4 of 5 voices in my head agree. From sxk1969 at hotmail.com Tue Oct 21 18:20:15 2008 From: sxk1969 at hotmail.com (Saikat Kanjilal) Date: Tue, 21 Oct 2008 15:20:15 -0700 Subject: [FASTCGI] HTTP Post Message-ID: Hi Folks: I have written some fastcgi C++ code to process get requests which seems to be working fine, I now need to change this code to process post requests. Before I begin this endeavor I would like to confirm whether the latest release of fastcgi for Apache in windows supports http post requests as well as get requests. Additionally is there some sample code lying around that I can look at which processes post requests preferably in a while loop which keeps accepting http requests. I would ideally like to do this without bringing other libraries like gnucgicc into the picture. Any help would be much appreciated. Thanks _________________________________________________________________ Store, manage and share up to 5GB with Windows Live SkyDrive. http://skydrive.live.com/welcome.aspx?provision=1?ocid=TXT_TAGLM_WL_skydrive_102008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From amit.gupta at fnisindia.com Wed Oct 22 05:48:56 2008 From: amit.gupta at fnisindia.com (Amit Gupta) Date: Wed, 22 Oct 2008 15:18:56 +0530 Subject: [FASTCGI] Issues on Solaris "TIFFReadEncodedTile failed for" Message-ID: <20081022095020.DB7664A91@smtp.chelsea.net> Hi I have successfully installed IIPImage Server 0.9.7 on Solaris 5.10 with Apache 2.2.9 and FastCGI 2.4.6. The following is appearing when I try to access the url http://<>/fcgi-bin/iipsrv.fcgi: Internet Imaging Protocol Server Version 0.9.7 Project Home Page: http://iipimage.sourceforge.net by Ruven Pillay But the issue is when I try to access an image with url http://<>/fcgi-bin/iipsrv.fcgi?FIF=/usr/images/foto.tif&wid=200&cvt=jpeg, image is not displayed. Instead box with X is displayed. Following is in logs: CVT maximum viewport size set to 3000 Full Request is FIF=/usr/images/foto.tif&wid=2000&cvt=jpeg [1/3]: Command / Argument is FIF : /usr/images/foto.tif Image cache hit. Number of elements: 2 FIF :: TIFF image requested image width is 4000 and height is 828 [2/3]: Command / Argument is wid : 2000 WID handler reached [3/3]: Command / Argument is cvt : jpeg CVT handler reached TileManager :: Cache Miss for resolution: 4, tile: 0 TileManager :: Cache Size: 1 tiles, 0.768277 MB TIFFReadEncodedTile failed for /usr/images/foto.tif Total Request Time: 8289 microseconds image closed and deleted Server count is 8 Could anybody please tell me what could be the reason behind this error? Thanks in Advance. Regards Amit "This e-mail is intended only for the use of the individual(s) named above. If you are not the intended recipient of this e-mail, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any dissemination or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, immediately notify the sender by e-mail and delete the copy you have received." -------------- next part -------------- An HTML attachment was scrubbed... URL: From robs at fastcgi.com Wed Oct 22 07:22:58 2008 From: robs at fastcgi.com (Rob Saccoccio) Date: Wed, 22 Oct 2008 07:22:58 -0400 Subject: [FASTCGI] HTTP Post In-Reply-To: References: Message-ID: Yes, mod_fastcgi for Apache has always supported POST requests. I haven't yet posted a dll for the latest snapshot version of mod_fastcgi. You can of course build it yourself though (http://www.fastcgi.com/dist/mod_fastcgi-SNAP-0809231057.tar.gz). If you don't want to build it, the dll that is there should be fine. All three of the echo variations in the examples directory of the fcgi2 development kit process POST requests in a loop: http://www.fastcgi.com/devkit/examples/ Rob _____ From: fastcgi-developers-bounces+robs=fastcgi.com at mailman.fastcgi.com [mailto:fastcgi-developers-bounces+robs=fastcgi.com at mailman.fastcgi.com] On Behalf Of Saikat Kanjilal Sent: Tuesday, October 21, 2008 6:20 PM To: fastcgi-developers at mailman.fastcgi.com Subject: [FASTCGI] HTTP Post Hi Folks: I have written some fastcgi C++ code to process get requests which seems to be working fine, I now need to change this code to process post requests. Before I begin this endeavor I would like to confirm whether the latest release of fastcgi for Apache in windows supports http post requests as well as get requests. Additionally is there some sample code lying around that I can look at which processes post requests preferably in a while loop which keeps accepting http requests. I would ideally like to do this without bringing other libraries like gnucgicc into the picture. Any help would be much appreciated. Thanks _____ Store, manage and share up to 5GB with Windows Live SkyDrive. Start uploading now -------------- next part -------------- An HTML attachment was scrubbed... URL: From robs at saccoccio.org Wed Oct 22 07:27:10 2008 From: robs at saccoccio.org (Rob) Date: Wed, 22 Oct 2008 07:27:10 -0400 Subject: [FASTCGI] Issues on Solaris "TIFFReadEncodedTile failed for" In-Reply-To: <20081022095020.DB7664A91@smtp.chelsea.net> References: <20081022095020.DB7664A91@smtp.chelsea.net> Message-ID: <22364095ECD94BCBA30201D4EFBBE8DC@maisel> You'll have to post to a forum associated with IIPImage Server; I'm not familiar with it. None of the messages below are coming from fastcgi components. Rob _____ From: fastcgi-developers-bounces+robs=fastcgi.com at mailman.fastcgi.com [mailto:fastcgi-developers-bounces+robs=fastcgi.com at mailman.fastcgi.com] On Behalf Of Amit Gupta Sent: Wednesday, October 22, 2008 5:49 AM To: fastcgi-developers at mailman.fastcgi.com Subject: [FASTCGI] Issues on Solaris "TIFFReadEncodedTile failed for" Hi I have successfully installed IIPImage Server 0.9.7 on Solaris 5.10 with Apache 2.2.9 and FastCGI 2.4.6. The following is appearing when I try to access the url http://<>/fcgi-bin/iipsrv.fcgi: Internet Imaging Protocol Server Version 0.9.7 Project Home Page: http://iipimage.sourceforge.net by Ruven Pillay But the issue is when I try to access an image with url http://<>/fcgi-bin/iipsrv.fcgi?FIF=/usr/images/foto.tif&wid=200&cvt=jpeg, image is not displayed. Instead box with X is displayed. Following is in logs: CVT maximum viewport size set to 3000 Full Request is FIF=/usr/images/foto.tif&wid=2000&cvt=jpeg [1/3]: Command / Argument is FIF : /usr/images/foto.tif Image cache hit. Number of elements: 2 FIF :: TIFF image requested image width is 4000 and height is 828 [2/3]: Command / Argument is wid : 2000 WID handler reached [3/3]: Command / Argument is cvt : jpeg CVT handler reached TileManager :: Cache Miss for resolution: 4, tile: 0 TileManager :: Cache Size: 1 tiles, 0.768277 MB TIFFReadEncodedTile failed for /usr/images/foto.tif Total Request Time: 8289 microseconds image closed and deleted Server count is 8 Could anybody please tell me what could be the reason behind this error? Thanks in Advance. Regards Amit "This e-mail is intended only for the use of the individual(s) named above. If you are not the intended recipient of this e-mail, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any dissemination or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, immediately notify the sender by e-mail and delete the copy you have received." -------------- next part -------------- An HTML attachment was scrubbed... URL: From sxk1969 at hotmail.com Wed Oct 22 11:15:37 2008 From: sxk1969 at hotmail.com (Saikat Kanjilal) Date: Wed, 22 Oct 2008 08:15:37 -0700 Subject: [FASTCGI] HTTP Post In-Reply-To: References: Message-ID: Rob/Jay: Thank your very much for your help on this, I would like some clarifications on some things after reading through both of your emails. 1) Rob mentioned that all of the echo examples in the dev kit currently work with post requests, my question here is do I still need to decode the data still using cgicc or some other utility, currently I am using FCGX_GetParam to retrieve the query string and then parse the key value pairs from that string, I am guessing I'll have to get rid of all of this code in order to process a POST request, is that correct 2) Ideally I would like to decode the posted data just using mod_fastcgi and the devkit and not use any other libs, to both of your knowledge is this currently possible, I couldn't quite tell from reading both of your emails Your help is much appreciated. Thanks From: sxk1969 at hotmail.com To: fastcgi-developers at mailman.fastcgi.com Date: Tue, 21 Oct 2008 15:20:15 -0700 Subject: [FASTCGI] HTTP Post Hi Folks: I have written some fastcgi C++ code to process get requests which seems to be working fine, I now need to change this code to process post requests. Before I begin this endeavor I would like to confirm whether the latest release of fastcgi for Apache in windows supports http post requests as well as get requests. Additionally is there some sample code lying around that I can look at which processes post requests preferably in a while loop which keeps accepting http requests. I would ideally like to do this without bringing other libraries like gnucgicc into the picture. Any help would be much appreciated. Thanks Store, manage and share up to 5GB with Windows Live SkyDrive. Start uploading now _________________________________________________________________ Want to read Hotmail messages in Outlook? The Wordsmiths show you how. http://windowslive.com/connect/post/wedowindowslive.spaces.live.com-Blog-cns!20EE04FBC541789!167.entry?ocid=TXT_TAGLM_WL_hotmail_092008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From robs at saccoccio.org Wed Oct 22 11:34:47 2008 From: robs at saccoccio.org (Rob) Date: Wed, 22 Oct 2008 11:34:47 -0400 Subject: [FASTCGI] HTTP Post In-Reply-To: References: Message-ID: Instead of parsing the query string, you'll have to parse the POST data on the stdin stream. This is standard CGI stuff. FastCGI doesn't make it any harder or any easier. I'm sure you can google piles of CGI examples that parse form data from stdin. Rob _____ From: fastcgi-developers-bounces+robs=fastcgi.com at mailman.fastcgi.com [mailto:fastcgi-developers-bounces+robs=fastcgi.com at mailman.fastcgi.com] On Behalf Of Saikat Kanjilal Sent: Wednesday, October 22, 2008 11:16 AM To: fastcgi-developers at mailman.fastcgi.com Subject: Re: [FASTCGI] HTTP Post Rob/Jay: Thank your very much for your help on this, I would like some clarifications on some things after reading through both of your emails. 1) Rob mentioned that all of the echo examples in the dev kit currently work with post requests, my question here is do I still need to decode the data still using cgicc or some other utility, currently I am using FCGX_GetParam to retrieve the query string and then parse the key value pairs from that string, I am guessing I'll have to get rid of all of this code in order to process a POST request, is that correct 2) Ideally I would like to decode the posted data just using mod_fastcgi and the devkit and not use any other libs, to both of your knowledge is this currently possible, I couldn't quite tell from reading both of your emails Your help is much appreciated. Thanks _____ From: sxk1969 at hotmail.com To: fastcgi-developers at mailman.fastcgi.com Date: Tue, 21 Oct 2008 15:20:15 -0700 Subject: [FASTCGI] HTTP Post Hi Folks: I have written some fastcgi C++ code to process get requests which seems to be working fine, I now need to change this code to process post requests. Before I begin this endeavor I would like to confirm whether the latest release of fastcgi for Apache in windows supports http post requests as well as get requests. Additionally is there some sample code lying around that I can look at which processes post requests preferably in a while loop which keeps accepting http requests. I would ideally like to do this without bringing other libraries like gnucgicc into the picture. Any help would be much appreciated. Thanks _____ Store, manage and share up to 5GB with Windows Live SkyDrive. Start uploading now _____ Want to read Hotmail messages in Outlook? The Wordsmiths show you how. Learn Now -------------- next part -------------- An HTML attachment was scrubbed... URL: From jsprenkle at gmail.com Wed Oct 22 18:32:23 2008 From: jsprenkle at gmail.com (Jay Sprenkle) Date: Wed, 22 Oct 2008 17:32:23 -0500 Subject: [FASTCGI] HTTP Post In-Reply-To: References: Message-ID: <1b5f39a10810221532t64e4ea34q1cf2fb611e13ccc5@mail.gmail.com> Rob has said it all. The cgicc library is designed to do just that. As he's also said there are lots of examples available. The best example of a complete and working fastcgi program I've found is the NCBI toolkit, ftp://ftp.ncbi.nih.gov/toolbox/ On Wed, Oct 22, 2008 at 10:34 AM, Rob wrote: > Instead of parsing the query string, you'll have to parse the POST data > on the stdin stream. This is standard CGI stuff. FastCGI doesn't make it > any harder or any easier. I'm sure you can google piles of CGI examples > that parse form data from stdin. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sxk1969 at hotmail.com Wed Oct 22 18:47:32 2008 From: sxk1969 at hotmail.com (Saikat Kanjilal) Date: Wed, 22 Oct 2008 15:47:32 -0700 Subject: [FASTCGI] HTTP Post In-Reply-To: <1b5f39a10810221532t64e4ea34q1cf2fb611e13ccc5@mail.gmail.com> References: <1b5f39a10810221532t64e4ea34q1cf2fb611e13ccc5@mail.gmail.com> Message-ID: I figured it out without cgicc :) using the examples actually in the fastcgi dev kit. Thanks again for both of your help, much appreciated. Date: Wed, 22 Oct 2008 17:32:23 -0500 From: jsprenkle at gmail.com To: robs at saccoccio.org Subject: Re: [FASTCGI] HTTP Post CC: sxk1969 at hotmail.com; fastcgi-developers at mailman.fastcgi.com Rob has said it all. The cgicc library is designed to do just that. As he's also said there are lots of examples available. The best example of a complete and working fastcgi program I've found is the NCBI toolkit, ftp://ftp.ncbi.nih.gov/toolbox/ On Wed, Oct 22, 2008 at 10:34 AM, Rob wrote: Instead of parsing the query string, you'll have to parse the POST data on the stdin stream. This is standard CGI stuff. FastCGI doesn't make it any harder or any easier. I'm sure you can google piles of CGI examples that parse form data from stdin. _________________________________________________________________ Store, manage and share up to 5GB with Windows Live SkyDrive. http://skydrive.live.com/welcome.aspx?provision=1?ocid=TXT_TAGLM_WL_skydrive_102008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From shruthidipali at gmail.com Thu Oct 23 08:38:55 2008 From: shruthidipali at gmail.com (Shruthi Dipali) Date: Thu, 23 Oct 2008 18:08:55 +0530 Subject: [FASTCGI] Connection status Message-ID: Hi, I'm implementing a scenario in which I'm starting up tomcat using a fastcgi application. I use a queue to stack up requests which gets served by a threadpool in the application that forwards the request to tomcat. I have a problem when it comes to handling timeout conditions. What's happening is that mod_fastcgi times out the request when it doesn't get a response from tomcat. I need a way of checking if the request that is queued is already timed out before forwarding the request to tomcat. I looked around a bit and didn't find a way to do this. Any ideas on this anyone? From jsprenkle at gmail.com Thu Oct 23 09:05:58 2008 From: jsprenkle at gmail.com (Jay Sprenkle) Date: Thu, 23 Oct 2008 08:05:58 -0500 Subject: [FASTCGI] Connection status In-Reply-To: References: Message-ID: <1b5f39a10810230605sf792fd6s55c9123037994822@mail.gmail.com> On Thu, Oct 23, 2008 at 7:38 AM, Shruthi Dipali wrote: > > I need a > way of checking if the request that is queued is already timed out > before forwarding the request > to tomcat. I've been looking at that same code to try to detect when there are pending requests so I can intelligently schedule maintenance tasks. I don't think mod_fastcgi, or any existing fastcgi library, have any monitoring for that condition. Generally with fastcgi you process requests so quickly it seldom happens. If it does it's more trouble to detect it and abort the request than it is to ignore it and let the results go to the bit bucket. -------------- next part -------------- An HTML attachment was scrubbed... URL: From shruthidipali at gmail.com Thu Oct 23 09:17:35 2008 From: shruthidipali at gmail.com (Shruthi Dipali) Date: Thu, 23 Oct 2008 18:47:35 +0530 Subject: [FASTCGI] Connection status In-Reply-To: <1b5f39a10810230605sf792fd6s55c9123037994822@mail.gmail.com> References: <1b5f39a10810230605sf792fd6s55c9123037994822@mail.gmail.com> Message-ID: > Generally with fastcgi you process requests > so > quickly it seldom happens. If it does it's more trouble to detect it > and abort the request than it is to ignore it and let the results go > to the bit bucket. Hey Jay, Thanks for your response. What you say makes perfect sense. But this issue needs a fix. I can't quite figure out how else to do it. Regards, Shruthi On Thu, Oct 23, 2008 at 6:35 PM, Jay Sprenkle wrote: > > > On Thu, Oct 23, 2008 at 7:38 AM, Shruthi Dipali > wrote: >> >> I need a >> way of checking if the request that is queued is already timed out >> before forwarding the request >> to tomcat. > > I've been looking at that same code to try to detect when there are > pending requests so I can intelligently schedule maintenance tasks. > > I don't think mod_fastcgi, or any existing fastcgi library, have any > monitoring for that condition. Generally with fastcgi you process requests > so > quickly it seldom happens. If it does it's more trouble to detect it > and abort the request than it is to ignore it and let the results go > to the bit bucket. > From davidb at pins.net Thu Oct 23 10:02:56 2008 From: davidb at pins.net (David Birnbaum) Date: Thu, 23 Oct 2008 10:02:56 -0400 (EDT) Subject: [FASTCGI] Connection status In-Reply-To: References: <1b5f39a10810230605sf792fd6s55c9123037994822@mail.gmail.com> Message-ID: The FastCGI protocol doesn't include anything about queue; you could check (via system call, I would think) to see if anything is actually queued up before dropping into the accept() if you were writing your own code. Or, you could do what we do and automatically try to run maintenance code after you finish the request and going back into the accept(). On the httpd side, there's no way for a given child/thread to see what other children/threads are doing (in terms of requests). Apache does have a scoreboard, so you could write your own code to see what's in the scoreboard before processing a request, but that would require access to that API (either directly if you're on the same machine, or via a /server-status type request handled by the relevant Apache module). Not trivial, no matter how you slice it. If your FastCGI requests aren't fast, they probably shouldn't be running via FastCGI and should instead be broken out to run via CGI instead. FastCGI is optimized for speed of the return request. David. ----- On Thu, 23 Oct 2008, Shruthi Dipali wrote: >> Generally with fastcgi you process requests >> so >> quickly it seldom happens. If it does it's more trouble to detect it >> and abort the request than it is to ignore it and let the results go >> to the bit bucket. > > Hey Jay, > > Thanks for your response. > > What you say makes perfect sense. But this issue needs a fix. I can't > quite figure out > how else to do it. > > Regards, > Shruthi > > On Thu, Oct 23, 2008 at 6:35 PM, Jay Sprenkle wrote: >> >> >> On Thu, Oct 23, 2008 at 7:38 AM, Shruthi Dipali >> wrote: >>> >>> I need a >>> way of checking if the request that is queued is already timed out >>> before forwarding the request >>> to tomcat. >> >> I've been looking at that same code to try to detect when there are >> pending requests so I can intelligently schedule maintenance tasks. >> >> I don't think mod_fastcgi, or any existing fastcgi library, have any >> monitoring for that condition. Generally with fastcgi you process requests >> so >> quickly it seldom happens. If it does it's more trouble to detect it >> and abort the request than it is to ignore it and let the results go >> to the bit bucket. >> > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers at mailman.fastcgi.com > http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers > From agalkin at audible.com Thu Oct 23 11:38:33 2008 From: agalkin at audible.com (Alexander Galkin (Audible US)) Date: Thu, 23 Oct 2008 11:38:33 -0400 Subject: [FASTCGI] FastCGI performance Message-ID: <8AD089992055F0408126B89B3E407B6706DE9E3D@EXVS02.HESungard.local> I am trying to access FastCGI framework performance on Apache server on Solaris 10 and I would like if an expert would answer the following questions: 1. What's relative overhead of implementing request handler as FastCGI module vs. Apache module? There is communication part involved between mod_fastcgi and FastCGI app so I wonder what overhead does it bring. I am specifically interested in impact on transfer speed between client and server. 2. Does FastCGI framework implement any sort of buffering? If my request handler in FastCGI app writes a lot of data by small chunks do I have to implement buffering myself to cache data and send it in one call or the framework does this already? I know FastCGI framework wraps data into packet so if no caching it implemented this may cause performance hit, I guess. 3. Finally, I understand that mod_fastcgi and FastCGI app communicate using TCP/IP. Is there any other fast IPC protocol on Solaris that can be used instead? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jsprenkle at gmail.com Thu Oct 23 21:34:24 2008 From: jsprenkle at gmail.com (Jay Sprenkle) Date: Thu, 23 Oct 2008 20:34:24 -0500 Subject: [FASTCGI] FastCGI performance In-Reply-To: <8AD089992055F0408126B89B3E407B6706DE9E3D@EXVS02.HESungard.local> References: <8AD089992055F0408126B89B3E407B6706DE9E3D@EXVS02.HESungard.local> Message-ID: <1b5f39a10810231834j6a80174aqcdd6ab020a0c5333@mail.gmail.com> > > Does FastCGI framework implement any sort of buffering? If my > request handler in FastCGI app writes a lot of data by small chunks do I > have to implement buffering myself to cache data and send it in one call or > the framework does this already? I know FastCGI framework wraps data into > packet so if no caching it implemented this may cause performance hit, I > guess. > > The connection between the fastcgi app and the web server can be via tcp or named pipes. Generally those are buffered by the operating system so your fastcgi application doesn't buffer them. You should probably performance test buffering data and delivering it in one large lump to see if it's faster than letting the operating system do it. Since you probably want to use named pipes if you want speed then my guess would be it's probably about the same either way. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jsprenkle at gmail.com Thu Oct 23 21:37:41 2008 From: jsprenkle at gmail.com (Jay Sprenkle) Date: Thu, 23 Oct 2008 20:37:41 -0500 Subject: [FASTCGI] Connection status In-Reply-To: References: <1b5f39a10810230605sf792fd6s55c9123037994822@mail.gmail.com> Message-ID: <1b5f39a10810231837i2585bd23h7d56869d24c5ca94@mail.gmail.com> Thanks David, that was interesting. It occurred to me I didn't know for sure if a browser to web server connection was tcp or udp... If it's udp then even the web server won't know if the browser actually disconnected. If it's tcp it might be a while before the web server connection notices the tcp packets aren't being acknowledged. It's either going to be very slow, or impossible.... I'll have to check that. On Thu, Oct 23, 2008 at 9:02 AM, David Birnbaum wrote: > The FastCGI protocol doesn't include anything about queue; you could check > (via system call, I would think) to see if anything is actually queued up > before dropping into the accept() if you were writing your own code. Or, > you could do what we do and automatically try to run maintenance code after > you finish the request and going back into the accept(). > > On the httpd side, there's no way for a given child/thread to see what > other children/threads are doing (in terms of requests). Apache does have a > scoreboard, so you could write your own code to see what's in the scoreboard > before processing a request, but that would require access to that API > (either directly if you're on the same machine, or via a /server-status type > request handled by the relevant Apache module). > > Not trivial, no matter how you slice it. If your FastCGI requests aren't > fast, they probably shouldn't be running via FastCGI and should instead be > broken out to run via CGI instead. FastCGI is optimized for speed of the > return request. > > David. > > ----- > > > On Thu, 23 Oct 2008, Shruthi Dipali wrote: > > Generally with fastcgi you process requests >>> so >>> quickly it seldom happens. If it does it's more trouble to detect it >>> and abort the request than it is to ignore it and let the results go >>> to the bit bucket. >>> >> >> Hey Jay, >> >> Thanks for your response. >> >> What you say makes perfect sense. But this issue needs a fix. I can't >> quite figure out >> how else to do it. >> >> Regards, >> Shruthi >> >> On Thu, Oct 23, 2008 at 6:35 PM, Jay Sprenkle >> wrote: >> >>> >>> >>> On Thu, Oct 23, 2008 at 7:38 AM, Shruthi Dipali >> > >>> wrote: >>> >>>> >>>> I need a >>>> way of checking if the request that is queued is already timed out >>>> before forwarding the request >>>> to tomcat. >>>> >>> >>> I've been looking at that same code to try to detect when there are >>> pending requests so I can intelligently schedule maintenance tasks. >>> >>> I don't think mod_fastcgi, or any existing fastcgi library, have any >>> monitoring for that condition. Generally with fastcgi you process >>> requests >>> so >>> quickly it seldom happens. If it does it's more trouble to detect it >>> and abort the request than it is to ignore it and let the results go >>> to the bit bucket. >>> >>> _______________________________________________ >> FastCGI-developers mailing list >> FastCGI-developers at mailman.fastcgi.com >> http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers >> >> -- -- The PixAddixImage Collector suite: http://groups-beta.google.com/group/pixaddix SqliteImporter and SqliteReplicator: Command line utilities for Sqlite http://www.reddawn.net/~jsprenkl/Sqlite Cthulhu Bucks! http://www.cthulhubucks.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From theprisonerofzenda at gmail.com Mon Oct 27 18:29:42 2008 From: theprisonerofzenda at gmail.com (Ahmed Medhat) Date: Tue, 28 Oct 2008 00:29:42 +0200 Subject: [FASTCGI] Being hit by "FastCGI request processing timed out" Message-ID: <221469d10810271529v1bbb1076p290eca6b478e075a@mail.gmail.com> Hello, I am being hit by lots of this line... [Mon Oct 27 18:23:50 2008] [info] [client xxx.xxx.xxx.xxx] FastCGI request processing timed out As well as a CPU load increasing, Below is my environment information... Apache 1.3.41 mod_fastcgi-2.4.6 running FastCgiExternalServer with suexec wrapper for each user connecting through a unix socket [Apache configuration] KeepAlive On MaxKeepAliveRequests 256 KeepAliveTimeout 4 MinSpareServers 96 MaxSpareServers 128 StartServers 96 MaxClients 768 MaxRequestsPerChild 400 Timeout 32 Hope I could have given as much information as possible. -- Thanks in Advance From bigbanage at naver.com Wed Oct 29 03:05:44 2008 From: bigbanage at naver.com (=?US-ASCII?B?T3JhIE1vbQ==?=) Date: Wed, 29 Oct 2008 16:05:44 +0900 Subject: [FASTCGI] FASTCGI 500 error occurring problem. Message-ID: Hello. I'm using mod_fastcgi and the cgi program coded with C language. Apache version = 1.3.27. some times, the 500 error occurred and logged message like "FastCGI: incomplete headers (0 bytes) received from server" on the apache error log. first, my app's sudo code is like below. //test.c .... int isProcessing = RUN_PROCESSING static void quit( int signo ) { isProcessing = STOP_PROCESSING; freeResources(); exit(0); } int main () { /* for signal handling */ signal( SIGPIPE, SIG_IGN ); signal( SIGQUIT, quit ); signal( SIGUSR1, quit ); signal( SIGTERM, quit ); while(FCGI_Accept() >= 0) { if(isProcessing == STOP_PROCESSING) break; accessDbAndProcsessing(); show_result(); FCGI_Finish(); freeResources(); } freeResouces(); return 0; } This application some times take some long times about 7-8sec above. The mod_fastcgi initiallization command is like below. FastCgiIpcDir /usr/local/apache/tmp/fcgi FastCgiConfig -initial -restart -maxClassProcesses 20 -maxProcesses 180 -startDelay 5 -killInterval 600 I found that the error occurred whenever the fastcgi process manager do the dynamic process kill policy. (in my setting, every 10min). And I also found that, the processManager send SIGTERM to the fastcgi APP with each dynamic process killing. And then my app receive the SIGTERM and on the signal handler, quit(), it shutdown current process immediately. so I modified the quit() to just setting the valuable isProcessing to STOP_PROCESSING and in the loop, if the valuable is STOP_PROCESSING then break the loop and close. because if current my app is processing something then for exit after complete current processing. static void quit( int signo ) { isProcessing = STOP_PROCESSING; //freeResources(); //exit(0); } but the modification didn't work. the processManager still send SIGTERM when killing unneeded dynamic process and do in the code quit() but can not exit the loop. so the process can not be closed. Please give me some advice about this. And I want to know why the FastCGI Process Manager send SIGTERM to kill the process while the process is running. Can the PM send the SIGTERM when the fcgi program waiting request only not processing? Thank you very much. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jsprenkle at gmail.com Wed Oct 29 08:39:06 2008 From: jsprenkle at gmail.com (Jay Sprenkle) Date: Wed, 29 Oct 2008 07:39:06 -0500 Subject: [FASTCGI] FASTCGI 500 error occurring problem. In-Reply-To: References: Message-ID: <1b5f39a10810290539m162e4eaai58e09d0804d582b3@mail.gmail.com> On Wed, Oct 29, 2008 at 2:05 AM, Ora Mom wrote: > > > > so I modified the quit() to just setting the valuable isProcessing to > STOP_PROCESSING and in the loop, if the valuable is STOP_PROCESSING then > break the loop and close. because if current my app is processing something > then for exit after complete current processing. > > That's a very good idea. You just need to make one change. remove these two lines from the quit function: freeResources(); exit(0); It should record that a signal has been caught then when the current request is finished it will stop. The signal itself should not cause the program to exit immediately. -------------- next part -------------- An HTML attachment was scrubbed... URL: