On Mon, May 08, 2006 at 09:39:48PM +0200, Jentgen Georges jr. wrote:
} Hi, I’m really new to RoR and I’m trying to setup a development or
} production server for Ruby on Rails.
} I’m trying to do it on Linux Debian, but somehow, I always get this
} Application Error - Rails application failed to start properly
} This was running on Debian Linux, Apache2, Mysql and FastCGI.
Apache2 does not play nicely with mod_fastcgi. You need mod_fcgid.
Conveniently, this involves just apt-get install libapache2-mod-fcgid.
} The Tutorial I used:
I don’t know German, I’m afraid, but it appears that the tutorial is
you build mod_fastcgi yourself. I’m not sure why, since it is available
precompiled as a Debian package. More to the point, it doesn’t work
particularly well with Apache2.
} Maybe someone has some tips I schould do to get it work? Or maybe
} might tell me what Setup might be the best on Linux???
Apache2 is fine. Debian is great. MySQL… eh, to each his own. FastCGI
a good choice in other environments, but you need mod_fcgid. A quick
search for mod_fcgid and rails gives a number of pages with useful
information. That said, here’s what I have in
/etc/apache2/sites-available/default (note that this is for an app
at a path on a main server rather than as its own virtual host, as shown
the Alias line):
DefaultInitEnv RAILS_ENV production
Alias /bookmarkfeeds /home/gss/work/ruby/bookmarkfeeds/public
Options ExecCGI +FollowSymLinks
allow from all
RedirectMatch ^/bookmarkfeeds/$ /bookmarkfeeds/feeds/
RedirectMatch ^/bookmarkfeeds$ /bookmarkfeeds/feeds/
Note that those last two RedirectMatch lines are specific to my app, and
don’t apply in general. And yes, I am running it out of my home
because I feel like it. In addition, I had to modify the
RAILS_ROOT/public/.htaccess file to change the following two lines (they
are not contiguous in the file):
AddHandler fastcgi-script .fcgi
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
AddHandler fcgid-script .fcgi
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
Finally, since I have this running at /bookmarkfeeds instead of at / I
needed this line in the .htaccess file as well:
} I always worked with Debian, but I could switch to any other if
} tells me which might be the best for this task.
There will always be people who think that their system is better than
yours. I can assure you that it is possible and even moderately easy to
mod_fcgid working with Rails and Apache2 under Debian. I’ve done it. I
it running on my own machine.