hi,
I'm trying to write a FastCGI script with Ruby and Lighttpd.
I'm using ruby-fcgi 0.8.6, ruby 1.8.2 and lighttpd 1.3.11 (Ubuntu-Linux).
I have setup lighttpd with the following parameters
fastcgi.server = (".rb" =>
( "localhost" =>
( "socket" => "/tmp/rb-fastcgi.socket" )
)
)
I wrote a ruby script similar to
http://www.rubygarden.org/ruby?FCGIExternalServer
#!/usr/bin/ruby
FCGI_PURE_RUBY=true
require 'socket'
require 'cgi'
require 'fcgi'
socket = UNIXServer.new('/tmp/rb-fastcgi.socket')
class << socket
alias :oldaccept :accept
def accept
[oldaccept, nil]
end
end
FCGI::Server.new(socket).each_request do |request|
Thread.start {
request.out.print "Content-type: text/html\r\n"
request.out.puts "<html><head><title>Foo</title></head><body><b>Yeah</b></body></html>"
request.finish
}
end
I start the script (as user www-data) and restart lighttpd.
But trying to access the script from a browser does not return any results.
lighttpd's errorlog is empty and the http connection is normal.
Any ideas?
Regards,
Rüdiger Sonderfeld <kingruedi@c-plusplus.de>