[Haskell-cafe] Re: Question about fastcgi

Colin Paul Adams colin at colina.demon.co.uk
Fri Nov 28 10:15:46 EST 2008

>>>>> "ChrisK" == ChrisK  <haskell at list.mightyreason.com> writes:

    ChrisK> Er, no.  A fastcgi executable is (like a cgi executable)
    ChrisK> controlled by the front end web server.  I run my fastcgi
    ChrisK> using Apache as the front end.  The front end web server
    ChrisK> will control things like the port number.

There are different ways to run a FasctCGI executable (three if my
memory serves me correctly). 
I have only ever written FasctCGI executables (not in Haskell) when
the server accepts a port number at start up, and is started
independently of Apache (or whatever). And Apache is told which port
numbers it will find the servers on.

    ChrisK> Mauricio wrote:
    >> Hi,
    >> I'm learnng to use fastcgi and, reading the examples, I see the
    >> main "loop" is like this:
    >> main = runFastCGI my_work
    >> However, isn't a fastcgi program supposed to choose a port
    >> where to listen to calls? For instance, in this C example:
    >> xzdev.com/nginx_fastcgi.html
    >> doesn't the line
    >> listen_socket = FCGX_OpenSocket(":8002", 2000);
    >> says it's listening to port 8002? I read the code for fastcgi,
    >> from hackage, and I can't find anything related to ports like,
    >> for instance, a default port.  Am I understanding something the
    >> wrong way?
    >> Thanks, Maurício
Colin Adams
Preston Lancashire

More information about the Haskell-Cafe mailing list