From sauda.furkhana at wipro.com Wed Sep 2 01:48:09 2009 From: sauda.furkhana at wipro.com (sauda.furkhana at wipro.com) Date: Wed, 2 Sep 2009 11:18:09 +0530 Subject: [FASTCGI] Apache 2.2.13 Server on Windows + FastCGI Message-ID: Hi, I have Apache 2.2.13 installed on Windows XP. It works on port 8080. 1) I have configured Apache to support FastCGI module (mod_fastcgi-2.4.6-AP22.dll) as well, by downloading it from http://fastcgi.com/dist. I have placed the module in "modules" directory of Apache. 2) I have built a standalone FastCGI application "check.exe". This required libfcgi.dll which I created using source files in .tar (fcgi-2.4.0.tar.gz) provided at http://fastcgi.com/dist. 3) I placed the executable in cgi-bin folder. 4) Now when I access it using http://localhost:8080/cgi-bin/check - I get "Internal Server Error". Please see error.log attached here for more details. Please reply what is going wrong!! I'm stuck up with this for quite a long time by now!!! Any response to this will be of GREAT help!!! Thanks in advance! Here are the details: =============== I) Apache configuration: LoadModule fastcgi_module modules/mod_fastcgi.dll SetHandler fastcgi-script Options +ExecCGI AddHandler fastcgi-script .exe II) Code in the application: #include "fcgi_stdio.h" #include "fcgiapp.h" #include #include "stdafx.h" extern "C" _declspec (dllimport) int FCGI_Accept(void); int main(int argc, char* argv[]) { int count = 0; while (FCGI_Accept() >= 0) { printf("Content-type: text/html\r\n" "\r\n" "FastCGI Hello! (C, fcgi_stdio library)" "

FastCGI Hello! (C, fcgi_stdio library)

" "Request number %d running on host %s\n", ++count, getenv("SERVER_HOSTNAME")); printf("Hello World!\n"); printf("Hello FCGI!\n"); printf("Hello ALEX!\n"); } return 0; } III) Error.log in Apache: [Wed Sep 02 10:30:29 2009] [notice] Apache/2.2.13 (Win32) mod_fastcgi/2.4.6 configured -- resuming normal operations [Wed Sep 02 10:30:29 2009] [notice] Server built: Aug 6 2009 15:50:50 [Wed Sep 02 10:30:29 2009] [notice] Parent: Created child process 2900 Apache server shutdown initiated... Child 2900: Child process is running [Wed Sep 02 10:30:29 2009] [notice] Child 2900: Acquired the start mutex. [Wed Sep 02 10:30:29 2009] [notice] Child 2900: Starting 64 worker threads. [Wed Sep 02 10:30:29 2009] [notice] FastCGI: process manager initialized [Wed Sep 02 10:30:29 2009] [notice] Child 2900: Starting thread to listen on port 8080. [Wed Sep 02 10:30:36 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" started (pid 3968) [Wed Sep 02 10:30:36 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" (pid 3968) terminated with exit with status '0' [Wed Sep 02 10:30:41 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" restarted (pid 2592) [Wed Sep 02 10:30:41 2009] [error] [client 127.0.0.1] (OS 109)The pipe has been ended. : FastCGI: comm with server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" aborted: GetOverlappedResult() failed [Wed Sep 02 10:30:41 2009] [error] [client 127.0.0.1] FastCGI: incomplete headers (0 bytes) received from server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" [Wed Sep 02 10:30:41 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" (pid 2592) terminated with exit with status '0' [Wed Sep 02 10:30:46 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" restarted (pid 2496) [Wed Sep 02 10:30:46 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" (pid 2496) terminated with exit with status '0' [Wed Sep 02 10:30:51 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" restarted (pid 1344) [Wed Sep 02 10:30:51 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" (pid 1344) terminated with exit with status '0' [Wed Sep 02 10:30:56 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" restarted (pid 980) [Wed Sep 02 10:30:56 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" (pid 980) terminated with exit with status '0' [Wed Sep 02 10:31:01 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" restarted (pid 196) [Wed Sep 02 10:31:01 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" (pid 196) terminated with exit with status '0' [Wed Sep 02 10:31:02 2009] [notice] Parent: Received shutdown signal -- Shutting down the server. [Wed Sep 02 10:31:02 2009] [notice] Child 2900: Exit event signaled. Child process is ending. [Wed Sep 02 10:31:03 2009] [notice] Child 2900: Released the start mutex [Wed Sep 02 10:31:04 2009] [notice] Child 2900: All worker threads have exited. [Wed Sep 02 10:31:05 2009] [notice] Child 2900: Child process is exiting [Wed Sep 02 10:31:05 2009] [notice] Parent: Child process exited successfully. Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdhawes at gmail.com Wed Sep 2 03:47:38 2009 From: wdhawes at gmail.com (Will Hawes) Date: Wed, 2 Sep 2009 08:47:38 +0100 Subject: [FASTCGI] Apache 2.2.13 Server on Windows + FastCGI In-Reply-To: References: Message-ID: <360eac500909020047v2bee5323w8c67ac65295e2a6f@mail.gmail.com> 2009/9/2 : > 1) I have configured Apache to support FastCGI module > (mod_fastcgi-2.4.6-AP22.dll) as well, by downloading it > from http://fastcgi.com/dist. That version of the mod_fastcgi dll is known not to always play nicely with Apache 2.2 on Windows. Try this more recent one instead: http://dev.catalyst.perl.org/wiki/deployment/apache_fastcgi_win32#Install_Apache_FastCGI_module From Gordon.Boorman at microfocus.com Wed Sep 2 10:40:14 2009 From: Gordon.Boorman at microfocus.com (Gordon Boorman) Date: Wed, 2 Sep 2009 07:40:14 -0700 Subject: [FASTCGI] e: Apache 2.2.13 Server on Windows + FastCGI In-Reply-To: References: Message-ID: <81F42F63D5BB344ABF294F8E80990C79097632@MTV-EXCHANGE.microfocus.com> Hi, You can see in the log that that mod_fastcgi is trying to start your fcgi process but it is not starting. Why do you have an MFC header file and a declspec import in your process code? Why don't you start with one of the examples and then modify it after you get things working? I recommend you start with the c++ example and then modify it later if you want to link in MFC code with it. -Gordon Boorman -----Original Message----- From: fastcgi-developers-bounces+gordon.boorman=microfocus.com at mailman.pins.ne t [mailto:fastcgi-developers-bounces+gordon.boorman=microfocus.com at mailman .pins.net] On Behalf Of fastcgi-developers-request at mailman.pins.net Sent: Wednesday, September 02, 2009 12:48 AM To: fastcgi-developers at mailman.pins.net Subject: FastCGI-developers Digest, Vol 14, Issue 1 Send FastCGI-developers mailing list submissions to fastcgi-developers at mailman.fastcgi.com To subscribe or unsubscribe via the World Wide Web, visit http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers or, via email, send a message with subject or body 'help' to fastcgi-developers-request at mailman.fastcgi.com You can reach the person managing the list at fastcgi-developers-owner at mailman.fastcgi.com When replying, please edit your Subject line so it is more specific than "Re: Contents of FastCGI-developers digest..." Today's Topics: 1. Apache 2.2.13 Server on Windows + FastCGI (sauda.furkhana at wipro.com) 2. Re: Apache 2.2.13 Server on Windows + FastCGI (Will Hawes) ---------------------------------------------------------------------- Message: 1 Date: Wed, 2 Sep 2009 11:18:09 +0530 From: Subject: [FASTCGI] Apache 2.2.13 Server on Windows + FastCGI To: Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi, I have Apache 2.2.13 installed on Windows XP. It works on port 8080. 1) I have configured Apache to support FastCGI module (mod_fastcgi-2.4.6-AP22.dll) as well, by downloading it from http://fastcgi.com/dist. I have placed the module in "modules" directory of Apache. 2) I have built a standalone FastCGI application "check.exe". This required libfcgi.dll which I created using source files in .tar (fcgi-2.4.0.tar.gz) provided at http://fastcgi.com/dist. 3) I placed the executable in cgi-bin folder. 4) Now when I access it using http://localhost:8080/cgi-bin/check - I get "Internal Server Error". Please see error.log attached here for more details. Please reply what is going wrong!! I'm stuck up with this for quite a long time by now!!! Any response to this will be of GREAT help!!! Thanks in advance! Here are the details: =============== I) Apache configuration: LoadModule fastcgi_module modules/mod_fastcgi.dll SetHandler fastcgi-script Options +ExecCGI AddHandler fastcgi-script .exe II) Code in the application: #include "fcgi_stdio.h" #include "fcgiapp.h" #include #include "stdafx.h" extern "C" _declspec (dllimport) int FCGI_Accept(void); int main(int argc, char* argv[]) { int count = 0; while (FCGI_Accept() >= 0) { printf("Content-type: text/html\r\n" "\r\n" "FastCGI Hello! (C, fcgi_stdio library)" "

FastCGI Hello! (C, fcgi_stdio library)

" "Request number %d running on host %s\n", ++count, getenv("SERVER_HOSTNAME")); printf("Hello World!\n"); printf("Hello FCGI!\n"); printf("Hello ALEX!\n"); } return 0; } III) Error.log in Apache: [Wed Sep 02 10:30:29 2009] [notice] Apache/2.2.13 (Win32) mod_fastcgi/2.4.6 configured -- resuming normal operations [Wed Sep 02 10:30:29 2009] [notice] Server built: Aug 6 2009 15:50:50 [Wed Sep 02 10:30:29 2009] [notice] Parent: Created child process 2900 Apache server shutdown initiated... Child 2900: Child process is running [Wed Sep 02 10:30:29 2009] [notice] Child 2900: Acquired the start mutex. [Wed Sep 02 10:30:29 2009] [notice] Child 2900: Starting 64 worker threads. [Wed Sep 02 10:30:29 2009] [notice] FastCGI: process manager initialized [Wed Sep 02 10:30:29 2009] [notice] Child 2900: Starting thread to listen on port 8080. [Wed Sep 02 10:30:36 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" started (pid 3968) [Wed Sep 02 10:30:36 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" (pid 3968) terminated with exit with status '0' [Wed Sep 02 10:30:41 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" restarted (pid 2592) [Wed Sep 02 10:30:41 2009] [error] [client 127.0.0.1] (OS 109)The pipe has been ended. : FastCGI: comm with server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" aborted: GetOverlappedResult() failed [Wed Sep 02 10:30:41 2009] [error] [client 127.0.0.1] FastCGI: incomplete headers (0 bytes) received from server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" [Wed Sep 02 10:30:41 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" (pid 2592) terminated with exit with status '0' [Wed Sep 02 10:30:46 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" restarted (pid 2496) [Wed Sep 02 10:30:46 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" (pid 2496) terminated with exit with status '0' [Wed Sep 02 10:30:51 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" restarted (pid 1344) [Wed Sep 02 10:30:51 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" (pid 1344) terminated with exit with status '0' [Wed Sep 02 10:30:56 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" restarted (pid 980) [Wed Sep 02 10:30:56 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" (pid 980) terminated with exit with status '0' [Wed Sep 02 10:31:01 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" restarted (pid 196) [Wed Sep 02 10:31:01 2009] [warn] FastCGI: (dynamic) server "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" (pid 196) terminated with exit with status '0' [Wed Sep 02 10:31:02 2009] [notice] Parent: Received shutdown signal -- Shutting down the server. [Wed Sep 02 10:31:02 2009] [notice] Child 2900: Exit event signaled. Child process is ending. [Wed Sep 02 10:31:03 2009] [notice] Child 2900: Released the start mutex [Wed Sep 02 10:31:04 2009] [notice] Child 2900: All worker threads have exited. [Wed Sep 02 10:31:05 2009] [notice] Child 2900: Child process is exiting [Wed Sep 02 10:31:05 2009] [notice] Parent: Child process exited successfully. Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 2 Date: Wed, 2 Sep 2009 08:47:38 +0100 From: Will Hawes Subject: Re: [FASTCGI] Apache 2.2.13 Server on Windows + FastCGI To: fastcgi-developers at mailman.fastcgi.com Message-ID: <360eac500909020047v2bee5323w8c67ac65295e2a6f at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 2009/9/2 : > 1) I have configured Apache to support FastCGI module > (mod_fastcgi-2.4.6-AP22.dll) as well, by downloading it > from http://fastcgi.com/dist. That version of the mod_fastcgi dll is known not to always play nicely with Apache 2.2 on Windows. Try this more recent one instead: http://dev.catalyst.perl.org/wiki/deployment/apache_fastcgi_win32#Instal l_Apache_FastCGI_module ------------------------------ _______________________________________________ FastCGI-developers mailing list FastCGI-developers at mailman.fastcgi.com http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers End of FastCGI-developers Digest, Vol 14, Issue 1 ************************************************* This message has been scanned for viruses by MailController - www.MailController.altohiway.com Please consider the environment before printing this e-mail. From Paul.Connolly at colonialfirststate.com.au Wed Sep 2 18:46:42 2009 From: Paul.Connolly at colonialfirststate.com.au (Connolly, Paul) Date: Thu, 3 Sep 2009 08:46:42 +1000 Subject: [FASTCGI] Problem getting FCGI process to run in FCGI mode on Apache 2.2 Message-ID: <37D58DD23638AE49898441E314A4407C04C1FEEC@sahara.avanteos.com.au> Hello, We have been using FCGI for a long time now (10+ years) under Apache 1.3.x on Windows, and would like to upgrade to Apache 2.2.x. Using mod_fascgi_2.4.6 with the pre-compiled binary apache module, I am finding the processes do not start properly in FCGI mode. Sticking log messages in the code lead me to the following location in os_win32.c /* * Determine if this library is being used to listen for FastCGI * connections. This is communicated by STDIN containing a * valid handle to a listener object. In this case, both the * "stdout" and "stderr" handles will be INVALID (ie. closed) by * the starting process. * * The trick is determining if this is a pipe or a socket... * * XXX: Add the async accept test to determine socket or handle to a * pipe!!! */ if((GetStdHandle(STD_OUTPUT_HANDLE) == INVALID_HANDLE_VALUE) && (GetStdHandle(STD_ERROR_HANDLE) == INVALID_HANDLE_VALUE) && (GetStdHandle(STD_INPUT_HANDLE) != INVALID_HANDLE_VALUE) ) { As far as I can tell, this test should succeed if the process was started by the FCGI process manager. However, the stdout and stderr tests both fail, therefore the library thinks it is running in plain CGI mode, runs through once immediately, and terminates. If I remove the stdout and stderr tests, the process starts and operates correctly as a FCGI process listening on the port I specified in httpd.conf, but then it doesn't run correctly in plain CGI mode. Does anyone have any suggestions as to what I could try/do? Thanks, Paul Connolly Senior Manager, Solution Architecture Colonial First State Custom Solutions Level 1, 105 Camberwell Road, Hawthorn East VIC 3123 Direct 61 3 9805 5124 | Fax 61 3 9813 4182 | Mobile 0413 335 754 paul.connolly at colonialfirststate.com.au Australia's best full service platform1 Please consider the environment before you print this email. Colonial First State Custom Solutions is the registered business name of Avanteos Investments Limited ABN 20 096 259 979 AFSL 245531 (AIL). AIL is the trustee of the Avanteos Superannuation Trust ABN 38 876 896 681 and the Symetry Personal Retirement Fund ABN 24 685 968 122. The information contained in or attached to this message is intended only for the people it is addressed to. If you are not the intended recipient, any use, disclosure or copying of this information is unauthorised and prohibited. This information may be confidential or subject to legal privilege. It is not the expressed view of the Commonwealth Bank of Australia ABN 48 123 123 124 or any of its subsidiaries, including AIL, unless that is clearly stated. Commonwealth Bank of Australia or its subsidiaries cannot accept liability for any virus damage caused by this message. 1The Colonial First State Custom Solutions platform operated by AIL (previously known as the Avanteos platform) has been ranked best full service platform in the Investment Trends Platform Report 2008, 2007, 2006. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 3688 bytes Desc: image001.gif URL: From sauda.furkhana at wipro.com Wed Sep 2 23:19:39 2009 From: sauda.furkhana at wipro.com (sauda.furkhana at wipro.com) Date: Thu, 3 Sep 2009 08:49:39 +0530 Subject: [FASTCGI] Apache 2.2.13 Server on Windows + FastCGI Message-ID: HI, I could finally get Apache working with my sample code mentioned here. Thanks, Will Hawes - for sharing the latest dll with me!! Now when I deploy one of my other applications there seems to be problem in the way environment variables are read in FastCGI. Basically, I'm converting a CGI application of mine to FastCGI. And the code which has getenv()'s does not work as expected in FastCGI. For example, If the URL is http://localhost:8080/cgi-bin/ALEXwin/alex?ac=toolbar QUERY_STRING in CGI retrieves "ac=toolbar" where in FastCGI retrieves as (NULL) SCRIPT NAME in CGI retrieves "/cgi-bin/ALEXwin/" whereas in FastCGI retrieves as "/" I'm looking out for a solution for the same; may be I will I have to modify getenv() to work inline with FastCGI. Any help would be highly appreciated!! Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From sauda.furkhana at wipro.com Wed Sep 2 23:28:22 2009 From: sauda.furkhana at wipro.com (sauda.furkhana at wipro.com) Date: Thu, 3 Sep 2009 08:58:22 +0530 Subject: [FASTCGI] Problem getting FCGI process to run in FCGI mode on Message-ID: Hi Paul, I'm a novice to FastCGI as compared to your experience:-). Even I had problems while using mod_fascgi_2.4.6.dll on Apache 2.2.13. Please try using the dll mentioned in http://www.fastcgi.com/archives/fastcgi-developers/2009-September/000337 .html. Though the problems faced by you and me are completely disjoint, but still thought of sharing it with you! Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Paul.Connolly at colonialfirststate.com.au Wed Sep 2 23:42:24 2009 From: Paul.Connolly at colonialfirststate.com.au (Connolly, Paul) Date: Thu, 3 Sep 2009 13:42:24 +1000 Subject: [FASTCGI] Problem getting FCGI process to run in FCGI mode on References: Message-ID: <37D58DD23638AE49898441E314A4407C04C1FEF6@sahara.avanteos.com.au> Hi, This is now working with the dll linked to in that post. Thank-you very much for your help, much appreciated. Paul _____ From: fastcgi-developers-bounces+paul.connolly=colonialfirststate.com.au at mailm an.fastcgi.com [mailto:fastcgi-developers-bounces+paul.connolly=colonialfirststate.com. au at mailman.fastcgi.com] On Behalf Of sauda.furkhana at wipro.com Sent: Thursday, 3 September 2009 13:28 To: fastcgi-developers at mailman.fastcgi.com Subject: Re: [FASTCGI] Problem getting FCGI process to run in FCGI mode on Hi Paul, I'm a novice to FastCGI as compared to your experience:-). Even I had problems while using mod_fascgi_2.4.6.dll on Apache 2.2.13. Please try using the dll mentioned in http://www.fastcgi.com/archives/fastcgi-developers/2009-September/000337 .html. Though the problems faced by you and me are completely disjoint, but still thought of sharing it with you! Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com Colonial First State Custom Solutions is the registered business name of Avanteos Investments Limited ABN 20 096 259 979 AFSL 245531 (AIL). AIL is the trustee of the Avanteos Superannuation Trust ABN 38 876 896 681 and the Symetry Personal Retirement Fund ABN 24 685 968 122. The information contained in or attached to this message is intended only for the people it is addressed to. If you are not the intended recipient, any use, disclosure or copying of this information is unauthorised and prohibited. This information may be confidential or subject to legal privilege. It is not the expressed view of the Commonwealth Bank of Australia ABN 48 123 123 124 or any of its subsidiaries, including AIL, unless that is clearly stated. Commonwealth Bank of Australia or its subsidiaries cannot accept liability for any virus damage caused by this message. 1The Colonial First State Custom Solutions platform operated by AIL (previously known as the Avanteos platform) has been ranked best full service platform in the Investment Trends Platform Report 2008, 2007, 2006. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdhawes at gmail.com Thu Sep 3 04:32:45 2009 From: wdhawes at gmail.com (Will Hawes) Date: Thu, 3 Sep 2009 09:32:45 +0100 Subject: [FASTCGI] Problem getting FCGI process to run in FCGI mode on In-Reply-To: <37D58DD23638AE49898441E314A4407C04C1FEF6@sahara.avanteos.com.au> References: <37D58DD23638AE49898441E314A4407C04C1FEF6@sahara.avanteos.com.au> Message-ID: <360eac500909030132k5dfbdfaei4b6c44d651e952ae@mail.gmail.com> 2009/9/3 Connolly, Paul : > Hi, > This is now working with the dll linked to in that post.  Thank-you very > much for your help, much appreciated. This appears to be a common enough issue on Win32 Apache to be documented properly somewhere on the FastCGI site - any chance someone with the relevant permissions could add it please? You'd be doing your Windows users a big favour. From panter at gmx.de Thu Sep 3 09:49:04 2009 From: panter at gmx.de (panter at gmx.de) Date: Thu, 03 Sep 2009 15:49:04 +0200 Subject: [FASTCGI] Apache 2.2.13 Server on Windows + FastCGI In-Reply-To: References: Message-ID: <20090903134904.29410@gmx.net> did this to get getenv working on windows for fcgi: while(FCGX_Accept( &FCGI_stdin->fcgx_stream, &FCGI_stdout->fcgx_stream, &FCGI_stderr->fcgx_stream, &environ ) >= 0) instead of while(FCGI_Accept() >= 0) -------- Original-Nachricht -------- > Datum: Thu, 3 Sep 2009 08:49:39 +0530 > Von: sauda.furkhana at wipro.com > An: fastcgi-developers at mailman.fastcgi.com > Betreff: [FASTCGI] Apache 2.2.13 Server on Windows + FastCGI > HI, > > > > I could finally get Apache working with my sample code mentioned here. > > > > Thanks, Will Hawes - for sharing the latest dll with me!! > > > > Now when I deploy one of my other applications there seems to be problem > in the way environment variables are read in FastCGI. > > Basically, I'm converting a CGI application of mine to FastCGI. And the > code which has getenv()'s does not work as expected in FastCGI. > > For example, > > If the URL is http://localhost:8080/cgi-bin/ALEXwin/alex?ac=toolbar > > QUERY_STRING in CGI retrieves "ac=toolbar" where in FastCGI retrieves as > (NULL) > > SCRIPT NAME in CGI retrieves "/cgi-bin/ALEXwin/" whereas in FastCGI > retrieves as "/" > > > > I'm looking out for a solution for the same; may be I will I have to > modify getenv() to work inline with FastCGI. > > > > Any help would be highly appreciated!! > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments > to this message are intended for the exclusive use of the addressee(s) and > may contain proprietary, confidential or privileged information. If you are > not the intended recipient, you should not disseminate, distribute or copy > this e-mail. Please notify the sender immediately and destroy all copies of > this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient > should check this email and any attachments for the presence of viruses. The > company accepts no liability for any damage caused by any virus transmitted > by this email. > > www.wipro.com -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser From pveerman at nemo.kabelfoon.net Fri Sep 4 16:33:56 2009 From: pveerman at nemo.kabelfoon.net (Peter Veerman) Date: Fri, 04 Sep 2009 22:33:56 +0200 Subject: [FASTCGI] apache-2.2.6, suexec, mod_fastcgi, on FreeBSD; php-fcgi processes not reused Message-ID: <4AA179B4.70703@nemo.kabelfoon.net> Hello, I have set up apache-2.2.6 + mod_fastcgi-2.4.2-1 and suexec according to the example shown at: http://blog.chty.org/post/2007/10/28/Apache2-mod_fastcgi-suexec-on-debian-etch From what I can see is that the already started php processes are never reused. For every request a new php process is spawned which causes my server to suffer under the load of the many many php processes. My config is; In httpd.conf: FastCgiIpcDir /usr/local/www/fcgi_ipc/tmp FastCgiWrapper /usr/local/sbin/suexec FastCgiConfig -killInterval 30 -idle-timeout 200 -listen-queue-depth 100 -maxClassProcesses 20 -maxProcesses 90 -multiThreshold 1 -singleThreshold 0 -restart -flush -pass-header HTTP_AUTHORIZATION In any of the vhosts: SuexecUserGroup xxx xxx ScriptAlias /php-fastcgi/ /data/hosting/xxx/php-fastcgi/ Action php-fastcgi /php-fastcgi/php5-fcgi.sh AddType application/x-httpd-php .php AddHandler php-fastcgi .php etc. in php5-fcgi.sh: #!/bin/sh #PHPRC="/usr/local/etc/php.ini" PHPRC="/hosting/xxx/php-fastcgi/php.ini" export PHPRC PHP_FCGI_CHILDREN=3 export PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=200 export PHP_FCGI_MAX_REQUESTS exec /usr/local/bin/php-cgi when the whole setup runs pstree gives; ??? 00001 root /sbin/init -- ???? 23738 root /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23739 www /usr/local/sbin/httpd -D DEFAULT_VHOST ? ???? 23767 userA /usr/local/bin/php-cgi ? ? ???? 23768 userA /usr/local/bin/php-cgi ? ? ???? 23769 userA /usr/local/bin/php-cgi ? ? ???? 23770 userA /usr/local/bin/php-cgi ? ???? 23869 userB /usr/local/bin/php-cgi ? ? ???? 23870 userB /usr/local/bin/php-cgi ? ? ???? 23871 userB /usr/local/bin/php-cgi ? ? ???? 23872 userB /usr/local/bin/php-cgi ? ???? 23959 userB /usr/local/bin/php-cgi ? ? ???? 23960 userB /usr/local/bin/php-cgi ? ? ???? 23961 userB /usr/local/bin/php-cgi ? ? ???? 23962 userB /usr/local/bin/php-cgi ? ???? 26665 userF /usr/local/bin/php-cgi ? ? ???? 26666 userF /usr/local/bin/php-cgi ? ? ???? 26667 userF /usr/local/bin/php-cgi ? ? ???? 26668 userF /usr/local/bin/php-cgi ? ???? 29711 userA /usr/local/bin/php-cgi ? ? ???? 29712 userA /usr/local/bin/php-cgi ? ? ???? 29713 userA /usr/local/bin/php-cgi ? ? ???? 29714 userA /usr/local/bin/php-cgi ? ???? 30459 userC /usr/local/bin/php-cgi ? ? ???? 30460 userC /usr/local/bin/php-cgi ? ? ???? 30461 userC /usr/local/bin/php-cgi ? ? ???? 30462 userC /usr/local/bin/php-cgi ? ???? 34297 userD /usr/local/bin/php-cgi ? ? ???? 34298 userD /usr/local/bin/php-cgi ? ? ???? 34299 userD /usr/local/bin/php-cgi ? ? ???? 34300 userD /usr/local/bin/php-cgi ? ???? 37669 userE /usr/local/bin/php-cgi ? ? ???? 37670 userE /usr/local/bin/php-cgi ? ? ???? 37671 userE /usr/local/bin/php-cgi ? ? ???? 37672 userE /usr/local/bin/php-cgi ? ???? 49464 userF /usr/local/bin/php-cgi ? ? ???? 49465 userF /usr/local/bin/php-cgi ? ? ???? 49466 userF /usr/local/bin/php-cgi ? ? ???? 49467 userF /usr/local/bin/php-cgi ? ???? 52943 userA /usr/local/bin/php-cgi ? ? ???? 52944 userA /usr/local/bin/php-cgi ? ? ???? 52945 userA /usr/local/bin/php-cgi ? ? ???? 52946 userA /usr/local/bin/php-cgi ? ???? 53089 userA /usr/local/bin/php-cgi ? ? ???? 53090 userA /usr/local/bin/php-cgi ? ? ???? 53091 userA /usr/local/bin/php-cgi ? ? ???? 53092 userA /usr/local/bin/php-cgi ? ???? 53463 userA /usr/local/bin/php-cgi ? ? ???? 53464 userA /usr/local/bin/php-cgi ? ? ???? 53465 userA /usr/local/bin/php-cgi ? ? ???? 53466 userA /usr/local/bin/php-cgi ? ???? 53489 userA /usr/local/bin/php-cgi ? ???? 53490 userA /usr/local/bin/php-cgi ? ???? 53491 userA /usr/local/bin/php-cgi ? ???? 53492 userA /usr/local/bin/php-cgi ???? 23740 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23741 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23742 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23743 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23744 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23745 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23746 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23747 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23748 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23749 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23750 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23751 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23752 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23754 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23756 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23757 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23758 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23759 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23760 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23761 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23762 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23763 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23764 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23765 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23766 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23771 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23772 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23773 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23774 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23775 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23776 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 23777 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 38113 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 38114 www /usr/local/sbin/httpd -D DEFAULT_VHOST ???? 38115 www /usr/local/sbin/httpd -D DEFAULT_VHOST regards, Peter Veerman -------------- next part -------------- An HTML attachment was scrubbed... URL: From sauda.furkhana at wipro.com Sat Sep 5 00:18:19 2009 From: sauda.furkhana at wipro.com (sauda.furkhana at wipro.com) Date: Sat, 5 Sep 2009 09:48:19 +0530 Subject: [FASTCGI] Apache 2.2.13 Server on Windows + FastCGI In-Reply-To: <20090903134904.29410@gmx.net> Message-ID: Hi Panter, I quickly tried out with your advice, this is the sample code I'm trying out with, #include "fcgi_stdio.h" #include "fcgiapp.h" #include #include "stdafx.h" extern "C" _declspec (dllimport) int FCGX_Accept(FCGX_Stream **in, FCGX_Stream **out, FCGX_Stream **err, FCGX_ParamArray *envp); int main(int argc, char* argv[]) { int count = 0; while(FCGX_Accept( &FCGI_stdin->fcgx_stream, &FCGI_stdout->fcgx_stream, &FCGI_stderr->fcgx_stream, &environ ) >= 0) { printf("Content-type: text/html\r\n" "\r\n" "FastCGI Hello! (C, fcgi_stdio library)" "

FastCGI Hello! (C, fcgi_stdio library)

" "Request number %d running on host %s\n", ++count, getenv("SERVER_HOSTNAME")); printf("Hello World!\n"); printf("Hello FCGI!\n"); printf("Hello ALEX!\n"); } return 0; } Changed FCGI_Accept to FCGX_Accept. When I execute the binary, I'm getting "Unknown listentype <0>" message as output!!! Earlier the content would get printed but server name was output as (null). What's going wrong? -----Original Message----- From: panter at gmx.de [mailto:panter at gmx.de] Sent: Thursday, September 03, 2009 7:19 PM To: Sauda Furkhana (WT01 - Telecom Equipment); fastcgi-developers at mailman.fastcgi.com Subject: Re: [FASTCGI] Apache 2.2.13 Server on Windows + FastCGI did this to get getenv working on windows for fcgi: while(FCGX_Accept( &FCGI_stdin->fcgx_stream, &FCGI_stdout->fcgx_stream, &FCGI_stderr->fcgx_stream, &environ ) >= 0) instead of while(FCGI_Accept() >= 0) -------- Original-Nachricht -------- > Datum: Thu, 3 Sep 2009 08:49:39 +0530 > Von: sauda.furkhana at wipro.com > An: fastcgi-developers at mailman.fastcgi.com > Betreff: [FASTCGI] Apache 2.2.13 Server on Windows + FastCGI > HI, > > > > I could finally get Apache working with my sample code mentioned here. > > > > Thanks, Will Hawes - for sharing the latest dll with me!! > > > > Now when I deploy one of my other applications there seems to be problem > in the way environment variables are read in FastCGI. > > Basically, I'm converting a CGI application of mine to FastCGI. And the > code which has getenv()'s does not work as expected in FastCGI. > > For example, > > If the URL is http://localhost:8080/cgi-bin/ALEXwin/alex?ac=toolbar > > QUERY_STRING in CGI retrieves "ac=toolbar" where in FastCGI retrieves as > (NULL) > > SCRIPT NAME in CGI retrieves "/cgi-bin/ALEXwin/" whereas in FastCGI > retrieves as "/" > > > > I'm looking out for a solution for the same; may be I will I have to > modify getenv() to work inline with FastCGI. > > > > Any help would be highly appreciated!! > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments > to this message are intended for the exclusive use of the addressee(s) and > may contain proprietary, confidential or privileged information. If you are > not the intended recipient, you should not disseminate, distribute or copy > this e-mail. Please notify the sender immediately and destroy all copies of > this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient > should check this email and any attachments for the presence of viruses. The > company accepts no liability for any damage caused by any virus transmitted > by this email. > > www.wipro.com -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From sauda.furkhana at wipro.com Sat Sep 5 02:58:20 2009 From: sauda.furkhana at wipro.com (sauda.furkhana at wipro.com) Date: Sat, 5 Sep 2009 12:28:20 +0530 Subject: [FASTCGI] Apache 2.2.13 Server on Windows + FastCGI In-Reply-To: <20090903134904.29410@gmx.net> Message-ID: Hi Panter, I could retrieve environment variables in my standalone application now. Thanks for letting me know that FCGX_Accept() is to be used. Here's the code for the FastCGI novice users (like me!!): #include "fcgi_stdio.h" #include "fcgiapp.h" #include #include "stdafx.h" #include extern "C" _declspec (dllimport) char *FCGX_GetParam(const char *name, char **envp); extern "C" _declspec (dllimport) int FCGX_Accept(FCGX_Stream **in, FCGX_Stream **out, FCGX_Stream **err, FCGX_ParamArray *envp); static void penv(char **envp); int main(int argc, char* argv[]) { int count = 0; char **envp = 0; while(FCGX_Accept( &FCGI_stdin->fcgx_stream, &FCGI_stdout->fcgx_stream, &FCGI_stderr->fcgx_stream, &environ ) >= 0) { printf("Content-type: text/html\r\n" "\r\n" "FastCGI Hello! (C, fcgi_stdio library)" "

FastCGI Hello! (C, fcgi_stdio library)

" "Request number %d running\n", ++count); if(environ != NULL) { char * clenstr = FCGX_GetParam("SCRIPT_NAME", environ); if(clenstr != NULL) MessageBox(NULL, clenstr, "ProcessName", MB_OK); char * clenstr1 = FCGX_GetParam("QUERY_STRING", environ); if(clenstr1 != NULL) MessageBox(NULL, clenstr1, "ProcessName", MB_OK); char * clenstr2 = FCGX_GetParam("CONTENT_LENGTH", environ); if(clenstr2 != NULL) MessageBox(NULL, clenstr2, "ProcessName", MB_OK); char * clenstr3 = FCGX_GetParam("CONTENT_TYPE", environ); if(clenstr3 != NULL) MessageBox(NULL, clenstr3, "ProcessName", MB_OK); char * clenstr4 = FCGX_GetParam("REQUEST_METHOD", environ); if(clenstr4 != NULL) MessageBox(NULL, clenstr4, "ProcessName", MB_OK); char * clenstr5 = FCGX_GetParam("SERVER_NAME", environ); if(clenstr5 != NULL) MessageBox(NULL, clenstr5, "ProcessName", MB_OK); penv(environ); } else MessageBox(NULL, "NULL string", "ProcessName", MB_OK); } printf("No more env variables\n"); return 0; } static void penv(char **envp) { MessageBox(NULL, "Reached print function", "ProcessName", MB_OK); for( ; *envp != NULL; envp++) { printf("%s\n", *envp); } } -----Original Message----- From: panter at gmx.de [mailto:panter at gmx.de] Sent: Thursday, September 03, 2009 7:19 PM To: Sauda Furkhana (WT01 - Telecom Equipment); fastcgi-developers at mailman.fastcgi.com Subject: Re: [FASTCGI] Apache 2.2.13 Server on Windows + FastCGI did this to get getenv working on windows for fcgi: while(FCGX_Accept( &FCGI_stdin->fcgx_stream, &FCGI_stdout->fcgx_stream, &FCGI_stderr->fcgx_stream, &environ ) >= 0) instead of while(FCGI_Accept() >= 0) -------- Original-Nachricht -------- > Datum: Thu, 3 Sep 2009 08:49:39 +0530 > Von: sauda.furkhana at wipro.com > An: fastcgi-developers at mailman.fastcgi.com > Betreff: [FASTCGI] Apache 2.2.13 Server on Windows + FastCGI > HI, > > > > I could finally get Apache working with my sample code mentioned here. > > > > Thanks, Will Hawes - for sharing the latest dll with me!! > > > > Now when I deploy one of my other applications there seems to be problem > in the way environment variables are read in FastCGI. > > Basically, I'm converting a CGI application of mine to FastCGI. And the > code which has getenv()'s does not work as expected in FastCGI. > > For example, > > If the URL is http://localhost:8080/cgi-bin/ALEXwin/alex?ac=toolbar > > QUERY_STRING in CGI retrieves "ac=toolbar" where in FastCGI retrieves as > (NULL) > > SCRIPT NAME in CGI retrieves "/cgi-bin/ALEXwin/" whereas in FastCGI > retrieves as "/" > > > > I'm looking out for a solution for the same; may be I will I have to > modify getenv() to work inline with FastCGI. > > > > Any help would be highly appreciated!! > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments > to this message are intended for the exclusive use of the addressee(s) and > may contain proprietary, confidential or privileged information. If you are > not the intended recipient, you should not disseminate, distribute or copy > this e-mail. Please notify the sender immediately and destroy all copies of > this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient > should check this email and any attachments for the presence of viruses. The > company accepts no liability for any damage caused by any virus transmitted > by this email. > > www.wipro.com -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From hanno at hboeck.de Sat Sep 5 03:34:57 2009 From: hanno at hboeck.de (Hanno =?utf-8?q?B=C3=B6ck?=) Date: Sat, 5 Sep 2009 09:34:57 +0200 Subject: [FASTCGI] mod_fastcgi, webpage, git and cvs Message-ID: <200909050934.58258.hanno@hboeck.de> Hi, On the webpage at http://www.fastcgi.com/drupal/node/3 there's a link to a git repository. Though it seems the git repository is not used for latest development, instead there's a cvs at http://www.fastcgi.com/cvs/ that contains the latest code. Can you please clarify where the repo for latest mod_fastcgi code lives and change the webpage accordingly? This is very confusing. cu, -- Hanno Böck Blog: http://www.hboeck.de/ GPG: 3DBD3B20 Jabber/Mail: hanno at hboeck.de http://schokokeks.org - professional webhosting -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From skimo-fastcgi at kotnet.org Sat Sep 5 03:46:48 2009 From: skimo-fastcgi at kotnet.org (Sven Verdoolaege) Date: Sat, 5 Sep 2009 09:46:48 +0200 Subject: [FASTCGI] mod_fastcgi, webpage, git and cvs In-Reply-To: <200909050934.58258.hanno@hboeck.de> References: <200909050934.58258.hanno@hboeck.de> Message-ID: <20090905074648.GJ15102@kotnet.org> On Sat, Sep 05, 2009 at 09:34:57AM +0200, Hanno Böck wrote: > Hi, > > On the webpage at > http://www.fastcgi.com/drupal/node/3 > there's a link to a git repository. Though it seems the git repository is not > used for latest development, instead there's a cvs at > http://www.fastcgi.com/cvs/ > that contains the latest code. > > Can you please clarify where the repo for latest mod_fastcgi code lives and > change the webpage accordingly? This is very confusing. I'm responsible for the git repo. Development had stagnated at some point, so I moved everything to git. Later, Rob continued working on the original cvs. If anyone knows where the actual cvs repository is located, then please let me know. skimo From m.frey at avelon-cetex.com Tue Sep 8 16:46:28 2009 From: m.frey at avelon-cetex.com (Maurus Frey) Date: Tue, 08 Sep 2009 22:46:28 +0200 Subject: [FASTCGI] A new newbie -> use a pure socket for communictaion Message-ID: <4AA6C2A4.1040209@avelon-cetex.com> Hi, I try to connect a C++ application on a embedded device to the web through fastcgi. For the first test I reused the code by E. Bareev already published on this list during August. (Thanks) Instead of using a port, I want to use a unix Socket. ...........code............ #include #include "fcgi_stdio.h" #include #include void handle(FCGX_Request request){ FCGX_FPrintF(request.out, "Content-type:text/html\r\n\r\nfastcgi\n

Fastcgi: Hello world!

\n"); } int main(int argc, char* const argv[] ) { std::string port = "/var/run/fastcgitest.socket"; int listenQueueBacklog = 400; FCGX_Stream *in, *out, *err; FCGX_ParamArray envp; if(FCGX_Init()) exit(1); int listen_socket = FCGX_OpenSocket(port.c_str(), listenQueueBacklog); if(listen_socket < 0) exit(1); FCGX_Request request; if(FCGX_InitRequest(&request, listen_socket, 0)) exit(1); int reqCounter = 0; while(FCGX_Accept_r(&request) == 0) { handle(request); reqCounter++; FCGX_FPrintF(request.out, "\n\r\n\r counter: %d", reqCounter); FCGX_Finish_r(&request); } return 0; } ...........code............ I got a 500 internal Server Error. Since this is my first fastcgi project using a socket, I don't really know the problem. The lighttpd.error log says: 2009-09-08 22:34:45: (mod_fastcgi.c.1761) connect failed: Permission denied on unix:/var/run/lighttpd/fastcgitest.socket 2009-09-08 22:34:45: (mod_fastcgi.c.2930) backend died; we'll disable it for 5 seconds and send the request to another backend instead: reconnects: 0 load: 1 2009-09-08 22:34:51: (mod_fastcgi.c.2743) fcgi-server re-enabled: unix:/var/run/lighttpd/fastcgitest.socket The lighttpd.conf looks like this: fastcgi.debug = 1 fastcgi.server = ( "/test.fcgi" => (( "socket" => "/var/run/lighttpd/fastcgitest.socket", "check-local" => "disable" )) ) If I start the fcgi-app the socket file (/var/run/lighttpd/fastcgitest.socket) will be created. The access rights are: srwxr-xr-x 1 root root 0 2009-09-08 22:34 fastcgitest.socket Lighttpd runs as root, it should be able to access the socket. What could be the problem? Thanks for your support. Maurus From m.frey at avelon-cetex.com Wed Sep 9 03:13:21 2009 From: m.frey at avelon-cetex.com (M. Frey) Date: Wed, 09 Sep 2009 09:13:21 +0200 Subject: [FASTCGI] A new newbie -> use a pure socket for communictaion In-Reply-To: <1b5f39a10909081426g10fc561ere3b57f47ab4730fb@mail.gmail.com> References: <4AA6C2A4.1040209@avelon-cetex.com> <1b5f39a10909081426g10fc561ere3b57f47ab4730fb@mail.gmail.com> Message-ID: <4AA75591.707@avelon-cetex.com> Hi Jay Thanks for your answer. And Yes, I'm working on Linux. So any Windows limitations don't affect. Let me state more precisely: In the code fragment I wrote the wrong socket path. Of course the socket path is similar to the one specified in lighttpd.conf -> /var/run/lighttpd/fastcgitest.socket It still doesn't work. And lighttpd returns "connect failed: Permission denied" Am I completely wrong trying to realize a socket connection using "fcgi_stdio.h"? Or do I have to use the "fcgio.h" header to achieve this? Thanks for any suggestions. Maurus Jay Sprenkle schrieb: > A socket is the method of communications. A port is the part of that. > It's the 'number' assigned to a tcp connection implemented using sockets. > > The method defined in the fast cgiwhite paper to use tcp connections > using passed file handles as sockets for communications will not work > with newer versions of windows. You're not on windows are you? > > > On Tue, Sep 8, 2009 at 3:46 PM, Maurus Frey > wrote: > > Hi, > > I try to connect a C++ application on a embedded device to the web > through fastcgi. > > For the first test I reused the code by E. Bareev already published on > this list during August. (Thanks) > > Instead of using a port, I want to use a unix Socket. > ...........code............ > #include > #include "fcgi_stdio.h" > #include > #include > > void handle(FCGX_Request request){ > FCGX_FPrintF(request.out, > "Content-type:text/html\r\n\r\nfastcgi\n

Fastcgi: > Hello world!

\n"); > } > > int main(int argc, char* const argv[] ) > { > std::string port = "/var/run/fastcgitest.socket"; > int listenQueueBacklog = 400; > FCGX_Stream *in, *out, *err; > FCGX_ParamArray envp; > > if(FCGX_Init()) exit(1); > > int listen_socket = FCGX_OpenSocket(port.c_str(), > listenQueueBacklog); > if(listen_socket < 0) exit(1); > > FCGX_Request request; > if(FCGX_InitRequest(&request, listen_socket, 0)) exit(1); > > int reqCounter = 0; > while(FCGX_Accept_r(&request) == 0) > { > handle(request); > reqCounter++; > FCGX_FPrintF(request.out, "\n\r\n\r counter: %d", reqCounter); > FCGX_Finish_r(&request); > } > return 0; > } > ...........code............ > > I got a 500 internal Server Error. Since this is my first fastcgi > project using a socket, I don't really know the problem. > > The lighttpd.error log says: > 2009-09-08 22:34:45: (mod_fastcgi.c.1761) connect failed: Permission > denied on unix:/var/run/lighttpd/fastcgitest.socket > 2009-09-08 22:34:45: (mod_fastcgi.c.2930) backend died; we'll disable it > for 5 seconds and send the request to another backend instead: > reconnects: 0 load: 1 > 2009-09-08 22:34:51: (mod_fastcgi.c.2743) fcgi-server re-enabled: > unix:/var/run/lighttpd/fastcgitest.socket > > The lighttpd.conf looks like this: > fastcgi.debug = 1 > fastcgi.server = ( > "/test.fcgi" => > (( > "socket" => "/var/run/lighttpd/fastcgitest.socket", > "check-local" => "disable" > )) > ) > > If I start the fcgi-app the socket file > (/var/run/lighttpd/fastcgitest.socket) will be created. > The access rights are: srwxr-xr-x 1 root root 0 2009-09-08 22:34 > fastcgitest.socket > > Lighttpd runs as root, it should be able to access the socket. > > What could be the problem? > > Thanks for your support. > > Maurus > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers at mailman.fastcgi.com > > http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers > > > > > -- > Cause united breaks guitars > http://www.youtube.com/watch?v=5YGc4zOqozo > From rclemley at booksys.com Wed Sep 9 14:22:49 2009 From: rclemley at booksys.com (Rob Lemley) Date: Wed, 09 Sep 2009 13:22:49 -0500 Subject: [FASTCGI] A new newbie -> use a pure socket for communictaion In-Reply-To: References: Message-ID: <4AA7F279.6000808@booksys.com> You should try to create the unix domain socket with wide-open permissions initially. Even though lighttpd may be started as root I would guess that it works like apache and does a setuid to a different user before going into web serving mode (try "ps axu | grep light" to see the User ID (uid) of the light process). I have solved this with FCGI by calling the unix "umask()" system call before calling FCGX_OpenSocket(). I recommend a simple exception-safe smart wrapper around the umask() system call to save and restore the processes file creation mask value after calling FCGX_OpenSocket(). You may need to manually remove previously created domain sockets until you get the permissions correct. Try something like this: ... #include #include #include //perror() ... class scoped_umask { public: ~scoped_umask() { ::umask(m_saved_mask); } scoped_umask(::mode_t temporary_mask) : m_saved_mask(::umask(temporary_mask)) {} private: ::mode_t m_saved_mask; }; ... { scoped_umask saved_umask(0); int listen_socket = FCGX_OpenSocket(port.c_str(), listenQueueBacklog); if (listen_socket < 0) { perror("FCGX_OpenSocket failed"); exit(1); } } ... Also I would recommend printing out at least the error codes, and error strings if possible, to help diagnose problems. Here's a simple small main program to that you can play with to see how umask(2) works. You can play with the saved_umask temporary umask value and the open() mode parameter: ... #include ... int main() { scoped_umask saved_umask(0); int fd = ::open("/tmp/UMASKTEST", O_RDWR | O_CREAT, 0666); if (fd < 0) { ::perror("open failed"); return 1; } return 0; } fastcgi-developers-request at mailman.pins.net wrote: > Date: Tue, 08 Sep 2009 22:46:28 +0200 > From: Maurus Frey > Subject: [FASTCGI] A new newbie -> use a pure socket for communictaion > To: fastcgi-developers at mailman.fastcgi.com > Message-ID: <4AA6C2A4.1040209 at avelon-cetex.com> > Content-Type: text/plain; charset=ISO-8859-15 > > Hi, > > I try to connect a C++ application on a embedded device to the web > through fastcgi. > > For the first test I reused the code by E. Bareev already published on > this list during August. (Thanks) > > Instead of using a port, I want to use a unix Socket. > ...........code............ > #include > #include "fcgi_stdio.h" > #include > #include > > void handle(FCGX_Request request){ > FCGX_FPrintF(request.out, > "Content-type:text/html\r\n\r\nfastcgi\n

Fastcgi: > Hello world!

\n"); > } > > int main(int argc, char* const argv[] ) > { > std::string port = "/var/run/fastcgitest.socket"; > int listenQueueBacklog = 400; > FCGX_Stream *in, *out, *err; > FCGX_ParamArray envp; > > if(FCGX_Init()) exit(1); > > int listen_socket = FCGX_OpenSocket(port.c_str(), listenQueueBacklog); > if(listen_socket < 0) exit(1); > > FCGX_Request request; > if(FCGX_InitRequest(&request, listen_socket, 0)) exit(1); > > int reqCounter = 0; > while(FCGX_Accept_r(&request) == 0) > { > handle(request); > reqCounter++; > FCGX_FPrintF(request.out, "\n\r\n\r counter: %d", reqCounter); > FCGX_Finish_r(&request); > } > return 0; > } > ...........code............ > > I got a 500 internal Server Error. Since this is my first fastcgi > project using a socket, I don't really know the problem. > > The lighttpd.error log says: > 2009-09-08 22:34:45: (mod_fastcgi.c.1761) connect failed: Permission > denied on unix:/var/run/lighttpd/fastcgitest.socket > 2009-09-08 22:34:45: (mod_fastcgi.c.2930) backend died; we'll disable it > for 5 seconds and send the request to another backend instead: > reconnects: 0 load: 1 > 2009-09-08 22:34:51: (mod_fastcgi.c.2743) fcgi-server re-enabled: > unix:/var/run/lighttpd/fastcgitest.socket > > The lighttpd.conf looks like this: > fastcgi.debug = 1 > fastcgi.server = ( > "/test.fcgi" => > (( > "socket" => "/var/run/lighttpd/fastcgitest.socket", > "check-local" => "disable" > )) > ) > > If I start the fcgi-app the socket file > (/var/run/lighttpd/fastcgitest.socket) will be created. > The access rights are: srwxr-xr-x 1 root root 0 2009-09-08 22:34 > fastcgitest.socket > > Lighttpd runs as root, it should be able to access the socket. > > What could be the problem? > > Thanks for your support. > > Maurus > > > ------------------------------ > > Message: 2 > Date: Wed, 09 Sep 2009 09:13:21 +0200 > From: "M. Frey" > Subject: Re: [FASTCGI] A new newbie -> use a pure socket for > communictaion > To: Jay Sprenkle > Cc: fastcgi-developers at mailman.fastcgi.com > Message-ID: <4AA75591.707 at avelon-cetex.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi Jay > > Thanks for your answer. And Yes, I'm working on Linux. So any Windows > limitations don't affect. > > Let me state more precisely: In the code fragment I wrote the wrong > socket path. Of course the socket path is similar to the one specified > in lighttpd.conf -> /var/run/lighttpd/fastcgitest.socket > > It still doesn't work. And lighttpd returns "connect failed: Permission > denied" > > Am I completely wrong trying to realize a socket connection using > "fcgi_stdio.h"? Or do I have to use the "fcgio.h" header to achieve this? > > Thanks for any suggestions. > > Maurus > > > > Jay Sprenkle schrieb: > >> A socket is the method of communications. A port is the part of that. >> It's the 'number' assigned to a tcp connection implemented using sockets. >> >> The method defined in the fast cgiwhite paper to use tcp connections >> using passed file handles as sockets for communications will not work >> with newer versions of windows. You're not on windows are you? >> >> >> On Tue, Sep 8, 2009 at 3:46 PM, Maurus Frey > > wrote: >> >> Hi, >> >> I try to connect a C++ application on a embedded device to the web >> through fastcgi. >> >> For the first test I reused the code by E. Bareev already published on >> this list during August. (Thanks) >> >> Instead of using a port, I want to use a unix Socket. >> ...........code............ >> #include >> #include "fcgi_stdio.h" >> #include >> #include >> >> void handle(FCGX_Request request){ >> FCGX_FPrintF(request.out, >> "Content-type:text/html\r\n\r\nfastcgi\n

Fastcgi: >> Hello world!

\n"); >> } >> >> int main(int argc, char* const argv[] ) >> { >> std::string port = "/var/run/fastcgitest.socket"; >> int listenQueueBacklog = 400; >> FCGX_Stream *in, *out, *err; >> FCGX_ParamArray envp; >> >> if(FCGX_Init()) exit(1); >> >> int listen_socket = FCGX_OpenSocket(port.c_str(), >> listenQueueBacklog); >> if(listen_socket < 0) exit(1); >> >> FCGX_Request request; >> if(FCGX_InitRequest(&request, listen_socket, 0)) exit(1); >> >> int reqCounter = 0; >> while(FCGX_Accept_r(&request) == 0) >> { >> handle(request); >> reqCounter++; >> FCGX_FPrintF(request.out, "\n\r\n\r counter: %d", reqCounter); >> FCGX_Finish_r(&request); >> } >> return 0; >> } >> ...........code............ >> >> I got a 500 internal Server Error. Since this is my first fastcgi >> project using a socket, I don't really know the problem. >> >> The lighttpd.error log says: >> 2009-09-08 22:34:45: (mod_fastcgi.c.1761) connect failed: Permission >> denied on unix:/var/run/lighttpd/fastcgitest.socket >> 2009-09-08 22:34:45: (mod_fastcgi.c.2930) backend died; we'll disable it >> for 5 seconds and send the request to another backend instead: >> reconnects: 0 load: 1 >> 2009-09-08 22:34:51: (mod_fastcgi.c.2743) fcgi-server re-enabled: >> unix:/var/run/lighttpd/fastcgitest.socket >> >> The lighttpd.conf looks like this: >> fastcgi.debug = 1 >> fastcgi.server = ( >> "/test.fcgi" => >> (( >> "socket" => "/var/run/lighttpd/fastcgitest.socket", >> "check-local" => "disable" >> )) >> ) >> >> If I start the fcgi-app the socket file >> (/var/run/lighttpd/fastcgitest.socket) will be created. >> The access rights are: srwxr-xr-x 1 root root 0 2009-09-08 22:34 >> fastcgitest.socket >> >> Lighttpd runs as root, it should be able to access the socket. >> >> What could be the problem? >> >> Thanks for your support. >> >> Maurus >> _______________________________________________ >> FastCGI-developers mailing list >> FastCGI-developers at mailman.fastcgi.com >> >> http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers >> >> >> >> >> -- >> Cause united breaks guitars >> http://www.youtube.com/watch?v=5YGc4zOqozo >> >> > > > ------------------------------ > > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers at mailman.fastcgi.com > http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers > > > End of FastCGI-developers Digest, Vol 14, Issue 7 > ************************************************* > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.stcyr at streamfoundry.com Tue Sep 15 14:51:07 2009 From: d.stcyr at streamfoundry.com (Dan StCyr - StreamFoundry) Date: Tue, 15 Sep 2009 14:51:07 -0400 Subject: [FASTCGI] Connection error running FastCGI on z/OS Apache Server Message-ID: <2B10CA12071B40DDA0D9D630EB3CDFA2@STCYR> Hello - running FastCGI on an IBM mainframe (z/OS) Apache Server - getting this error the first time (only) each new script is accessed: EDC8128I Connection refused. (errno2=0x120D0253): FastCGI: failed to connect to server "/var/CMS/CMS40/cgi-bin/CMSDISP.php": connect() Subsequent accesses to the same php script connect fine - error is only the first time a script is accessed during the lifetime of the server. When this connect error occurs, the client sees an "Internal Server Error" - retrying the request runs fine since the retry is no longer the 1st access. Is this a known issue? Misconfiguration? These are the updates to my conf for FastCGI: LoadModule fastcgi_module modules/mod_fastcgi.so Alias /cgi-bin/ "/var/CMS/CMS40/cgi-bin/" AllowOverride None SetHandler fastcgi-script Options ExecCGI Order allow,deny Allow from all AddHandler fastcgi-script .php Dan St.Cyr StreamFoundry, Inc www.streamfoundry.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From anders.geffen at yahoo.com Tue Sep 22 17:21:42 2009 From: anders.geffen at yahoo.com (Anders Geffen) Date: Tue, 22 Sep 2009 14:21:42 -0700 (PDT) Subject: [FASTCGI] excessive dynamic application instances with mod_fastcgi Message-ID: <799444.16135.qm@web111904.mail.gq1.yahoo.com> I am developing dynamic applications with mod_fastcgi-2.4.6 with Apache 2.2..11. Some of my fastcgi invocations are fairly long running, and I am seeing a behavior that I do not understand. While my dynamic application is processing a request, mod_fastcgi starts up additional instances of the application - one instance approximately every 3 seconds ? even if there are no other pending http requests. It starts up new instances until maxClassProcesses is reached or until the request is complete, whichever comes first. It seems to me that mod_fastcgi should only start application instances if there is one or more pending request that is waiting for an application instance, or perhaps it could create a small (configurable) number of idle instances so that they will be available when needed.   Is there any way to configure mod_fastcgi to create application instances only if there are pending requests, or to tell it to create at most n idle application instances (where n is less than maxClassProcesses)? -------------- next part -------------- An HTML attachment was scrubbed... URL: From astrope at tabbweb.com Tue Sep 29 13:15:16 2009 From: astrope at tabbweb.com (Trevor Astrope) Date: Tue, 29 Sep 2009 13:15:16 -0400 (EDT) Subject: [FASTCGI] FastCgiServer and cgiwrap Message-ID: Does anyone know why I get a 404 when accessing a FastCgiServer via an alias when using cgiwrap? The same configuration minus the FastCgiWrapper works. With the FastCgiWrapper enabled, the server starts successfully, but all accesses to the alias result in a 404. Here is the configuration: FastCgiWrapper /usr/lib/cgiwrap FastCgiServer /opt/www/bin/fastcgi.pl -processes 3 \ -user www -group www \ -initial-env PATH_INFO=/www/bin/fastcgi.pl \ -initial-env REMOTE_ADDR=127.0.0.1 Alias /fastcgi/ /opt/www/bin/fastcgi.pl/ Allow from all Like I said, the server starts successfully and I see debug output in the apache error_log, but any attempts to access /fastcgi/ result in a 404. If I remove the FastCgiWrapper configuration, the alias works. Any help is appreciated. Thanks, Trevor From agalkin at audible.com Tue Sep 29 16:05:48 2009 From: agalkin at audible.com (Alexander Galkin (Audible US)) Date: Tue, 29 Sep 2009 16:05:48 -0400 Subject: [FASTCGI] Configure Apache with FastCGI External Server In-Reply-To: References: Message-ID: <8AD089992055F0408126B89B3E407B6709DE791F@EXVS02.HESungard.local> Sorry it is more like an apache question than a FastCGI but since they often work together I thought I can get some good advice. We have Apache 2.0 server running on Solaris 10 (2 processor 64 bit SPARC). The server runs only one instance of Fast CGI binary app written in C and configured as external server started independently from Apache server. The app is multithreaded with thread pool of up 100 threads. It services very memory and CPU consuming requests of delivering very large files. What's the best way to configure Apache server? I am not an Apache pro, but our network guy told me it is compiled as threaded MPM with up to 64 httpd processes and two threads per process. My understanding was that in threaded MPM there is one process that spawns multiple threads. Will it increase performance and reduce memory and CPU usage if we configure it to use only one process? Also will we benefit if we upgrade to latest Apache 2.2?