Lighttpd

不能重啟lighttpd?收到關於 fcgi 的奇怪錯誤?

  • October 6, 2010

當我嘗試重新啟動 lighttpd 時收到以下錯誤。

我正在執行一個 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

我在這一頁找到了答案。這是下面的內容,以防連結失效。

基本上我需要創建一個具有適當寫入權限的 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! 

引用自:https://serverfault.com/questions/187967