Forum: Ruby fcgi.rb and lighttpd

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Joel VanderWerf (Guest)
on 2009-05-19 03:40
(Received via mailing list)
I'm trying to get ruby code to listen to fastcgi from lighttpd... should
be easy, but ...

The symptom: My ruby program is started up by lighttpd (4 instances, in
fact), but it never gets requests.

The lighttpd config is:

   server.modules   += ( "mod_fastcgi" )

   fastcgi.debug = 1

   fastcgi.server    = ( "/test/" =>
                   "bin-path" => "/home/vjoel/simple.rb",
                   "socket" => "/tmp/ruby.socket"

(I've also tried using ".rb" in place of "/test/".)

The ruby side is adapted from the fcgi documentation:

   #!/usr/bin/env ruby

   require "fcgi""/tmp/simple1.log", "a") {|f| f.puts "step 1"}

   FCGI.each {|request|"/tmp/simple2.log", "a") {|f| f.puts "step 2"}

     out = request.out
     out.print "Content-Type: text/plain\r\n"
     out.print "\r\n"

The "step 1" is written 4 times, as expected, when lighttpd starts. So
lighttpd is aware of fastcgi, and the lib is loading correctly,
as is my simple.rb.

Lighttpd is listening at localhost:80, which is easily verified. (I get
the placeholder page because I have put nothing there.)

However, when I browse to localhost:80/test/something, I get a 404, and
the "step 2" is never written.

All that shows up in the lighttpd log is: the "starting" message, and
the four spawning messages, like this one:

2009-05-18 16:12:44: (mod_fastcgi.c.1332) --- fastcgi spawning
         port: 0
         socket /tmp/ruby.socket
         current: 3 / 4

I feel as if I'm missing something obvious...
Joel VanderWerf (Guest)
on 2009-05-20 01:42
(Received via mailing list)
Joel VanderWerf wrote:
>   fastcgi.debug = 1
>   fastcgi.server    = ( "/test/" =>
>           ((
>                   "bin-path" => "/home/vjoel/simple.rb",
>                   "socket" => "/tmp/ruby.socket"
>           ))
>   )

For posterity:

Someone on the lighttpd forum pointed out that the fastcgi.server config
needs this line:

                 "check-local" => "disable"
This topic is locked and can not be replied to.