From jsprenkle at gmail.com Fri Sep 5 19:00:56 2008 From: jsprenkle at gmail.com (Jay Sprenkle) Date: Fri, 5 Sep 2008 18:00:56 -0500 Subject: [FASTCGI] apache 2.2+fastcgi+cgicc In-Reply-To: <1b5f39a10808252130g4104cccfodfb7d80048f4a241@mail.gmail.com> References: <1b5f39a10808252130g4104cccfodfb7d80048f4a241@mail.gmail.com> Message-ID: <1b5f39a10809051600r5863c1f5h18e883b75e0f5c75@mail.gmail.com> Good evening, After much hair pulling I've found my particular bug with fastcgi on Windows Apache and lighttpd. I thought I would share with the community. Any fastcgi binary application compiled with Microsoft (msvc 8, etc) compilers and running against a mod_fastcgi compiled under cygwin with a version of 1.5.24 or earlier will fail. The cygwin libraries do not emulate dup2() in such a way that the duplicated handle is reliably inheritable by a child process. This causes the fastcgi application to fail if it uses a tcp/ip connection for interprocess communication. There's a discussion of the problem here: http://www.nabble.com/Socket-inheritance-with-fork-dup2-exec-td11243160.html Jay Sprenkle From eddie at mailforce.net Sat Sep 6 18:50:06 2008 From: eddie at mailforce.net (Eddie) Date: Sat, 06 Sep 2008 16:50:06 -0600 Subject: [FASTCGI] A C++ FastCGI Library Message-ID: <1220741406.6731.9.camel@localhost> Hey guys, I have been working on a pure C++ FastCGI library for some time now and have LGPLed it. I've got it up at http://fastcgipp.com for now. Lot's of good documentation and tutorials. I would definitely appreciate any ideas or comments you guys could offer. There are a few issues I am running into that I'm hoping someone could give me some insight into. For one, check out the upload example in the SVN trunk. For two, are there any plans to implement the ability to multiples requests over a single connection in mod_fastcgi? It just seems like there would be so much less overhead doing it that way as opposed to dealing with opening/closing numerous connections for every request. -- Eddie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: From richard_holland at btinternet.com Sun Sep 7 19:59:33 2008 From: richard_holland at btinternet.com (Richard Holland) Date: Sun, 7 Sep 2008 23:59:33 +0000 (UTC) Subject: [FASTCGI] long process c application Message-ID: Hi I am new to FastCGI and wonder if it can help in the following scenario. I am manipulating tape drives using C under linux and I want the things like tape status to be shown on a web page( after a button click) using the application as a CGI. The application fails/times out under CGI as tape processes take ages. Is FastCGI the answer here or do I press on looking at forking/child process etc in C. Regards Richard From tom at streamsense.net Sun Sep 7 23:12:12 2008 From: tom at streamsense.net (Thomas Grimshaw) Date: Mon, 08 Sep 2008 04:12:12 +0100 Subject: [FASTCGI] long process c application In-Reply-To: References: Message-ID: <48C4980C.2040803@streamsense.net> Richard Holland wrote: > The application fails/times out under CGI as tape processes take ages. > That won't be fixed with FastCGI, since it's a webserver timeout, and is nothing to do with the application interface. Such timeouts should be entirely configurable, however, at least in apache and IIS. Tom From eddie at mailforce.net Tue Sep 9 11:23:46 2008 From: eddie at mailforce.net (Eddie) Date: Tue, 09 Sep 2008 09:23:46 -0600 Subject: [FASTCGI] Multiple URLs pointing to the same script Message-ID: <1220973826.5995.6.camel@localhost> Is it possible to have apaches mod_fastcgi make multiple URLs point to the same application? Obviously I could just use symbolic links but that would create multiple instances. Ideally I would want a list of URLs that are all sent to the same fastcgi server instance and the passed URLs are sent as script names or something. Better yet, a particular directory is bound to the script and any files or subdirectories searched are passed directly to the script regardless of whether or not they exist. -- Eddie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: From jsprenkle at gmail.com Tue Sep 9 19:13:20 2008 From: jsprenkle at gmail.com (Jay Sprenkle) Date: Tue, 9 Sep 2008 18:13:20 -0500 Subject: [FASTCGI] Multiple URLs pointing to the same script In-Reply-To: <1220973826.5995.6.camel@localhost> References: <1220973826.5995.6.camel@localhost> Message-ID: <1b5f39a10809091613n3b614214ledc5fa90db8b1687@mail.gmail.com> Yes, see the Alias or AliasMatch directive. On Tue, Sep 9, 2008 at 10:23 AM, Eddie wrote: > Is it possible to have apaches mod_fastcgi make multiple URLs point to > the same application? Obviously I could just use symbolic links but that > would create multiple instances. Ideally I would want a list of URLs > that are all sent to the same fastcgi server instance and the passed > URLs are sent as script names or something. Better yet, a particular > directory is bound to the script and any files or subdirectories > searched are passed directly to the script regardless of whether or not > they exist. -- 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 From ashish at egovernments.org Wed Sep 10 06:02:58 2008 From: ashish at egovernments.org (Ashish Melanta) Date: Wed, 10 Sep 2008 15:32:58 +0530 Subject: [FASTCGI] GetOverlappedResult() failed error. Message-ID: <48C79B52.8090907@egovernments.org> Hi, I just upgraded from PHP 5.0 to 5.2 and am seeing the following random error in the Apache logs when I try to run a Drupal Newsletter module: [Tue Sep 09 08:53:51 2008] [error] [client 59.92.169.191] (OS 233)No process is on the other end of the pipe. : FastCGI: comm with server "C:/Program Files/Autodesk/MapGuideEnterprise2008/WebServerExtensions/Php/php-cgi.exe" aborted: GetOverlappedResult() failed [Tue Sep 09 08:53:51 2008] [error] [client 59.92.169.191] FastCGI: incomplete headers (0 bytes) received from server "C:/Program Files/Autodesk/MapGuideEnterprise2008/WebServerExtensions/Php/php-cgi.exe" I use the Apache/PHP/FastCGI combo which comes packaged within AutoDesk Mapguide Enterprise 2008 application. Note that this error is reproducible in a random manner. Has anyone else come across this error ? Appreciate if somebody could help us out here. -- Thanks, Ashish From jsprenkle at gmail.com Thu Sep 11 20:28:30 2008 From: jsprenkle at gmail.com (Jay Sprenkle) Date: Thu, 11 Sep 2008 19:28:30 -0500 Subject: [FASTCGI] Does the fastcgi work on windows xp using sockets? Message-ID: <1b5f39a10809111728y3c9a4632l96a8c45346ac3ed0@mail.gmail.com> After much research I believe fastcgi cannot be made to work on windows when communicating via sockets. "The WSADuplicateSocket function is introduced to enable socket sharing across processes. A source process calls WSADuplicateSocket to obtain a special WSAPROTOCOL_INFO structure for a target process identifier. It uses some interprocess communications (IPC) mechanism to pass the contents of this structure to a target process." http://msdn.microsoft.com/en-us/library/ms740478(VS.85).aspx Since there is no other defined interprocess communications method between the web server and a fastcgi process there's no generic way to pass this information. Can anyone validate this? If so, how do I go about getting the FAQ on fastcgi.com updated? There seems to be a LOT of confusion on this issue. Thanks, Jay From eddie at mailforce.net Thu Sep 11 21:25:55 2008 From: eddie at mailforce.net (Eddie) Date: Thu, 11 Sep 2008 19:25:55 -0600 Subject: [FASTCGI] Management Records Message-ID: <1221182755.6216.13.camel@localhost> I have been working out a few kinks in the fastcgi++ library and have noticed a few things. Does the apache mod_fastcgi module by default assume that the fastcgi application can not handle multiple connections? I ask this because I can not get apache to try and open more than one connection to my applications. I have tested to make sure the library can receive multiple connections by connecting to the socket manually from another program and it can. I set up a request handler to wait five seconds before completing it's reply and apache always waits the five seconds before starting another request. I figured this would have something to do with my library not answering management GET_VALUE records but I have yet to see one come from the apache module. Does the modules perhaps send the management records through some other channel? Being instead of connecting to the applications file descriptor 0? I am suspicious because I noticed the file descriptors for my requests are starting at 6, not 3. This makes me wonder if some other data was send to me on 3,4 and 5 (or maybe 1 and 2 as well). Another aspect of management records that I am unclear of is who is supposed to close the connection after everything (assuming a connection is created in the same way that a requests connection can be)? With request connections, there is a field that clarifies that, but nothing of the sort with management records. -- Eddie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: From jsprenkle at gmail.com Fri Sep 12 08:54:43 2008 From: jsprenkle at gmail.com (Jay Sprenkle) Date: Fri, 12 Sep 2008 07:54:43 -0500 Subject: [FASTCGI] Management Records In-Reply-To: <1221182755.6216.13.camel@localhost> References: <1221182755.6216.13.camel@localhost> Message-ID: <1b5f39a10809120554r552123aex287d7799004a9e16@mail.gmail.com> I believe Apache is multithreaded and it can't communicate the requests from multiple threads to the mod_fastcgi module. I'm not sure if this is correct though On Thu, Sep 11, 2008 at 8:25 PM, Eddie wrote: > I have been working out a few kinks in the fastcgi++ library and have > noticed a few things. Does the apache mod_fastcgi module by default > assume that the fastcgi application can not handle multiple connections? From eddie at mailforce.net Fri Sep 12 22:20:35 2008 From: eddie at mailforce.net (Eddie) Date: Fri, 12 Sep 2008 20:20:35 -0600 Subject: [FASTCGI] Management Records In-Reply-To: <1b5f39a10809120554r552123aex287d7799004a9e16@mail.gmail.com> References: <1221182755.6216.13.camel@localhost> <1b5f39a10809120554r552123aex287d7799004a9e16@mail.gmail.com> Message-ID: <1221272435.5935.14.camel@localhost> > I believe Apache is multithreaded and it can't communicate the requests from > multiple threads to the mod_fastcgi module. I'm not sure if this is > correct though That would be in contradiction to what the documentation for mod_fastcgi says ( http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html ). It states: > The FastCGI protocol supports a feature, described in the > specificiation as "multiplexing", that allows a single client-server > connection to be simultaneously shared by multiple requests. This is > not supported. This does *not* prevent FastCGI applications from > supporting multiple simultaneous requests over independent > connections. Of course, the application has to be specifically > designed to do so by using a threaded or select/poll based server > model. It is already a shame that it can't multiplex over a single connection, but if this documentation is incorrect (which is looking like the case), then it is almost no better than normal CGI. All this talk has been going around regarding designing FastCGI applications with the ability to process concurrent requests but they were being queued by mod_fastcgi anyway! Now assuming all this is incorrect speculation and the module does support simultaneous connections, how would one figure out how to make it utilize them? And any thoughts on the management records and whether or not the module actually uses them? There is no mention of them in the documentation so I am going to assume it doesn't. I might try fooling around with mod_fcgi and see if that one will do simultaneous requests. If not, then it really "sucks" to have written a protocol library to find that no webservers actually support the protocol properly. Is anyone actually developing the apache mod_fastcgi? -- Eddie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: From orasnita at gmail.com Sat Sep 13 01:21:25 2008 From: orasnita at gmail.com (Octavian Rasnita) Date: Sat, 13 Sep 2008 08:21:25 +0300 Subject: [FASTCGI] fastcgi site not working? Message-ID: <96BD8C7117434C829EF3188C930D8B24@teddy> Hi, I am a new list member and I have a few questions but before putting them, first I want to read more on www.fastcgi.com. I've tried to access this site for a few times (from Windowx XP SP3 with IE6) but the first page keeps refreshing and I can see only that "FastCGI is now on Drupal" but the page doesn't stop refreshing. Is there something wrong with my computer or with the site? Thank you. Octavian From simon at optinet.com Sat Sep 13 03:32:40 2008 From: simon at optinet.com (Simon) Date: Sat, 13 Sep 2008 03:32:40 -0400 Subject: [FASTCGI] fastcgi site not working? In-Reply-To: <96BD8C7117434C829EF3188C930D8B24@teddy> Message-ID: <20080913073246.53FEA40B3@smtp.chelsea.net> site has issues. On Sat, 13 Sep 2008 08:21:25 +0300, Octavian Rasnita wrote: >Hi, >I am a new list member and I have a few questions but before putting them, >first I want to read more on www.fastcgi.com. >I've tried to access this site for a few times (from Windowx XP SP3 with >IE6) but the first page keeps refreshing and I can see only that "FastCGI is >now on Drupal" but the page doesn't stop refreshing. >Is there something wrong with my computer or with the site? >Thank you. >Octavian >_______________________________________________ >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 orasnita at gmail.com Sat Sep 13 03:53:24 2008 From: orasnita at gmail.com (Octavian Rasnita) Date: Sat, 13 Sep 2008 10:53:24 +0300 Subject: [FASTCGI] fastcgi site not working? References: <48cb6c9e.2487460a.7992.01abSMTPIN_ADDED@mx.google.com> Message-ID: Ok, thank you. Do you know where from I can download an easy-to-install version of fastcgi for Apache 2.2.9 that runs under Fedora? I see that the yum repository offers only fcgid and as far as I know, I can't run an app as an external server with fcgid. Thank you. Octavian ----- Original Message ----- From: "Simon" To: ; "Octavian Rasnita" Sent: Saturday, September 13, 2008 10:32 AM Subject: Re: [FASTCGI] fastcgi site not working? > > site has issues. > > On Sat, 13 Sep 2008 08:21:25 +0300, Octavian Rasnita wrote: > >>Hi, > >>I am a new list member and I have a few questions but before putting them, >>first I want to read more on www.fastcgi.com. > >>I've tried to access this site for a few times (from Windowx XP SP3 with >>IE6) but the first page keeps refreshing and I can see only that "FastCGI >>is >>now on Drupal" but the page doesn't stop refreshing. > >>Is there something wrong with my computer or with the site? > >>Thank you. > >>Octavian > >>_______________________________________________ >>FastCGI-developers mailing list >>FastCGI-developers at mailman.fastcgi.com >>http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers > > > > From wilburlo at gmail.com Sat Sep 13 22:33:47 2008 From: wilburlo at gmail.com (Daniel Lo) Date: Sat, 13 Sep 2008 19:33:47 -0700 Subject: [FASTCGI] fastcgi site not working? In-Reply-To: <96BD8C7117434C829EF3188C930D8B24@teddy> References: <96BD8C7117434C829EF3188C930D8B24@teddy> Message-ID: Hi, I have the same problem too, but I tried IE 7. http://www.fastcgi.com/drupal You can use this URL, which is where the page would redirect too... Here is the page content... FastCGI Home is now in Drupal -daniel On Fri, Sep 12, 2008 at 10:21 PM, Octavian Rasnita wrote: > Hi, > > I am a new list member and I have a few questions but before putting them, > first I want to read more on www.fastcgi.com. > > I've tried to access this site for a few times (from Windowx XP SP3 with > IE6) but the first page keeps refreshing and I can see only that "FastCGI is > now on Drupal" but the page doesn't stop refreshing. > > Is there something wrong with my computer or with the site? > > Thank you. > > Octavian > > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers at mailman.fastcgi.com > http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers > -- We must make the world honest before we can honestly say to our children that honesty is the best policy. -Bernard Shaw From davidb at pins.net Sun Sep 14 08:26:50 2008 From: davidb at pins.net (David Birnbaum) Date: Sun, 14 Sep 2008 08:26:50 -0400 Subject: [FASTCGI] fastcgi site not working? In-Reply-To: References: <96BD8C7117434C829EF3188C930D8B24@teddy> Message-ID: <48CD030A.3000804@pins.net> Folks, Sorry about that...my META refresh isn't working right (I haven't run IE in a while so I didn't know it was broken). I just put in an Apache redirect in addition - can you see if that behaves better (it works for a test IE I have here). Cheers, David. ------------------------------------------------------------------------ Daniel Lo wrote: > Hi, > > I have the same problem too, but I tried IE 7. > > http://www.fastcgi.com/drupal > > You can use this URL, which is where the page would redirect too... > > Here is the page content... > > "http://www.w3.org/TR/REC-html40/loose.dtd"> > > > > > > FastCGI Home is now in Drupal > > > > > -daniel > > > On Fri, Sep 12, 2008 at 10:21 PM, Octavian Rasnita wrote: > >> Hi, >> >> I am a new list member and I have a few questions but before putting them, >> first I want to read more on www.fastcgi.com. >> >> I've tried to access this site for a few times (from Windowx XP SP3 with >> IE6) but the first page keeps refreshing and I can see only that "FastCGI is >> now on Drupal" but the page doesn't stop refreshing. >> >> Is there something wrong with my computer or with the site? >> >> Thank you. >> >> Octavian >> >> _______________________________________________ >> 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 orasnita at gmail.com Sun Sep 14 11:14:48 2008 From: orasnita at gmail.com (Octavian Rasnita) Date: Sun, 14 Sep 2008 18:14:48 +0300 Subject: [FASTCGI] installing fastcgi under Fedora? Message-ID: Hi, I read that for installing mod_fastcgi for Apache 2.2 that runs on Fedora, I need to use: apxs -o mod_fastcgi.so -c *.c apxs -i -n fastcgi mod_fastcgi.so I have tried these commands, but the first one gives an error and it doesn't create mod_fastcgi.so. Am I doing something wrong? Is there another way to install mod_fastcgi.so under Fedora? Thank you. Octavian # apxs -o mod_fastcgi.so -c *.c /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-pr otector --param=ssp-buffer-size=4 -m64 -mtune=generic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/httpd -I/usr/include /apr-1 -I/usr/include/apr-1 -I/usr/include/mysql -c -o fcgi_buf.lo fcgi_buf.c && touch fcgi_buf.slo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-pr otector --param=ssp-buffer-size=4 -m64 -mtune=generic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/httpd -I/usr/include /apr-1 -I/usr/include/apr-1 -I/usr/include/mysql -c -o fcgi_config.lo fcgi_config.c && touch fcgi_config.slo fcgi_config.c: In function 'fcgi_config_new_static_server': fcgi_config.c:769: warning: format '%ld' expects type 'long int', but argument 3 has type 'gid_t' fcgi_config.c:774: warning: format '%ld' expects type 'long int', but argument 3 has type 'uid_t' fcgi_config.c:808: warning: dereferencing type-punned pointer will break strict-aliasing rules fcgi_config.c:833: warning: dereferencing type-punned pointer will break strict-aliasing rules fcgi_config.c: In function 'fcgi_config_new_external_server': fcgi_config.c:962: warning: format '%ld' expects type 'long int', but argument 3 has type 'gid_t' fcgi_config.c:967: warning: format '%ld' expects type 'long int', but argument 3 has type 'uid_t' fcgi_config.c:999: warning: dereferencing type-punned pointer will break strict-aliasing rules fcgi_config.c:1016: warning: dereferencing type-punned pointer will break strict-aliasing rules fcgi_config.c: In function 'fcgi_config_new_auth_server': fcgi_config.c:1207: warning: cast from pointer to integer of different size /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-pr otector --param=ssp-buffer-size=4 -m64 -mtune=generic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/httpd -I/usr/include /apr-1 -I/usr/include/apr-1 -I/usr/include/mysql -c -o fcgi_pm.lo fcgi_pm.c && touch fcgi_pm.slo fcgi_pm.c: In function 'dynamic_read_msgs': fcgi_pm.c:1102: warning: dereferencing type-punned pointer will break strict-aliasing rules /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-pr otector --param=ssp-buffer-size=4 -m64 -mtune=generic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/httpd -I/usr/include /apr-1 -I/usr/include/apr-1 -I/usr/include/mysql -c -o fcgi_protocol.lo fcgi_protocol.c && touch fcgi_protocol.slo fcgi_protocol.c: In function 'fcgi_protocol_dequeue': fcgi_protocol.c:449: warning: format '%d' expects type 'int', but argument 9 has type 'long unsigned int' /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-pr otector --param=ssp-buffer-size=4 -m64 -mtune=generic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/httpd -I/usr/include /apr-1 -I/usr/include/apr-1 -I/usr/include/mysql -c -o fcgi_util.lo fcgi_util.c && touch fcgi_util.slo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-pr otector --param=ssp-buffer-size=4 -m64 -mtune=generic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/httpd -I/usr/include /apr-1 -I/usr/include/apr-1 -I/usr/include/mysql -c -o mod_fastcgi.lo mod_fastcgi.c && touch mod_fastcgi.slo mod_fastcgi.c: In function 'open_connection_to_fs': mod_fastcgi.c:1083: warning: dereferencing type-punned pointer will break strict-aliasing rules /usr/lib64/apr-1/build/libtool --silent --mode=link gcc -o od_fastcgi.la -rpath /usr/lib64/httpd/modules -module -avoid-version mod_ fastcgi.lo fcgi_util.lo fcgi_protocol.lo fcgi_pm.lo fcgi_config.lo fcgi_buf.lo From orasnita at gmail.com Sun Sep 14 11:17:18 2008 From: orasnita at gmail.com (Octavian Rasnita) Date: Sun, 14 Sep 2008 18:17:18 +0300 Subject: [FASTCGI] fastcgi site not working? References: <96BD8C7117434C829EF3188C930D8B24@teddy> <48CD030A.3000804@pins.net> Message-ID: The fastcgi site works fine now. Octavian ----- Original Message ----- From: "David Birnbaum" To: "Daniel Lo" Cc: "Octavian Rasnita" ; Sent: Sunday, September 14, 2008 3:26 PM Subject: Re: [FASTCGI] fastcgi site not working? > Folks, > > Sorry about that...my META refresh isn't working right (I haven't run IE > in a while so I didn't know it was broken). I just put in an Apache > redirect in addition - can you see if that behaves better (it works for > a test IE I have here). > > Cheers, > > David. > > ------------------------------------------------------------------------ > > Daniel Lo wrote: >> Hi, >> >> I have the same problem too, but I tried IE 7. >> >> http://www.fastcgi.com/drupal >> >> You can use this URL, which is where the page would redirect too... >> >> Here is the page content... >> >> > "http://www.w3.org/TR/REC-html40/loose.dtd"> >> >> >> >> > CONTENT="0;http://www.fastcgi.com/drupal" /> >> >> FastCGI Home is now in Drupal >> >> >> >> >> -daniel >> >> >> On Fri, Sep 12, 2008 at 10:21 PM, Octavian Rasnita >> wrote: >> >>> Hi, >>> >>> I am a new list member and I have a few questions but before putting >>> them, >>> first I want to read more on www.fastcgi.com. >>> >>> I've tried to access this site for a few times (from Windowx XP SP3 with >>> IE6) but the first page keeps refreshing and I can see only that >>> "FastCGI is >>> now on Drupal" but the page doesn't stop refreshing. >>> >>> Is there something wrong with my computer or with the site? >>> >>> Thank you. >>> >>> Octavian >>> >>> _______________________________________________ >>> FastCGI-developers mailing list >>> FastCGI-developers at mailman.fastcgi.com >>> http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers >>> >>> >> >> >> >> > From orasnita at gmail.com Sun Sep 14 11:21:36 2008 From: orasnita at gmail.com (Octavian Rasnita) Date: Sun, 14 Sep 2008 18:21:36 +0300 Subject: [FASTCGI] missing documents from fastcgi site Message-ID: <41F86382483A422F8EADE0CFF3AE7523@teddy> Hi, I've just found that some pages on fastcgi site can't be found. For example: http://www.fastcgi.com/archives/fastcgi-developers/2006-April/004251.html Octavian From neel.get at gmail.com Wed Sep 17 11:07:37 2008 From: neel.get at gmail.com (Neel Get) Date: Wed, 17 Sep 2008 11:07:37 -0400 Subject: [FASTCGI] fastCGI for C++ Message-ID: I was trying to do some CGI application with C++ using fast cgi when I installed fastcgi I get the following error.
Syntax error on line 4 of /etc/apache2/mods-enabled/fastcgi.conf:
FastCgiIpcDir /var/lib/apache2/fastcgi: access for server (uid 1000, gid  
1000) failed: write not allowed
the fastcgi.conf file attached. I need a good tutorial on how to configure/optimize fastcgi for C++ -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ -------------- next part -------------- A non-text attachment was scrubbed... Name: fastcgi.conf Type: application/octet-stream Size: 155 bytes Desc: not available URL: From igor at pokelondon.com Wed Sep 17 04:41:20 2008 From: igor at pokelondon.com (Igor Clark) Date: Wed, 17 Sep 2008 09:41:20 +0100 Subject: [FASTCGI] fastCGI for C++ In-Reply-To: References: Message-ID: <0DFF3418-6EB0-4B56-B633-531781505C8F@pokelondon.com> Looks like a permission problem on /var/lib/apache2/fastcgi - the user owning the process (uid 1000, gid 1000) is not allowed to write to the IPC directory On 17 Sep 2008, at 16:07, Neel Get wrote: > I was trying to do some CGI application with C++ using fast cgi when > I installed fastcgi I get the following error. > >
> Syntax error on line 4 of /etc/apache2/mods-enabled/fastcgi.conf:
> FastCgiIpcDir /var/lib/apache2/fastcgi: access for server (uid 1000,  
> gid 1000) failed: write not allowed
> 
> > the fastcgi.conf file attached. > > I need a good tutorial on how to configure/optimize fastcgi for C++ > > -- > Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers at mailman.fastcgi.com > http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers -- Igor Clark ? POKE ? 10 Redchurch Street ? E2 7DD ? +44 (0)20 7749 5355 ? www.pokelondon.com From neel.get at gmail.com Wed Sep 17 15:35:14 2008 From: neel.get at gmail.com (Neel Get) Date: Wed, 17 Sep 2008 15:35:14 -0400 Subject: [FASTCGI] fastCGI for C++ In-Reply-To: <0DFF3418-6EB0-4B56-B633-531781505C8F@pokelondon.com> References: <0DFF3418-6EB0-4B56-B633-531781505C8F@pokelondon.com> Message-ID: owner of /var/lib/apache2/fastcgi is www-data user and UID of www-data is 33
neel at pc:~$ ls -l /var/lib/apache2 | grep fastcgi
drwxr-xr-x 3 www-data www-data 4096 2008-08-01 19:14 fastcgi
neel at pc:~$ ls -l /var/lib/apache2/fastcgi
total 4
drwx------ 2 www-data www-data 4096 2008-08-01 19:14 dynamic
my username is neel on my pc and UID is 1000 both apache and apache2 process are running with UID 1000 and login www-data I didn't understood the problem But I think its easy to understand can you plese explain whats the problem. On Wed, 17 Sep 2008 04:41:20 -0400, Igor Clark wrote: > Looks like a permission problem on /var/lib/apache2/fastcgi - the user > owning the process (uid 1000, gid 1000) is not allowed to write to the > IPC directory > > On 17 Sep 2008, at 16:07, Neel Get wrote: > >> I was trying to do some CGI application with C++ using fast cgi when I >> installed fastcgi I get the following error. >> >>
>> Syntax error on line 4 of /etc/apache2/mods-enabled/fastcgi.conf:
>> FastCgiIpcDir /var/lib/apache2/fastcgi: access for server (uid 1000,  
>> gid 1000) failed: write not allowed
>> 
>> >> the fastcgi.conf file attached. >> >> I need a good tutorial on how to configure/optimize fastcgi for C++ >> >> --Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ >> _______________________________________________ >> FastCGI-developers mailing list >> FastCGI-developers at mailman.fastcgi.com >> http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers > > -- > Igor Clark ? POKE ? 10 Redchurch Street ? E2 7DD ? +44 (0)20 7749 5355 ? > www.pokelondon.com > > > -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ From hanno at hboeck.de Wed Sep 17 11:41:54 2008 From: hanno at hboeck.de (Hanno =?utf-8?q?B=C3=B6ck?=) Date: Wed, 17 Sep 2008 17:41:54 +0200 Subject: [FASTCGI] file handles and fastcgi Message-ID: <200809171741.54339.hanno@hboeck.de> Hi, I'm currently trying to get my apache to work still if it uses many logfiles. ATM when setting ulimit -n 10000 in the apache init script, it kinda works, but fastcgi doesn't: [Wed Sep 17 17:37:27 2008] [error] [client 66.249.71.138] (2)No such file or directory: FastCGI: failed to connect to server "/home/phpids/websites/trac.php-ids.org/htdocs/index.fcgi": socket file descriptor (4034) is larger than FD_SETSIZE (1024), you probably need to rebuild Apache with a larger FD_SETSIZE I've tried to manually increase FD_SETSIZE in the source, but that doesn't seem to help. -- Hanno Böck Blog: http://www.hboeck.de/ GPG: 3DBD3B20 Jabber/Mail: hanno at hboeck.de -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part. URL: From igor at pokelondon.com Wed Sep 17 12:58:06 2008 From: igor at pokelondon.com (Igor Clark) Date: Wed, 17 Sep 2008 17:58:06 +0100 Subject: [FASTCGI] fastCGI for C++ In-Reply-To: References: <0DFF3418-6EB0-4B56-B633-531781505C8F@pokelondon.com> Message-ID: <16664AA6-213E-4A00-BAF3-D254987D462E@pokelondon.com> If apache process is running as uid 1000, then uid 1000 needs to be able to write to the directory /var/lib/apache2/fastcgi so perhaps add uid 1000 to www-data on some sorts of linux this might be e.g. /usr/sbin/usermod -G neel,www-data neel cheers i On 17 Sep 2008, at 20:35, Neel Get wrote: > owner of /var/lib/apache2/fastcgi is www-data user and UID of www- > data is 33 > >
> neel at pc:~$ ls -l /var/lib/apache2 | grep fastcgi
> drwxr-xr-x 3 www-data www-data 4096 2008-08-01 19:14 fastcgi
> neel at pc:~$ ls -l /var/lib/apache2/fastcgi
> total 4
> drwx------ 2 www-data www-data 4096 2008-08-01 19:14 dynamic
> 
> > my username is neel on my pc and UID is 1000 > > both apache and apache2 process are running with UID 1000 and login > www-data > > I didn't understood the problem > But I think its easy to understand can you plese explain whats the > problem. > > On Wed, 17 Sep 2008 04:41:20 -0400, Igor Clark > wrote: > >> Looks like a permission problem on /var/lib/apache2/fastcgi - the >> user owning the process (uid 1000, gid 1000) is not allowed to >> write to the IPC directory >> >> On 17 Sep 2008, at 16:07, Neel Get wrote: >> >>> I was trying to do some CGI application with C++ using fast cgi >>> when I installed fastcgi I get the following error. >>> >>>
>>> Syntax error on line 4 of /etc/apache2/mods-enabled/fastcgi.conf:
>>> FastCgiIpcDir /var/lib/apache2/fastcgi: access for server (uid  
>>> 1000, gid 1000) failed: write not allowed
>>> 
>>> >>> the fastcgi.conf file attached. >>> >>> I need a good tutorial on how to configure/optimize fastcgi for C++ >>> >>> --Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ >>> _______________________________________________ >>> FastCGI-developers mailing list >>> FastCGI-developers at mailman.fastcgi.com >>> http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers >> >> -- >> Igor Clark ? POKE ? 10 Redchurch Street ? E2 7DD ? +44 (0)20 7749 >> 5355 ? www.pokelondon.com >> >> >> > > > > -- > Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ -- Igor Clark ? POKE ? 10 Redchurch Street ? E2 7DD ? +44 (0)20 7749 5355 ? www.pokelondon.com From robs at fastcgi.com Sun Sep 21 15:33:48 2008 From: robs at fastcgi.com (Rob Saccoccio) Date: Sun, 21 Sep 2008 15:33:48 -0400 Subject: [FASTCGI] [PATCH] Updated patch for -pass-header correct handling In-Reply-To: <48B62EA6.8070407@gmx.net> References: <48B62EA6.8070407@gmx.net> Message-ID: Thanks for the patches. The existing -pass-header implementation works as intended. To pass the HTTP_AUTHORIZATION header, you have to specify "-pass-header HTTP_AUTHORIZATION (not "-pass-header AUTHORIZATION"). I've clarified the docs a bit. Consistent with mod_cgi, I have incorporated support for duplicate Status/Location/ContentType headers being returned by the application. Rob > -----Original Message----- > From: fastcgi-developers-bounces+robs=saccoccio.org at mailman.fastcgi.com > [mailto:fastcgi-developers-bounces+robs=saccoccio.org at mailman.fastcgi.com] > On Behalf Of Christian Seiler > Sent: Thursday, August 28, 2008 12:51 AM > To: fastcgi-developers at mailman.fastcgi.com > Subject: [FASTCGI] [PATCH] Updated patch for -pass-header correct handling > > Hi, > > I was contacted about my patch for correctly handling the -pass-header > option [1]. It turns out that my patch didn't work with Apache 1.3 - I > just updated it so that it works with Apache 1.3, too.: > > http://www.christian-seiler.de/temp/mod_fastcgi-patches/pass-headers.patch > > And I somehow can't find my followup posting in the public archives, so > I'll repost the patch for the other issue I had with mod_fastcgi, for > anyone who's interested: > > > Also, I discovered another issue with mod_fastcgi: If a CGI script sends > > two 'Status: ' headers, mod_fastcgi will cause an internal server error. > > Yes, it may not be a very good idea to send two status lines BUT a) the > > CGI specification does not forbid it explicitely and b) Apache does not > > complain when this happens with normal CGI scripts. As I see no reason > > to enforce such strictness (Apache with normal CGI doesn't, lighttpd > > with FastCGI doesn't) and I came across a few scripts that caused this > > kind of problem with mod_fastcgi, here's a patch that removes the > > duplicate header check: > > http://www.christian-seiler.de/temp/mod_fastcgi-patches/duplicate- > allowed.patch > > Regards, > Christian > > [1] > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers at mailman.fastcgi.com > http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers From robs at fastcgi.com Sun Sep 21 15:34:02 2008 From: robs at fastcgi.com (Rob Saccoccio) Date: Sun, 21 Sep 2008 15:34:02 -0400 Subject: [FASTCGI] Bug fix for mod_fastcgi In-Reply-To: <07EDA853-5289-4D4C-98C4-FF486CD3B240@strout.net> References: <07EDA853-5289-4D4C-98C4-FF486CD3B240@strout.net> Message-ID: <803DC8B387FD494BA2B778A52668574D@maisel> Thanks for the patch Joe. Excellent catch. I've incorporated a fix for this. My approach varies from yours, but it should achieve the same result. Rob > -----Original Message----- > From: fastcgi-developers-bounces+robs=chelsea.net at fastcgi.com > [mailto:fastcgi-developers-bounces+robs=chelsea.net at fastcgi.com] On Behalf > Of Joe Strout > Sent: Tuesday, March 25, 2008 4:25 PM > To: fastcgi-developers at fastcgi.com > Subject: [FASTCGI] Bug fix for mod_fastcgi > > [I posted this on 3/13, but nobody replied, and now I can't find it > in the archives, so maybe the mailing list burped. Here's trying > again.] > > I dug into the mod_fastcgi source, and believe I have found (and > fixed) the problem with timeouts with certain-sized responses. > Here's what's going on: > > It can happen that we already have some data in the > clientOutputBuffer before calling ap_select and fcgi_buf_socket_recv, > to receive data into serverInputBuffer. Then we call > fcgi_protocol_dequeue, which will return after filling up > clientOutputBuffer. Then, if there is still more data to receive > sitting on the socket itself, we're fine; ap_select will return > happily on our next iteration and we finish processing the data. But > if not -- if we've emptied the socket into serverInputBuffer -- then > ap_select times out, resulting in the "idle timeout" error. > > So there are really two related problems here: > > 1. The socket_io method (which implements the main state machine) > uses some heuristics to calculate how long it should wait before > timing out. This includes a check for pending data to be sent to the > client (clientOutputBuffer) -- but does NOT include a check for data > that's already been received from the socket and is waiting to be > processed (serverInputBuffer). I think in this case we want to just > poll the sockets without waiting at all, so I added an additional > block before the else clause: > > else if (BufferLength(fr->serverInputBuffer)) { > /* data already in input buffer, so just poll sockets > and continue */ > timeout.tv_sec = 0; > timeout.tv_usec = 0; > } > > 2. When we're in this situation, and ap_select returns 0 indicating > that no knew data was found, we should not consider it an error as > long as we still have pending data in serverInputBuffer. So I > changed the "if (select_status == 0)" line to > > if (select_status == 0 && !BufferLength(fr->serverInputBuffer)) > > With these changes, I'm now able to serve files of any size without > hanging. > > How and where do I go about submitting a patch to have this change > reviewed and rolled into the standard distribution? > > Thanks, > - Joe > > > -- > Joe Strout > Inspiring Applications, Inc. > http://www.InspiringApps.com > > > > ___________________________________ > fastcgi-developers mailing list > http://fastcgi.com/fastcgi-developers/ From robs at fastcgi.com Sun Sep 21 15:34:20 2008 From: robs at fastcgi.com (Rob Saccoccio) Date: Sun, 21 Sep 2008 15:34:20 -0400 Subject: [FASTCGI] apache 2.2+fastcgi+cgicc In-Reply-To: <48B3FDC8.6030302@tomdonovan.net> References: <1b5f39a10808252130g4104cccfodfb7d80048f4a241@mail.gmail.com> <48B3FDC8.6030302@tomdonovan.net> Message-ID: Thanks for the patch. Committed. Rob > -----Original Message----- > From: fastcgi-developers-bounces+robs=saccoccio.org at mailman.fastcgi.com > [mailto:fastcgi-developers-bounces+robs=saccoccio.org at mailman.fastcgi.com] > On Behalf Of Tom Donovan > Sent: Tuesday, August 26, 2008 8:58 AM > To: fastcgi-developers at mailman.fastcgi.com > Subject: Re: [FASTCGI] apache 2.2+fastcgi+cgicc > > Jay Sprenkle wrote: > > Good evening all, > > > > I'm trying to get a fastcgi+cgicc application working and I've run > > into a snag. I'm not sure if it's a bug or I'm using the code > > incorrectly. Any suggestions would be appreciated. > > > > Here's the setup: > > Apache 2.x (latest version, running on windows xp) is configured to > > start a single instance of my fastcgi application and communicate over > > a tcp connection. I picked a random port in the 9000 range. > > > ... > > > > if((GetStdHandle(STD_OUTPUT_HANDLE) == INVALID_HANDLE_VALUE) && > > (GetStdHandle(STD_ERROR_HANDLE) == INVALID_HANDLE_VALUE) && > > (GetStdHandle(STD_INPUT_HANDLE) != INVALID_HANDLE_VALUE) ) > > > > Is this a bug in the fastcgi dll/Apache or am I using it wrong? > > > > Apache 2.2.9 included APR 1.3, which introduced an incompatible change to > the way processes are > created on Windows. You will need to change mod_fastcgi and rebuild it > for Apache 2.2.9 or higher. > > Starting with Apache 2.2.9, it is necessary to call apr_procattr_io_set() > to correctly configure > stdin, stdout, and stderr for fastcgi programs before calling > apr_procattr_child_in_set(). > > Here is a patch to fcgi_pm.c which will make mod_fastcgi compatible with > Apache 2.2.9+. > The patch affects the WIN32 portion of fcgi_pm.c, as this problem is > specific to Windows. > > -tom- > > --- fcgi_pm.c 2004-04-14 22:01:26.000000000 -0400 > +++ fcgi_pm.c 2008-08-26 08:22:15.856008700 -0400 > @@ -559,6 +559,10 @@ > if (apr_os_file_put(&file, &listen_handle, 0, tp)) > goto CLEANUP; > > + /* required for APR 1.3+ */ > + if (apr_procattr_io_set(procattr, APR_FULL_BLOCK, APR_NO_FILE, > APR_NO_FILE)) > + goto CLEANUP; > + > /* procattr is opaque so we have to use this - unfortuantely it dups > */ > if (apr_procattr_child_in_set(procattr, file, NULL)) > goto CLEANUP; > > > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers at mailman.fastcgi.com > http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers From robs at fastcgi.com Sun Sep 21 15:35:46 2008 From: robs at fastcgi.com (Rob Saccoccio) Date: Sun, 21 Sep 2008 15:35:46 -0400 Subject: [FASTCGI] [Patch] Improve handling of interrupted system calls In-Reply-To: <4898D689.10803@kippdata.de> References: <4898D689.10803@kippdata.de> Message-ID: Hi Rainer. Thanks for the patches. Comments below. > A) After select() in socket_io() indicates, that the response can be > read, but the following readv() in fcgi_buf_socket_recv() returns with > EAGAIN. Normally this should not happen, but it isn't forbidden and at > least on AIX 5.2 we noticed exactly this behaviour. It only showed up > sporadically, but when it happens, because mod_fastcgi aborts the > request we get status codes 500. Your EAGAIN handling doesn't appear to do what you intended. As written, the request is prematurely terminated without setting an error. Moving the break up into the else clause is what I think you wanted. > B) select() in socket_io() can return with EINTR. We implemented a retry > loop, which sleep 1 second and loops max 10 times in order to prevent a > non terminating loop. We also noticed this behaviour on AIX 5.2 under > stress (sporadically). The loop never ran more than twice. I've incorporated handling for EINTR on the select(). I removed the sleep(). Is there a reason you believe that it is required? Rob From robs at fastcgi.com Sun Sep 21 15:36:02 2008 From: robs at fastcgi.com (Rob Saccoccio) Date: Sun, 21 Sep 2008 15:36:02 -0400 Subject: [FASTCGI] Apache 2 Bug (Patch Included) In-Reply-To: <5C8E26AD-87F2-4B5E-A4D2-ADAD69FF5111@i5invest.com> References: <5C8E26AD-87F2-4B5E-A4D2-ADAD69FF5111@i5invest.com> Message-ID: Hi Philipp. Thanks for the patch. I've incorporated the EOS bucket changes, but I don't understand the "Accept-Encoding" changes for redirects. Please explain. If you send another patch, please use the unified format (diff -u). Rob _____ From: fastcgi-developers-bounces+robs=chelsea.net at fastcgi.com [mailto:fastcgi-developers-bounces+robs=chelsea.net at fastcgi.com] On Behalf Of Philipp Dunkel Sent: Tuesday, January 22, 2008 5:16 PM To: fastcgi-developers at fastcgi.com Subject: [FASTCGI] Apache 2 Bug (Patch Included) Hi everyone, we are using mod_fastcgi for a project of ours and found that we were having problems using OutputFilters under Apache2. After some analysis the problem seemed to be that mod_fastcgi would not correctly terminate the bucket brigades it sends down the filter chain. It would never ever send an EOS bucket. Due to this OutputFilters such as mod_deflate would get screwed up. I have attached a patch to this email that fixes the problem for us in the hopes that it may be useful for the community at large. If you have any questions about what is being done here, feel free to mail me at any time. And of course I release all rights to anything in this patch to the community of mod_fastcgi under the same license as mod_fastcgi. Regards, Philipp Dunkel -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris_se at gmx.net Sun Sep 21 16:00:49 2008 From: chris_se at gmx.net (Christian Seiler) Date: Sun, 21 Sep 2008 22:00:49 +0200 Subject: [FASTCGI] [PATCH] Updated patch for -pass-header correct handling In-Reply-To: References: <48B62EA6.8070407@gmx.net> Message-ID: <48D6A7F1.5040408@gmx.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Rob, > The existing -pass-header implementation works as intended. To pass the > HTTP_AUTHORIZATION header, you have to specify "-pass-header > HTTP_AUTHORIZATION (not "-pass-header AUTHORIZATION"). I don't mean to offend, but have you actually tried this? Let me make a very concrete example: I take a standard mod_fastcgi 2.4.6 and a standard PHP install with default configuration and the following PHP script: Then I load the script, enter some dummy credentials when the browser shows the auth dialog for the first time and hit cancel for the second time, I get the following results: 1) FastCgiConfig -pass-header HTTP_AUTHORIZATION No additional CGI environment variable is passed to PHP (note that this does not even consider whether PHP interprets them correctly or not, there simply is no additional variable there) 2) FastCgiConfig -pass-header AUTHORIZATION An additional variable "AUTHORIZATION" with the contents of the Authorization header is added to the CGI environment passed to PHP. Also, this is consistent with the code of mod_fastcgi, see , lines 180 an following: for ( ; i; --i, ++elt) { const char *val = ap_table_get(fr->r->headers_in, *elt); if (val) { ap_table_setn(fr->r->subprocess_env, *elt, val); } } If I supply -pass-header FOO, this code would look up FOO in fr->r->headers_in (which contains the raw HTTP header names unencoded, i.e. ap_table_get(fr->r->headers_in, "Host") will work but ap_table_get(fr->r->headers_in, "HTTP_HOST") won't!) and then it will set the environment variable FOO in the subprocess_env so it can be passed to the FastCGI process. It will not change the header name at all. So, if you do -pass-header HTTP_AUTHORIZATION, mod_fastcgi will try to lookup the HTTP header HTTP_AUTHORIZATION which is not sent by the browser (a browser would actually have to send "HTTP_AUTHORIZATION: foo" in order for such a header to appear in headers_in) and since it's not set, it does nothing. If you do -pass-header AUTHORIZATION, mod_fastcgi will try to lookup the HTTP header AUTHORIZATION, which is sent by the browser, but then it will set the CGI env variable with the name AUTHORIZATION. If you compare this to the normal Apache code that copies the HTTP headers to the standard CGI environment (and leaves out AUTHORIZATION for security purposes which don't apply to FastCGI), you will see that the standard code uppercases all header names, replaces all non-alnum chars with underscores and prepends HTTP_ in front of the header name before it sets the environment variable name - which is exactly what the CGI spec requires. My patch does exactly this for mod_fastcgi with -pass-header. I hope I could make my point clearer now. > Consistent with mod_cgi, I have incorporated support for duplicate > Status/Location/ContentType headers being returned by the application. Thanks. Regards, Christian -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjWp/EACgkQ5l5dzJmLNGUeCgCfRCLF85+do3HZOJg53wL1v1KR fRkAn3HBZBBQa4RNZVyKVFP8zdZAz3q2 =vU0F -----END PGP SIGNATURE----- From robs at fastcgi.com Sun Sep 21 16:05:54 2008 From: robs at fastcgi.com (Rob Saccoccio) Date: Sun, 21 Sep 2008 16:05:54 -0400 Subject: [FASTCGI] mod_fastcgi - testing help please Message-ID: <2136A30FEB454EC49C8836AB3F6E35C6@maisel> I believe that I have incorporated all outstanding mod_fastcgi patches. If I missed yours, please repost. I no longer use FastCGI in my work (I no longer do web related development) and thus need testing support. Please report successes and difficulties to the list. Once it appears to have passed, I'll tag and roll it as 2.4.8. A snapshot that can be found in the usual place: http://www.fastcgi.com/dist/ Rob From robs at saccoccio.org Sun Sep 21 16:14:36 2008 From: robs at saccoccio.org (Rob Saccoccio) Date: Sun, 21 Sep 2008 16:14:36 -0400 Subject: [FASTCGI] [PATCH] Updated patch for -pass-header correct handling In-Reply-To: <48D6A7F1.5040408@gmx.net> References: <48B62EA6.8070407@gmx.net> <48D6A7F1.5040408@gmx.net> Message-ID: > > The existing -pass-header implementation works as intended. To pass the > > HTTP_AUTHORIZATION header, you have to specify "-pass-header > > HTTP_AUTHORIZATION (not "-pass-header AUTHORIZATION"). > > I don't mean to offend, but have you actually tried this? No offense taken. I haven't tried it since writing it many many years ago. Your prior emails weren't as clear as what your saying here. I'll have a closer look at it this evening. Rob From apex at xepa.nl Sun Sep 21 17:07:34 2008 From: apex at xepa.nl (Michiel Brandenburg) Date: Sun, 21 Sep 2008 23:07:34 +0200 Subject: [FASTCGI] [PATCH] Updated patch for -pass-header correct handling In-Reply-To: <48D6A7F1.5040408@gmx.net> References: <48B62EA6.8070407@gmx.net> <48D6A7F1.5040408@gmx.net> Message-ID: <48D6B796.90005@xepa.nl> Christian Seiler wrote: > So, if you do -pass-header HTTP_AUTHORIZATION, mod_fastcgi will try to > lookup the HTTP header HTTP_AUTHORIZATION which is not sent by the > browser (a browser would actually have to send "HTTP_AUTHORIZATION: foo" > in order for such a header to appear in headers_in) and since it's not > set, it does nothing. > > If you do -pass-header AUTHORIZATION, mod_fastcgi will try to lookup the > HTTP header AUTHORIZATION, which is sent by the browser, but then it > will set the CGI env variable with the name AUTHORIZATION. I use mod_fcgid (long story) and have noticed the same "bug" there too. I too have had to patch the source to pass the AUTH header as HTTP_AUTH to cgi's, did not know this also relates to other client headers. But I like ur patch Christian, lots cleaner than my hack. It fixes the issue, my hack only sidesteps it. Once this commes out to the repositories I will restart the fcgid vs fastcgi discussion at work again :) I seem to remember another bug propping up on php4, what version did u try with your example ? I did patch our binaries long long time ago and I can't quite remember why I added extra code to decode the Auth header and pass it's components (PHP_AUTH_USER/PHP_AUTH_PW) to php4. Keep up the good work -- Michiel From robs at saccoccio.org Sun Sep 21 20:18:01 2008 From: robs at saccoccio.org (Rob Saccoccio) Date: Sun, 21 Sep 2008 20:18:01 -0400 Subject: [FASTCGI] [PATCH] Updated patch for -pass-header correct handling In-Reply-To: <48D6A7F1.5040408@gmx.net> References: <48B62EA6.8070407@gmx.net> <48D6A7F1.5040408@gmx.net> Message-ID: Yep. Right you are. Patch committed. Thanks for the clarification. Rob > -----Original Message----- > From: Christian Seiler [mailto:chris_se at gmx.net] > Sent: Sunday, September 21, 2008 4:01 PM > To: Rob Saccoccio > Cc: fastcgi-developers at mailman.fastcgi.com > Subject: Re: [FASTCGI] [PATCH] Updated patch for -pass-header correct > handling > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Rob, > > > The existing -pass-header implementation works as intended. To pass the > > HTTP_AUTHORIZATION header, you have to specify "-pass-header > > HTTP_AUTHORIZATION (not "-pass-header AUTHORIZATION"). > > I don't mean to offend, but have you actually tried this? > > Let me make a very concrete example: I take a standard mod_fastcgi 2.4.6 > and a standard PHP install with default configuration and the following > PHP script: > > > > > Header ('Status: 401 Authorization required'); > Header ('WWW-Authenticate: Basic realm="Test"'); > > phpinfo(INFO_VARIABLES); > > ?> > > Then I load the script, enter some dummy credentials when the browser > shows the auth dialog for the first time and hit cancel for the second > time, I get the following results: > > 1) FastCgiConfig -pass-header HTTP_AUTHORIZATION > > No additional CGI environment variable is passed to PHP (note that this > does not even consider whether PHP interprets them correctly or not, > there simply is no additional variable there) > > 2) FastCgiConfig -pass-header AUTHORIZATION > > An additional variable "AUTHORIZATION" with the contents of the > Authorization header is added to the CGI environment passed to PHP. > > Also, this is consistent with the code of mod_fastcgi, see > , lines 180 an > following: > > for ( ; i; --i, ++elt) { > const char *val = ap_table_get(fr->r->headers_in, *elt); > if (val) { > ap_table_setn(fr->r->subprocess_env, *elt, val); > } > } > > If I supply -pass-header FOO, this code would look up FOO in > fr->r->headers_in (which contains the raw HTTP header names unencoded, > i.e. ap_table_get(fr->r->headers_in, "Host") will work but > ap_table_get(fr->r->headers_in, "HTTP_HOST") won't!) and then it will > set the environment variable FOO in the subprocess_env so it can be > passed to the FastCGI process. It will not change the header name at all. > > So, if you do -pass-header HTTP_AUTHORIZATION, mod_fastcgi will try to > lookup the HTTP header HTTP_AUTHORIZATION which is not sent by the > browser (a browser would actually have to send "HTTP_AUTHORIZATION: foo" > in order for such a header to appear in headers_in) and since it's not > set, it does nothing. > > If you do -pass-header AUTHORIZATION, mod_fastcgi will try to lookup the > HTTP header AUTHORIZATION, which is sent by the browser, but then it > will set the CGI env variable with the name AUTHORIZATION. > > If you compare this to the normal Apache code that copies the HTTP > headers to the standard CGI environment (and leaves out AUTHORIZATION > for security purposes which don't apply to FastCGI), you will see that > the standard code uppercases all header names, replaces all non-alnum > chars with underscores and prepends HTTP_ in front of the header name > before it sets the environment variable name - which is exactly what the > CGI spec requires. > > My patch does exactly this for mod_fastcgi with -pass-header. I hope I > could make my point clearer now. > > > Consistent with mod_cgi, I have incorporated support for duplicate > > Status/Location/ContentType headers being returned by the application. > > Thanks. > > Regards, > Christian > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2.0.9 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iEYEARECAAYFAkjWp/EACgkQ5l5dzJmLNGUeCgCfRCLF85+do3HZOJg53wL1v1KR > fRkAn3HBZBBQa4RNZVyKVFP8zdZAz3q2 > =vU0F > -----END PGP SIGNATURE----- From Tom at tomdonovan.net Mon Sep 22 08:13:26 2008 From: Tom at tomdonovan.net (Tom Donovan) Date: Mon, 22 Sep 2008 08:13:26 -0400 Subject: [FASTCGI] apache 2.2+fastcgi+cgicc In-Reply-To: References: <1b5f39a10808252130g4104cccfodfb7d80048f4a241@mail.gmail.com> <48B3FDC8.6030302@tomdonovan.net> Message-ID: <48D78BE6.4070709@tomdonovan.net> Rob Saccoccio wrote: > Thanks for the patch. Committed. > > Rob ... >> Apache 2.2.9 included APR 1.3, which introduced an incompatible change to >> the way processes are >> created on Windows. You will need to change mod_fastcgi and rebuild it >> for Apache 2.2.9 or higher. >> >> Starting with Apache 2.2.9, it is necessary to call apr_procattr_io_set() >> to correctly configure >> stdin, stdout, and stderr for fastcgi programs before calling >> apr_procattr_child_in_set(). Your patch for Win32 in mod_fastcgi-SNAP-0809220636 doesn't work because of the test for the APR version numbers: #if (APR_MAJOR_VERSION >= 1) && (APR_MINOR_VERSION >= 3) You will need to include apr_version.h (when APACHE2 and WIN32 are both defined) for this. Your patch works OK with Apache 2.2.9 with the following change. -tom- --- fcgi_pm.c 2008-09-21 11:38:10.000000000 -0400 +++ fcgi_pm.c 2008-09-22 08:05:32.398419400 -0400 @@ -32,6 +32,7 @@ #ifdef WIN32 #ifdef APACHE2 #include "mod_cgi.h" +#include "apr_version.h" #endif #pragma warning ( disable : 4100 4102 ) static BOOL bTimeToDie = FALSE; /* process termination flag */ From robs at saccoccio.org Mon Sep 22 18:27:42 2008 From: robs at saccoccio.org (Rob Saccoccio) Date: Mon, 22 Sep 2008 18:27:42 -0400 Subject: [FASTCGI] apache 2.2+fastcgi+cgicc In-Reply-To: <48D78BE6.4070709@tomdonovan.net> References: <1b5f39a10808252130g4104cccfodfb7d80048f4a241@mail.gmail.com> <48B3FDC8.6030302@tomdonovan.net> <48D78BE6.4070709@tomdonovan.net> Message-ID: <4034C8B38EA24CF48F40539FD0165543@maisel> Thanks. Committed. A new snap is now available: http://fastcgi.com/dist/ Rob > -----Original Message----- > From: Tom Donovan [mailto:Tom at tomdonovan.net] > Sent: Monday, September 22, 2008 8:13 AM > To: fastcgi-developers at mailman.fastcgi.com > Cc: Rob Saccoccio > Subject: Re: [FASTCGI] apache 2.2+fastcgi+cgicc > > Rob Saccoccio wrote: > > Thanks for the patch. Committed. > > > > Rob > ... > >> Apache 2.2.9 included APR 1.3, which introduced an incompatible change > to > >> the way processes are > >> created on Windows. You will need to change mod_fastcgi and rebuild > it > >> for Apache 2.2.9 or higher. > >> > >> Starting with Apache 2.2.9, it is necessary to call > apr_procattr_io_set() > >> to correctly configure > >> stdin, stdout, and stderr for fastcgi programs before calling > >> apr_procattr_child_in_set(). > > > Your patch for Win32 in mod_fastcgi-SNAP-0809220636 doesn't work because > of the test for the APR > version numbers: > > #if (APR_MAJOR_VERSION >= 1) && (APR_MINOR_VERSION >= 3) > > You will need to include apr_version.h (when APACHE2 and WIN32 are both > defined) for this. > Your patch works OK with Apache 2.2.9 with the following change. > > -tom- > > --- fcgi_pm.c 2008-09-21 11:38:10.000000000 -0400 > +++ fcgi_pm.c 2008-09-22 08:05:32.398419400 -0400 > @@ -32,6 +32,7 @@ > #ifdef WIN32 > #ifdef APACHE2 > #include "mod_cgi.h" > +#include "apr_version.h" > #endif > #pragma warning ( disable : 4100 4102 ) > static BOOL bTimeToDie = FALSE; /* process termination flag */ > > > From davidb at pins.net Tue Sep 23 11:29:31 2008 From: davidb at pins.net (David Birnbaum) Date: Tue, 23 Sep 2008 11:29:31 -0400 (EDT) Subject: [FASTCGI] SNAP Message-ID: 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. From adsarebad at gmail.com Fri Sep 26 00:28:12 2008 From: adsarebad at gmail.com (adsarebad at gmail.com) Date: Thu, 25 Sep 2008 21:28:12 -0700 Subject: [FASTCGI] 500 Internal Server Error Message-ID: <48DC64DC.9090905@gmail.com> Hello all, I have looked around for a few hours and can`t figure out whats wrong. Debian etch server with apache. In my log file I get [Thu Sep 25 21:05:53 2008] [error] [client 24.113.12.97] (111)Connection refused: FastCGI: failed to connect to server "/tmp/2rbetter_archives.fcgi": connect() failed [Thu Sep 25 21:05:53 2008] [error] [client 24.113.12.97] FastCGI: incomplete headers (0 bytes) received from server "/tmp/2rbetter_archives.fcgi" I am trying to use catalyst in Standalone server mode as talked about http://search.cpan.org/~zarquon/Catalyst-Manual-5.7013/lib/Catalyst/Manual/Cookbook.pod#Standalone_server_mode So I started a fastcgi server /home/jmbetter/archives/script/archives_fastcgi.pl -l /tmp/2rbetter_archives.socket -n 5 -p /tmp/2rbetter_archives.pid -d I added some stuff to my apache virtual host config (before ) FastCgiExternalServer /tmp/2rbetter_archives.fcgi -socket /tmp/2rbetter_archives.socket and inside the # 502 is a Bad Gateway error, and will occur if the backend server is down # This allows us to display a friendly static page that says "down for # maintenance" Alias /_errors /var/www/MyApp/root/error-pages ErrorDocument 502 /_errors/502.html #Options +ExecCGI Alias /archives/ /tmp/2rbetter_archives.fcgi/ RewriteRule ^/archives$ archives/ [R] I also tried making the www-data group able to rwx in /home/jmbetter/archives. The server was started as the jmbetter user. Do I have some other permision issue here? The socket srwxrwxrwx 1 jmbetter jmbetter 0 2008-09-25 18:49 /tmp/2rbetter_archives.socket The files inside /home/jmbetter/archives (as seen with getfacl) # file: archives # owner: jmbetter # group: jmbetter user::rwx group::r-x group:www-data:rwx mask::rwx other::r-x Any idea whats going on? Thanks! From robs at fastcgi.com Fri Sep 26 07:52:18 2008 From: robs at fastcgi.com (Rob Saccoccio) Date: Fri, 26 Sep 2008 07:52:18 -0400 Subject: [FASTCGI] 500 Internal Server Error In-Reply-To: <48DC64DC.9090905@gmail.com> References: <48DC64DC.9090905@gmail.com> Message-ID: Have you tried the "easier" method (#2) in the Catalyst link you provided? That allows mod_fastcgi to start the Catalyst processes (and to construct the unix domain socket). WRT standalone server mode, my guess is that the problem your seeing is permissions related. Make sure that the socket's file permissions grant the user/group your running httpd as with access or try using a TCP port instead. 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 adsarebad at gmail.com > Sent: Friday, September 26, 2008 12:28 AM > To: fastcgi-developers at mailman.fastcgi.com > Subject: [FASTCGI] 500 Internal Server Error > > Hello all, > > I have looked around for a few hours and can`t figure out whats wrong. > Debian etch server with apache. In my log file I get > > [Thu Sep 25 21:05:53 2008] [error] [client 24.113.12.97] (111)Connection > refused: FastCGI: failed to connect to server > "/tmp/2rbetter_archives.fcgi": connect() failed > [Thu Sep 25 21:05:53 2008] [error] [client 24.113.12.97] FastCGI: > incomplete headers (0 bytes) received from server > "/tmp/2rbetter_archives.fcgi" > > > I am trying to use catalyst in Standalone server mode as talked about > http://search.cpan.org/~zarquon/Catalyst-Manual- > 5.7013/lib/Catalyst/Manual/Cookbook.pod#Standalone_server_mode > > So I started a fastcgi server > /home/jmbetter/archives/script/archives_fastcgi.pl -l > /tmp/2rbetter_archives.socket -n 5 -p /tmp/2rbetter_archives.pid -d > > I added some stuff to my apache virtual host config (before *:80>) > FastCgiExternalServer /tmp/2rbetter_archives.fcgi -socket > /tmp/2rbetter_archives.socket > > and inside the > > # 502 is a Bad Gateway error, and will occur if the backend server is > down > # This allows us to display a friendly static page that says "down for > # maintenance" > Alias /_errors /var/www/MyApp/root/error-pages > ErrorDocument 502 /_errors/502.html > > #Options +ExecCGI > Alias /archives/ /tmp/2rbetter_archives.fcgi/ > RewriteRule ^/archives$ archives/ [R] > > I also tried making the www-data group able to rwx in > /home/jmbetter/archives. The server was started as the jmbetter user. > Do I have some other permision issue here? The socket > srwxrwxrwx 1 jmbetter jmbetter 0 2008-09-25 18:49 > /tmp/2rbetter_archives.socket > > The files inside /home/jmbetter/archives (as seen with getfacl) > # file: archives > # owner: jmbetter > # group: jmbetter > user::rwx > group::r-x > group:www-data:rwx > mask::rwx > other::r-x > > Any idea whats going on? > > Thanks! > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers at mailman.fastcgi.com > http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers From david at davidpashley.com Mon Sep 29 03:38:02 2008 From: david at davidpashley.com (David Pashley) Date: Mon, 29 Sep 2008 08:38:02 +0100 Subject: [FASTCGI] SetHandler and AddHandler ignored Message-ID: <20080929073801.GS20331@femme.catnip.org.uk> 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.