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
even
} production server for Ruby on Rails.
}
} I’m trying to do it on Linux Debian, but somehow, I always get this
Error:
}
} 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:
}
http://o9y.net/archives/2006/02/17/ruby-on-rails-mittels-mod_fcgi-fur-apache-2-unter-debian/
(German)
[…]
I don’t know German, I’m afraid, but it appears that the tutorial is
having
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
someone
} might tell me what Setup might be the best on Linux???
Apache2 is fine. Debian is great. MySQL… eh, to each his own. FastCGI
is
a good choice in other environments, but you need mod_fcgid. A quick
Google
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
running
at a path on a main server rather than as its own virtual host, as shown
on
the Alias line):
DefaultInitEnv RAILS_ENV production
Alias /bookmarkfeeds /home/gss/work/ruby/bookmarkfeeds/public
Options ExecCGI +FollowSymLinks
AllowOverride All
order allow,deny
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
directory,
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]
…to…
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:
RewriteBase /bookmarkfeeds
} I always worked with Debian, but I could switch to any other if
someone
} 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
get
mod_fcgid working with Rails and Apache2 under Debian. I’ve done it. I
have
it running on my own machine.
} Thanks
} -Georges
–Greg