So I am following this guide: http://technotes.1000lines.net/?p=23 and I am going through the steps. I have a VPN (slicehost.com) with Debian Etch, serving a website (static so far) with nginx. I used wget to download FastCGI and I did the usual make make install routine.
So I guess since FastCGI can't normally run CGI scripts you have to use some type of perl wrapper to interpret the perl.
Now I run this script
http://technotes.1000lines.net/fastcgi-wrapper.pl
and I run into the exact same problem that a person ran into on the page that the script was submitted:
http://www.ruby-forum.com/topic/145858
(I'm not a ruby person and there is nothing ruby oriented in there)
I keep getting a
# bind/listen: No such file or directory
And I have no idea how to proceed. I would appreciate any help and I can give any more details that anyone would need.
The webserver needs a Unix domain socket to connect to the FastCGI application, but the socket can't be created. Most likely the directory you want it to be in doesn't exist (because they are automatically created when you do a bind
).
Leon is exactly correct. There are two prerequisites for allowing the socket to listen:
- Make sure the socket directory exists.
This is defined in the fastcgi-wrapper.pl script as /var/run/nginx/perl_cgi-dispatch.sock. Therefore, you will need to make sure /var/run/nginx exists.
- Make sure the socket directory is owned by the same user that the fastcgi-wrapper.pl is being executed as.
I'm gonna try and "water down" fastcgi-wrapper.pl, so it can be used with spawn-fcgi.
I use two of those sockets allready:
spawn-fcgi -C 3 -u www-data -s /var/run/php-fcgi.sock -P /var/run/php-fcgi.pid -- /usr/bin/php5-cgi
spawn-fcgi -F 3 -u www-data -s /var/run/lua-fcgi.sock -P /var/run/lua-fcgi.pid -- /usr/bin/wsapi.fcgi
Inside /var/run I have:
-rw-r--r-- 1 root root 14 2010-08-07 12:14 /var/run/lua-fcgi.pid
srwxr-xr-x 1 www-data www-data 0 2010-08-07 12:14 /var/run/lua-fcgi.sock=
-rw-r--r-- 1 root root 4 2010-08-07 12:14 /var/run/php-fcgi.pid
srwxr-xr-x 1 www-data www-data 0 2010-08-07 12:14 /var/run/php-fcgi.sock=
I can easily start and stop the FastCGI wrappers, and I want to do that with Perl too.
If anyone has already a script, that works with spawn-fcgi, I'd be happt to use that, or at least have a look at it.
Cheers,
--polemon