Re: Manually spawned process and unix domain sockets
Rob <[email protected]> Wed, 17 Aug 2011 11:47:32 -0500
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
On 08/17/2011 09:10 AM, Howard May wrote:
> I would be very grateful for any help or suggestions as to what might
> be going wrong.
I'm not familiar with light, we use the apache2 fastcgi module's
"External Server", which means that Apache does not start or stop our
fastcgi process, Apache only communicates via the port or domain socket.
To eliminate some factors, I might suggest to make sure your app is
running and the domain socket is created before starting lighttpd.
Also, until you get it working, I would suggest to open the permissions
completely on the domain socket by calling "umask(0)" before calling
FCGX_OpenSocket().
Also, you said it's not working, but that could mean anything. If you
can give any evidence such as log entries, error messages, and/or just
describe the behavior that you're seeing, then more help might be possible.
> fastcgi.server = ( "/namedpipetest/" =>
>
> (
>
> (
>
> "socket" =>
> "/var/tmp/lighttpd/wsi-fastcgi.socket",
>
> "check-local" => "disable"
>
> )
>
> )
>
> )
>
>
>
>
>
>
>
> #include <stdio.h>
>
> #include "fcgiapp.h"
>
#include <sys/stat.h>
>
>
>
> void main(int argc, char ** argv)
>
> {
>
> int fd;
>
> int result;
>
> FCGX_Request req;
>
> printf("Fastcgi FIFO test app\n");
>
> result = FCGX_Init();
>
> if(result != 0)
>
> {
>
> printf("FCGX_Init returned %d\n", result);
>
> return;
>
> }
>
int savedmask = umask(0);
>
> fd = FCGX_OpenSocket("/var/tmp/lighttpd/wsi-fastcgi.socket", 16);
>
umask(savedmask);
>
> if(fd == 0)
>
> {
>
> printf("FCGX_OpenSocket returned 0\n");
>
> return;
>
> }
>
> FCGX_InitRequest(&req, fd, 0);
>
>
>
> while((result = FCGX_Accept_r(&req))==0);
>
> {
>
> FCGX_FPrintF(req.out, "Content-type:
> text/html\r\n\r\n<TITLE>Whoop</TITLE>\n");
>
> }
>
> printf("FCGX_Accept_r returned %d\n", result);
>
> return;
>
> }
>
>
>
>
>
>
> _______________________________________________
> FastCGI-developers mailing list
> FastCGI-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org
> http://mailman.fastcgi.com/mailman/listinfo/fastcgi-developers