Im running CentOS 6.2
, Nginx 1.2.3
following these Linode Instructions to get Perl
to work with Nginx
I've done everything upto the point of testing an actual Perl
file. When I do this the browser says:
The page you are looking for is temporarily unavailable.
Please try again later.
And my Nginx error-log
shows the following:
2012/09/02 22:09:58 [error] 20772#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.102, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:8999", host: "192.168.1.10:81"
Im stuck at this point. Im not sure if it matters but I also have spawn-fcgi
and php-fpm
to serve up PHP
files on this site, but that should be 100% seperate from the perl-fastcgi
setup, different port, etc..
How can I troubleshoot this?
returned the error
This means that nothing is actually listening on that port.
The most likely cause is that you didn't actually start the
perl-fastcgi
service.Can you reach the fastcgi daemon via its public IP adress? At the moment you gave the localhost address in the nginx config, maybe it only listens on the public network interface.
I believe the answer was a socket permission issue.
In my fastcgi-wrapper.pl there were the following two lines:
When I uncomment the TCPIP socket and comment the Unix Socket line the script works. I beleive this is because my NGINX user did not have the correct permissions to use
/var/run/nginx/perl_cgi-dispatch.sock
I thought
root
was running nginx, but maybe it's not, Im not sure of that yet.================================================
EDIT: The root user did have access to the socket, however my nginx configuration file was not pointing to the socket as @nickgrim mentioned below. I changed the site.conf to the following and the socket correctly ran the perl script (I also changed the fastcgi_wrapper.pl to use the socket again instead of the TCPIP):