I beleive the problem is in your Apache config as your program seems to be correct. You can doublecheck it if use plain CGI instead of FastCGI (just change import and use runCGI) and run the programm from console. You should see the output.<br>

<br><div class="gmail_quote">On Tue, Aug 10, 2010 at 9:35 PM, Wayne R <span dir="ltr">&lt;<a href="mailto:reginald.wayne.richards@gmail.com">reginald.wayne.richards@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

I&#39;m trying to use Network.FastCGI with Apache2, but running into an 
error.  I&#39;d like to believe that the web server is configured correctly,
 because I can successfully view the following, compiled to &lt;web 
root&gt;/fastcgi/test.fcgi:<br>
<br>#include &lt;fcgi_stdio.h&gt;<br><br>int main(void){<br>  int count = 0;<br>  while(FCGI_Accept()&gt;=0){<br>   printf(&quot;Content-Type: text/html\r\n&quot;);<br>   printf(&quot;\r\n&quot;);<br>   printf(&quot;Hello, World: %d&quot;, count++);<br>



  }<br>  return 0;<br>}<br><br>Now I compile Fcgi.hs to &lt;web root&gt;/fastcgi/test2.fcgi:<br><br>import Control.Concurrent<br>import Network.FastCGI<br><br>action :: CGI CGIResult<br>action = do<br>        setHeader &quot;Content-type&quot; &quot;text/plain&quot;<br>



        tid &lt;- liftIO myThreadId<br>        output $ unlines <br>            [ &quot;I am a FastCGI process!&quot;<br>            , &quot;Hear me roar!&quot;<br>            , &quot;&quot;<br>            , show tid<br>


            ]<br>
<br>main = runFastCGIConcurrent&#39; forkIO 10 action<br><br><br>When I view
 localhost/fastcgi/test.fcgi, I get the hello world page, but attempting
 to view test2.fcgi shows an &#39;Internal Server Error&quot; in firefox.  The 
apache error log says:<br>
<br>[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<br>[Mon Aug 09 11:11:23 2010] [warn] FastCGI: (dynamic) server &quot;/var/www/fastcgi/test.fcgi&quot; started (pid 20354)<br>
[Mon Aug 09 11:11:27 2010] [warn] FastCGI: (dynamic) server &quot;/var/www/fastcgi/test2.fcgi&quot; started (pid 20360)<br>[Mon Aug 09 11:11:31 2010] [warn] FastCGI: (dynamic) server &quot;/var/www/fastcgi/test2.fcgi&quot; started (pid 20365)<br>



[Mon Aug 09 11:11:34 2010] [warn] FastCGI: (dynamic) server &quot;/var/www/fastcgi/test2.fcgi&quot; started (pid 20371)<br>[Mon Aug 09 11:11:37 2010] [warn] FastCGI: (dynamic) server &quot;/var/www/fastcgi/test2.fcgi&quot; started (pid 20375)<br>



[Mon Aug 09 11:11:40 2010] [warn] FastCGI: (dynamic) server &quot;/var/www/fastcgi/test2.fcgi&quot; started (pid 20379)<br>[Mon Aug 09 11:11:43 2010] [warn] FastCGI: (dynamic) server &quot;/var/www/fastcgi/test2.fcgi&quot; started (pid 20383)<br>



[Mon Aug 09 11:11:46 2010] [warn] FastCGI: (dynamic) server &quot;/var/www/fastcgi/test2.fcgi&quot; started (pid 20387)<br>[Mon Aug 09 11:11:49 2010] [warn] FastCGI: (dynamic) server &quot;/var/www/fastcgi/test2.fcgi&quot; started (pid 20391)<br>



[Mon Aug 09 11:11:52 2010] [warn] FastCGI: (dynamic) server &quot;/var/www/fastcgi/test2.fcgi&quot; started (pid 20395)<br>[Mon
 Aug 09 11:11:55 2010] [warn] FastCGI: scheduled the start of the last 
(dynamic) server &quot;/var/www/fastcgi/test2.fcgi&quot; process: reached 
dynamicMaxClassProcs (10)<br>
[Mon Aug 09 11:11:55 2010] [warn] FastCGI: (dynamic) server &quot;/var/www/fastcgi/test2.fcgi&quot; started (pid 20399)<br>[Mon
 Aug 09 11:12:01 2010] [error] [client 127.0.0.1] FastCGI: comm with 
(dynamic) server &quot;/var/www/fastcgi/test2.fcgi&quot; aborted: (first read) 
idle timeout (30 sec)<br>
[Mon Aug 09 11:12:01 2010] [error] [client 127.0.0.1] FastCGI: 
incomplete headers (0 bytes) received from server 
&quot;/var/www/fastcgi/test2.fcgi&quot;<br><br>I&#39;ve tried Fcgi.hs with two different sample FastCGI programs with the same results.  Any suggestions?<br><font color="#888888"><font color="#888888">
<br>Wayne</font>
</font><br>_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br>