Re: Can FCGI module run automatically?
Rob <[email protected]> Wed, 08 Sep 2010 18:23:57 -0500
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
On 09/08/2010 04:52 PM, Rob wrote: > On 09/08/2010 03:12 AM, Omar Li wrote: >> Hi , All, >> Can FCGI module run automatically without web server's operating(such >> as apache)? >> The FCGI module is in the directory /fcgi-bin/ of Apache, e.g. >> echo.fcgi. >> Now echo.fcgi will be started only when the first request comes since >> Apache's beginning running. Then it goes long-lively. >> Can it run when without a request? E.g. echo.fcgi will run when >> Apache runs. >> And what should I do? >> Thanks. > To run an FastCGI server app without apache operating, you would set > up a FastCGIExternalServer. > > We use the lower level interface to FastCGI from <fcgiapp.h>: > > Create a Unix Domain socket with FCGX_OpenSocket() and ensure the > permissions on the socket file permit the apache2 user to read/write > to it. > > Then pass the socket to FCGX_InitRequest(). Also, you will need to arrange for your FastCGI server app to be started automatically, such as a /etc/init.d script. I like to use daemontools for this instead of init scripts because it also includes log file capture and rotation.