Mod_cgi for nginx - anyone?

I tried that also and while it starts multiple instances, if I run them
using user “nobody” I get a 502 Bad Gateway response from Nginx.

This is how I edited the script:

#!/usr/bin/perl

use strict;
use warnings FATAL => qw( all );

use IO::Socket::UNIX;

my $bin_path = ‘/usr/local/bin/fcgiwrap’;
my $socket_path = $ARGV[0] || ‘/tmp/cgi.sock’;
my $num_children = $ARGV[1] || 5;

close STDIN;

unlink $socket_path;
my $socket = IO::Socket::UNIX->new(
Local => $socket_path,
Listen => 10000,
);

die “Cannot create socket at $socket_path: $!\n” unless $socket;

for (1 … $num_children) {
my $pid = fork;
die “Cannot fork: $!” unless defined $pid;
next if $pid;

exec "sudo -u nobody $bin_path";
die "Failed to exec

Jim

On Sun, Feb 08, 2009 at 09:09:44PM +0200, Andrius Semionovas wrote:

this simple script not worked in my server

Works for me (or at least it did when I last checked). What isn’t
working for you? Please provide some details because a “it doesn’t work”
report definitely won’t get you a solution (my crystal ball had to be
RMA’d).

Best regards,
Grzegorz N.

this simple script not worked in my server

On Sun, 08 Feb 2009 20:33:40 +0200, Grzegorz N.

On Sun, Feb 08, 2009 at 02:13:08PM -0500, Jim O. wrote:

I tried that also and while it starts multiple instances, if I run them using user “nobody” I get a 502 Bad Gateway response from Nginx.

Did you see fcgiwrap instances start? On the socket Nginx connects to?
Did you try to collect a strace run from Nginx and/or fcgiwrap?
If you’re still stuck, shoot me an e-mail.

Best regards,
Grzegorz N.

I not remember. But i think, my centos 4.6 miss some libraries or
something else

On Mon, 09 Feb 2009 02:30:27 +0200, Grzegorz N.