Send Beginners mailing list submissions to beginners@haskell.org To subscribe or unsubscribe via the World Wide Web, visit http://www.haskell.org/mailman/listinfo/beginners or, via email, send a message with subject or body 'help' to beginners-requ...@haskell.org
You can reach the person managing the list at beginners-ow...@haskell.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Beginners digest..." Today's Topics: 1. FastCGI error (Wayne R) ---------------------------------------------------------------------- Message: 1 Date: Mon, 9 Aug 2010 11:17:52 -0500 From: Wayne R <reginald.wayne.richa...@gmail.com> Subject: [Haskell-beginners] FastCGI error To: beginners@haskell.org Message-ID: <aanlkti=qjjkajqd4qwxkszugownk6gq=va602qsns...@mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" I'm trying to use Network.FastCGI with Apache2, but running into an error. I'd like to believe that the web server is configured correctly, because I can successfully view the following, compiled to <web root>/fastcgi/test.fcgi: #include <fcgi_stdio.h> int main(void){ int count = 0; while(FCGI_Accept()>=0){ printf("Content-Type: text/html\r\n"); printf("\r\n"); printf("Hello, World: %d", count++); } return 0; } Now I compile Fcgi.hs to <web root>/fastcgi/test2.fcgi: import Control.Concurrent import Network.FastCGI action :: CGI CGIResult action = do setHeader "Content-type" "text/plain" tid <- liftIO myThreadId output $ unlines [ "I am a FastCGI process!" , "Hear me roar!" , "" , show tid ] main = runFastCGIConcurrent' forkIO 10 action When I view localhost/fastcgi/test.fcgi, I get the hello world page, but attempting to view test2.fcgi shows an 'Internal Server Error" in firefox. The apache error log says: [Sun Aug 08 07:44:17 2010] [notice] Apache/2.2.14 (Ubuntu) mod_fastcgi/2.4.6 mod_lisp2/1.3.1 PHP/5.3.2-1ubuntu4.2 with Suhosin-Patch mod_ssl/2.2.14 OpenSSL/0.9.8k configured -- resuming normal operations [Mon Aug 09 11:11:23 2010] [warn] FastCGI: (dynamic) server "/var/www/fastcgi/test.fcgi" started (pid 20354) [Mon Aug 09 11:11:27 2010] [warn] FastCGI: (dynamic) server "/var/www/fastcgi/test2.fcgi" started (pid 20360) [Mon Aug 09 11:11:31 2010] [warn] FastCGI: (dynamic) server "/var/www/fastcgi/test2.fcgi" started (pid 20365) [Mon Aug 09 11:11:34 2010] [warn] FastCGI: (dynamic) server "/var/www/fastcgi/test2.fcgi" started (pid 20371) [Mon Aug 09 11:11:37 2010] [warn] FastCGI: (dynamic) server "/var/www/fastcgi/test2.fcgi" started (pid 20375) [Mon Aug 09 11:11:40 2010] [warn] FastCGI: (dynamic) server "/var/www/fastcgi/test2.fcgi" started (pid 20379) [Mon Aug 09 11:11:43 2010] [warn] FastCGI: (dynamic) server "/var/www/fastcgi/test2.fcgi" started (pid 20383) [Mon Aug 09 11:11:46 2010] [warn] FastCGI: (dynamic) server "/var/www/fastcgi/test2.fcgi" started (pid 20387) [Mon Aug 09 11:11:49 2010] [warn] FastCGI: (dynamic) server "/var/www/fastcgi/test2.fcgi" started (pid 20391) [Mon Aug 09 11:11:52 2010] [warn] FastCGI: (dynamic) server "/var/www/fastcgi/test2.fcgi" started (pid 20395) [Mon Aug 09 11:11:55 2010] [warn] FastCGI: scheduled the start of the last (dynamic) server "/var/www/fastcgi/test2.fcgi" process: reached dynamicMaxClassProcs (10) [Mon Aug 09 11:11:55 2010] [warn] FastCGI: (dynamic) server "/var/www/fastcgi/test2.fcgi" started (pid 20399) [Mon Aug 09 11:12:01 2010] [error] [client 127.0.0.1] FastCGI: comm with (dynamic) server "/var/www/fastcgi/test2.fcgi" aborted: (first read) idle timeout (30 sec) [Mon Aug 09 11:12:01 2010] [error] [client 127.0.0.1] FastCGI: incomplete headers (0 bytes) received from server "/var/www/fastcgi/test2.fcgi" I've tried Fcgi.hs with two different sample FastCGI programs with the same results. Any suggestions? Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/beginners/attachments/20100809/b7cd406e/attachment-0003.html ------------------------------ _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners End of Beginners Digest, Vol 26, Issue 21 *****************************************