Newbe Rails question on Apache



I am new to Rails, like totally new. I am not new to application
having near 10 years experience with data mining and store front
with various Java web severs.

I see a ton of power in Rails but I am slightly put off by what looks
like a
difficulty when running Rails apps under Apache. So I am posting a few
prelimenary questions of getting Rails apps going under Apache.

If there is a site with info on getting Rails apps going under Apache,
give me a pointer.

I understand the basic bottleneck of Ruby being an interpreted language
Rails being basically a set of CGI scripts with the resulting need to
a Ruby interpreter for each CGI call. Certainly this is one of the
advantages to using Java there is only one launch of the JVM which
all CGI calls. But this is not enough to deter me away from using the
of rails.

If a given site is not going to get a large number of hits is the use of
FastCGI a must under Apache or can I just use Rails as is? I know
FastCGI going in Apache is not quick. What are the guidelines here as
site load vs need?

Is there a basic pointer as to how to port a working web app that runs
WEBrick to Apache?

Thanks for all the help


I found that getting FastCGI up and running is actually fairly quick.
First time through it might take about an hour or so and some poking
and prodding. After that though it shouldn’t take any longer then
10-15 minutes (IIS is a whole nother story)

From my experinces FastCGI is plenty fast enough for me, but then
again our site is a heavy traffic site. Most folks seem to use the
Apache front end, with Lighttpd as the actual ‘app’ server setup and
are very happy with it. I run on windows, so this isn’t an option.

Also, I suppose if you have a really small site you could simply run
the given server from your rails app (lighty on *nix, webrick on
windows) but you obivously loose some flexibility with this.

Dont know if this helps at all, but oh well. If you happen to be
running on windows let me know if you need some help setting up apache
(sounds like you’ll be able to handle it lright though). Also, dont
know if you saw this but the wiki entry is pretty good:

(it says XP, but basic steps work for XP and newer)



On Wednesday 22 February 2006 14:49, Nick S. wrote:

Most folks seem to use the
Apache front end, with Lighttpd as the actual ‘app’ server setup and
are very happy with it. I run on windows, so this isn’t an option.

So with such a set up FastCGI would not be needed? I don’t see how to
the Apache CGI calls to lighttpd. Can anyone point to some example

Thanks for helping a newbie.


Well actually lighty has fastcgi built in, so in a sense its still
needed, but there is no extra process in getting it setup. (I may be
mistaken, but this is how I believe it works) Apache however would
just forward the requests on to the lighty servers, which means no
FCGI for it.

If you’re on a nix box with lighty installed, simply run ‘ruby
script/console’ from your app directory and fastcgi should start, and
generate a simple config file for you as well. Check it out.