无法重启 lighttpd?收到与 fcgi 相关的奇怪错误?

无法重启 lighttpd?收到与 fcgi 相关的奇怪错误?

当我尝试重新启动 lig​​httpd 时收到以下错误。

我正在运行一个 rails 应用程序,当我部署网站的新版本时,我通常会

/etc/init.d/lighttpd restart

以前这个方法总是有效的,直到今天我收到以下错误信息。我不明白这是什么原因造成的,据我所知,我甚至不使用 PHP,我的项目是在 rails 中

2010-10-05 20:57:03: (mod_fastcgi.c.1042) the fastcgi-backend /var/dei/rails/current/public/dispatch.fcgi failed to start:
2010-10-05 20:57:03: (mod_fastcgi.c.1046) child exited with status 1 /var/dei/rails/current/public/dispatch.fcgi
2010-10-05 20:57:03: (mod_fastcgi.c.1049) if you try do run PHP as FastCGI backend make sure you use the FastCGI enabled version.
You can find out if it is the right one by executing 'php -v' and it should display '(cgi-fcgi)' in the output, NOT (cgi) NOR (cli)
For more information check http://www.lighttpd.net/documentation/fastcgi.html#preparing-php-as-a-fastcgi-program
2010-10-05 20:57:03: (mod_fastcgi.c.1351) [ERROR]: spawning fcgi failed.
2010-10-05 20:57:03: (server.c.849) Configuration of plugins failed. Going down.



Debian Version: lenny/sid
Rails Version: Rails 2.3.5
Ruby Version: ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
Lighttpd: lighttpd-1.4.15 (ssl) - a light and fast webserver

答案1

我找到了答案这一页。以下是内容,以防链接失效。

基本上,我需要创建一个具有适当写入权限的 fastcgi.crash.log 文件,这样我所有的问题就解决了。

lighttpd, fcgi, rails and child exited with status 9, 1, 2, 3 or X
By Giulio Turetta

Ok, these errors are not good. They didn’t tell much about what happended.
But you can’t do as I did. Don’t wander on the dark side of the system…
Just try to execute your FCGI as your lighttpd did.
Find your lighttpd user in lighttpd configuration file (debian: /etc/lighttpd/lighttpd.conf).
On my configuration I see:
server.username  = “www-data”

so…

$ su
# cd /my_rails_root/public
# sudo -u www-data ./dispatch.fcgi

Read what’s happen and solve.
That’s all! 

相关内容