如何在 Nginx 上使用 FastCGI 运行 Perl 脚本?

发布于 2024-07-10 03:50:51 字数 808 浏览 4 评论 0原文

因此,我遵循本指南:http://technotes.1000lines.net/?p=23 我正在执行这些步骤。 我有一个使用 Debian Etch 的 VPN (slicehost.com),使用 nginx 提供一个网站(到目前为止是静态的)。 我使用 wget 下载 FastCGI,然后执行通常的 make make install 例程。

所以我想既然 FastCGI 不能正常运行 CGI 脚本,你必须使用某种类型的 perl 包装器来解释 perl。

现在我运行这个脚本

http://technotes.1000lines.net/fastcgi-wrapper.pl

我遇到了与某人在提交脚本的页面上遇到的完全相同的问题:

http://www.ruby-forum.com/topic/145858

(我不是一个红宝石人,那里没有任何面向红宝石的东西)

我不断收到一个

# bind/listen: No such file or directory

我不知道如何继续。 我将不胜感激任何帮助,并且我可以提供任何人需要的更多详细信息。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

暮色兮凉城 2024-07-17 03:50:51

Web服务器需要一个Unix域套接字来连接到FastCGI应用程序,但无法创建该套接字。 您想要的目录很可能不存在(因为它们是在您执行绑定时自动创建的)。

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).

林空鹿饮溪 2024-07-17 03:50:51

莱昂是完全正确的。 允许套接字监听有两个先决条件:

  1. 确保套接字目录存在。
  2. 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.

  3. 确保套接字目录由执行 fastcgi-wrapper.pl 的同一用户拥有。

Leon is exactly correct. There are two prerequisites for allowing the socket to listen:

  1. Make sure the socket directory exists.
  2. 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.

  3. Make sure the socket directory is owned by the same user that the fastcgi-wrapper.pl is being executed as.
注定孤独终老 2024-07-17 03:50:51

我要尝试“淡化”fastcgi-wrapper.pl,这样它就可以与 spawn-fcgi

我已经使用了其中两个套接字:

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

在 /var/run 内我有:

-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=

我可以轻松启动和停止 FastCGI 包装器,并且我也想使用 Perl 来做到这一点。

如果有人已经有一个与 spawn-fcgi 一起使用的脚本,我很乐意使用它,或者至少看一下它。

干杯,
——波尔蒙

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文