[FASTCGI] Configuring FastCGI app
Rob Saccoccio
robs at fastcgi.com
Tue Oct 7 16:30:04 EDT 2008
That error is coming from the fastcgi library in your application.
If the message is going to the httpd log (and you haven't piped output from
your application there when you started it), then mod_fastcgi is starting
it. Mod_fastcgi will bind and listen and then exec your application which
of course tries to bind and listen again.
FastCgiExternalServer won't start an application. So you've either got
something else in your config or you've piped stderr to the httpd log when
you started the application. If it’s the latter (you shouldn't do that),
you've probably already got a copy of your application running.
> -----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 Alexander Galkin (Audible US)
> Sent: Tuesday, October 07, 2008 1:21 PM
> To: David Birnbaum
> Cc: fastcgi-developers at mailman.fastcgi.com
> Subject: Re: [FASTCGI] Configuring FastCGI app
>
> I configured apache to use my FastCGI app as external server
>
> In httpd.conf
>
> LoadModule fastcgi_module /opt/apache/modules/mod_fastcgi.so
> FastCgiExternalServer /opt/apache/htdocs -host localhost:9005
>
> I call
>
> FCGX_Init();
> int socket = FCGX_OpenSocket(":9005", 100);
>
> In each thread of my multithreaed FastCGI app I call
> FCGX_InitRequest(&request, socket, 0);
>
> I start my FastCGI server and I verify it is listening on 9005 port. I
> start Apache server and everything seems to be OK
>
> [Tue Oct 07 13:02:16 2008] [notice] Digest: generating secret for digest
> authentication ...
> [Tue Oct 07 13:02:16 2008] [notice] Digest: done
> [Tue Oct 07 13:02:16 2008] [notice] FastCGI: process manager initialized
> (pid 20281)
> [Tue Oct 07 13:02:17 2008] [notice] Apache configured -- resuming normal
> operations
>
> Now when I try access URL that invokes the FastCGI app I get error in
> Apache log file
> bind/listen: Address already in use
>
> I am not why I am getting this error.
>
> -----Original Message-----
> From: David Birnbaum [mailto:davidb at pins.net]
> Sent: Monday, October 06, 2008 12:57 PM
> To: Alexander Galkin (Audible US)
> Cc: fastcgi-developers at mailman.fastcgi.com
> Subject: RE: [FASTCGI] Configuring FastCGI app
>
> Alexander,
>
> In that case, set it up as a FastCgiExternalServer and have mod_fastcgi
> connect
> to a UNIX or TCP socket.
>
> David.
>
> -----
>
> On Mon, 6 Oct 2008, Alexander Galkin (Audible US) wrote:
>
> > I am fine with starting my FastCGI app myself. However, when Apache
> server is shut down and restarted I want mod_fastcgi to re-connect to the
> running instance of my FastCGI app.
> >
> >
> >
> > -----Original Message-----
> > From: David Birnbaum [mailto:davidb at pins.net]
> > Sent: Monday, October 06, 2008 11:16 AM
> > To: Alexander Galkin (Audible US)
> > Cc: fastcgi-developers at mailman.fastcgi.com
> > Subject: Re: [FASTCGI] Configuring FastCGI app
> >
> > On Fri, 3 Oct 2008, Alexander Galkin (Audible US) wrote:
> >
> >> I have FastCGI app run on Apache 2.0 server on Solaris 10. How do I
> configure
> >> FastCGI to:
> >>
> >> 1. I want only once instance of the app to be running. If the
> instance
> >> crashes or is killed I want mod_fastcgi to restart it.
> >
> > This is controlled with the FastCGI dynamic parameters (see the man
> page).
> >
> >> 2. I want either start the app manually or let mod_fastcgi start it
> upon
> >> request but I do not want it to kill my app when apache server is
> shutting
> >> down.
> >
> > You can't have mod_fastcgi manager you application and expect it to live
> when
> > Apache is shut down. You have to manage it on your own in that case.
> >
> > David.
> >
> _______________________________________________
> FastCGI-developers mailing list
> FastCGI-developers at mailman.fastcgi.com
> http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers
More information about the FastCGI-developers
mailing list