nginx + .cgi/perl scripts...

Michael nginx at thismetalsky.org
Wed Jul 2 04:52:25 MSD 2008


On Tue, Jul 01, 2008 at 16:55:42, mike said...

> yeah... i tried to use upstart (ubuntu's init replacement) since it's
> already available to me but i can't keep the scripts to persist, i
> don't think the example script on the wiki returns the appropriate
> return codes for a persistent thing like that.
 
Is this an old-school CGI script, or something intentionally built to be a
FastCGI program?  You'd need the latter...  If you don't want to move on to
FCGI::Async, you could at least do this:

use CGI::Fast;

while (my $cgi = CGI::Fast->new()) {
    # your old program here, using $cgi where 
    # you'd use CGI->new() from CGI.pm
}

Then your script will persist.  You'll still have to run it via some other
FastCGI starting program, like the one that's included with lighttpd, I think
it was 'spawn-fcgi'.

I prefer to build them from the ground up to be FastCGI programs myself, but
this works in a pinch.

-- 
Michael Stella  |  IT Systems Architect  
PGP: 1024D/BC3FF6D4 2BC2 A79B 88D1 218A B32B  ED7A 2EC2 1206 BC3F F6D4
the cake is a lie





More information about the nginx mailing list