Problems with lighty

I’ve been trying to get lighty configured to work with Rails and I’m
having quite a time of it.

I have all of the following installed on a FC4 system:


Before I tried setting up multiple apps, I just decided to try for a
single app setup. I have the following configuration:

begin config

server.modules = ( “mod_rewrite”, “mod_fastcgi”,
“mod_access”, “mod_accesslog” )
server.indexfiles = ( “dispatch.fcgi”, “index.html” )
accesslog.filename =
server.document-root = “/home/user/fwo/public/”
server.error-handler-404 = “/home/user/fwo/public/dispatch.fcgi”
server.errorlog = “/home/user/fwo/log/error.log”

url.rewrite = ( “^/$” => “index.html”, “^([^.]+)$” => “$1.html” )

fastcgi.server = (
“.fcgi” => (
“localhost” => (
“min-procs” => 2,
“max-procs” => 2,
“socket” => “/tmp/rails.socket”,
“bin-path” => “/home/user/fwo/public/dispatch.fcgi”,
“idle-timeout” => 120

end config

The app works perfectly under WEBrick. But with this setup (and I have
tried several others with the same end result) in lighty, I always get
404 errors.

The only time I don’t get a 404 error is if I include this line in

map.connect ‘/dispatch.fcgi’, :controller => ‘users’, :action =>

Then it will properly display the page. It will also properly display
any file I have in the public directory. But any time I try the
controller/action URLs, I get a 404. It’s not the 404.html file in
public either, it’s actually a 404 from dispatch.fcgi, or at least it
appears to be.

In error.log, I find:

2006-03-29 04:03:40: (connections.c.1392) Warning: Either the
error-handler retu
rned status 404 or the error-handler itself was not found:
2006-03-29 04:03:40: (connections.c.1394) returning the original status
2006-03-29 04:03:40: (connections.c.1396) If this is a rails app: check
your pro

But it can apparently find dispatch.cgi if I reference it directly.
production.log (or in this case, development.log) shows nothing

Nevermind, I found the problem.

It appears it was appending the document root path I had specified to
the bin-path variable in the fastcgi server declaration, so it was
looking for:


I have everything working now.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs