Lighttpd and fcgi


#1

I’m trying to get lighttpd to execute fcgi files. I’m just having some
overall trouble finding concrete examples of getting lighttpd working
with fcgi.

I’ve followed the hivelogic tutorial to get everything set up, not a
problem. But then he doesn’t have any examples of serving fcgi’s.

here is my lighttpd config:

server.port = 8034
server.document-root =
“/users/aaronsmith/dev/ruby/rubyforge/rubyamf/lib/”
server.modules = (“mod_access”,“mod_accesslog”,“mod_fastcgi”)
static-file.exclude-extensions = ( “.fcgi” )

fastcgi.server = ( “.fcgi” =>
(
“rubyamf” =>
(
“socket” => “/tmp/ruby.socket”,
“bin-path” => “/usr/local/bin/ruby-cgi”
)
)
)

I’ve read about lighttpd configs, I’m just trying to keep it super
simple for now, to get running. then will add other stuff in.

The ruby-cgi file is from here: http://pallas.telperion.info/ruby-cgi/.
So like he mentions in the little briefing. It’s just to execute ruby
files. Not the rails application server.

I’m not trying to set up some complicated server. I am developing
rubyamf, and need to write an fcgi gateway.

So if I have a rubyamf/lib directory. in that lies test_gateway.fcgi. I
can’t get lighttpd to run it.

I’m starting lighttpd like: lighttpd -f rubyamf -D
then nav to localhost:8034/test_gateway.fcgi.
When I go there, I get 403, permissions denied.

I’ve set permissions on it to 777 and made it executable +x.

any ideas?

-thanks
A


#2

So I got the sctips to execute, but it takes forever. I don’t see what’s
wrong. Takes like 2 minutes to execute. I have this script:

#!/usr/local/bin/ruby
require ‘cgi’
require ‘rubygems’
require_gem ‘fcgi’

FCGI.each_cgi do |cgi|
puts cgi.headers
cgi.out{“DFEDEDSddddddddddd”}
end

why would it take so long?