We’re trying to run Ruby on Rails on Debian with Apache and FastCGI, but
can’t get it to work. As far as we can tell, it seems to go wrong in the
final stages; Apache appears not to be doing anything with
dispatch.fcgi, even though FastCGI looks to be set up correctly. We’ve
followed several "how to"s, but we don’t get any other results.
What we’ve done:
- In general, we’ve followed instructions as listed on the Rails Wiki,
the Agile Web D. with Rails book, and another website with
basically the same instructions (don’t have URL handy now, sorry). Other
resources on the web don’t appear to have different information.
- We have a test application with a simple fake controller made to check
if everything works. This resides in /home/user/testapp, but we have a
symlink set up in /var/www/test linking to the public/ dir under the
- We have Apache 2 running (although we later tried with 1.3, giving the
- We installed the latest version of mod_fastcgi (after installing the
- We installed the fcgi gem for Ruby.
- We have the following server configuration in httpd.conf (essentially
straight from the Agile book):
-processes 3 -idle-timeout 60
- With this set up, we see that Apache starts three FastCGI threads,
showing up in both the apache logs and the fastcgi.crash.log in the
- To be sure: we made the public and log directories available for
Apache, as well as the /tmp/fcgi_ipc directory mentioned in the
configuration. (In fact, Apache will complain if this is not set up
- The line in .htaccess has been changed to use dispatch.fcgi rather
- We tried this on two different machines, but with the same effect.
What goes wrong:
When we try to approach our application on localhost, we get the the
static welcoming page from our application, but that is as far as we
get. As soon as we try to ask for our controller, we get a 404, and the
Apache error log tells us that it cannot find the file at
/var/www/test/fake (fake being the name of our controller, which has a
index.rhtml page in the views dir). That’s all the information we get,
nothing is listed in any other logs. Of course, this request should have
been handled by dispatch.fcgi, but it seems to us this was never called.
We think the problem lies there, as FastCGI itself appears to be
installed correctly (with Apache starting up the threads). However, we
haven’t been able to find anything wrong.
Any suggestions or tips as to what the problem might be would be very