Forum: Ruby on Rails Recommendations for Apache 2 with mod_fcgid

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A5aa88cb70b8afb8511b1e77dd57964f?d=identicon&s=25 Andy Churchstone (andy)
on 2006-05-11 19:44
Hi,

Have been pulling out my hair for the last few days wondering what I'm
going to deploy my site onto.

I currently have FreeBSD 4.7, Apache 1.3.3, PHP 4 and MySQL 4 running a
year-old PHP site. Dated stuff I know!

The new version of the site will be entirely Ruby on Rails, and I am
wondering what order I should be doing things in terms of upgrades and
installation. I want to be able to make changes to the server one at a
time so that the existing site can continue running with minimal periods
of downtime in between (very important!)

I'm thinking:

1. Upgrade Apache to 2.2 with mod_fcgid running.
2. Check existing site runs fine for a while
3. Upgrade to MySQL 5
4. Check existing site runs fine for a while
5. After a while, bring down the old site and replace it with the Rails
version
6. Reboot the server having turned off PHP.

Note that I have no plans to upgrade PHP, as with the new site, I can't
think of any immediate need for it.

Anyway, the above is incredibly major, risky stuff I know. Having
multiple servers would be nice, but $$$ is a restriction. My questions
are:

- Is the order of things above okay?

- Does anyone have any good 3rd party links for any of the above with
regards to migration/installation/configuration tuning, especially in a
RubyonRails setting? I will be following
http://journal.paul.querna.org/articles/2006/01/01...
when it comes to configuring mod_fcgid itself.

- Any other tips or alerts to my stupidity and inexperience on these
issues would be most welcome too!
9d7d8ef2179661d6b30e180fa588cd45?d=identicon&s=25 Calle Dybedahl (Guest)
on 2006-05-12 06:42
(Received via mailing list)
>>>>> "Andy" == Andy Churchstone <andrew_churchstone-1@yahoo.co.uk> writes:

> I currently have FreeBSD 4.7, Apache 1.3.3, PHP 4 and MySQL 4 running a
> year-old PHP site. Dated stuff I know!

> The new version of the site will be entirely Ruby on Rails, and I am
> wondering what order I should be doing things in terms of upgrades and
> installation. I want to be able to make changes to the server one at a
> time so that the existing site can continue running with minimal periods
> of downtime in between

I'm in a similar situation at the moment, and this is how I'm doing
it:

* Make sure old Apache 1.3.x has mod_proxy.

* Run new Rails app on PostgreSQL instead of MySQL.

* Put in a new vhost in the Apache config that proxies to a lighttpd
  that load-balances a Mongrel cluster.

It's really one layer of redirection too many, but it's dead simple to
set up and it doesn't require touching the old application at all.
Once the new Rails app has fully replaced the old stuff in production,
one can always look at other deployment alternatives.
--
		     Calle Dybedahl <calle@cyberpomo.com>
		 http://www.livejournal.com/users/cdybedahl/
  "You know, if I garbage collected my brain I wouldn't have anything
left."
			   -- Paul Tomblin, BofhNet
F15fdc7cb2e911b3808837f2be244add?d=identicon&s=25 Adam Denenberg (Guest)
on 2006-05-12 13:58
(Received via mailing list)
I was in a similar situation as you guys and decided on the following
which
has been running great

1) postgres instead of mysql
2) apache 2.2 with mod_proxy_balancer
3) mogrel instead of fcgi

 much better and cleaner setup in my mind and definitely and edge in
speed
as well.

adam
9d7d8ef2179661d6b30e180fa588cd45?d=identicon&s=25 Calle Dybedahl (Guest)
on 2006-05-12 14:32
(Received via mailing list)
>>>>> "Adam" == Adam Denenberg <straightflush@gmail.com> writes:

> 2) apache 2.2 with mod_proxy_balancer

I'd try that, but I have a bunch of old mod_perl stuff that I'd rather
not try to port to mod_perl2.
--
		     Calle Dybedahl <calle@cyberpomo.com>
		 http://www.livejournal.com/users/cdybedahl/
   "Do any churches offer gluten-free body of christ? Just in case some
of
  their flock have problems digesting their saviour?" -- Rob Blake,
BofhNet
A5aa88cb70b8afb8511b1e77dd57964f?d=identicon&s=25 Andy Churchstone (andy)
on 2006-05-12 18:53
Thanks for the suggestions guys.

I'm thinking an Apache 1.3 to lighttpd proxy is probably a wiser choice
for me, not only for the reasons you mention above but because I have
the incredibly rock solid but ancient FreeBSD v4.7 installed.

I wanted to do the Apache 2.2 version with proxying to lighty, but that
version (well, the quick MPM-Worker version) seems to rely on threading
of some sort that FreeBSD 4.x doesn't like. Therefore, I'd have to
reinstall (remotely!) FreeBSD to v5/6 before doing the rest. For those
in the know, you'll know remotely installing FreeBSD is an invitation to
disaster.... a love letter to the Grim Reaper...

So, I think I'll do the proxying with 1.3. However, I have a few
specific questions if any of you have any guidance:

1. Best to stick with Apache 1.3, or the Pre-fork version of Apache 2.2.
Given that it'll just be like a doorman to lighty, I'm not sure whether
its work the risk of an upgrade.

2. Why is everyone saying Postgres - is it really that much better for
Rails than MySQL.

3. Do you guys keep your static files, e.g. CSS, JS, images in an
'unproxied' directory so that Apache still serves it, as I here this is
quicker than Lighty and some people do this.
59de94a56fd2c198f33d9515d1c05961?d=identicon&s=25 Tom Mornini (Guest)
on 2006-05-12 20:09
(Received via mailing list)
On May 12, 2006, at 9:53 AM, Andy Churchstone wrote:

> 1. Best to stick with Apache 1.3, or the Pre-fork version of Apache
> 2.2.
> Given that it'll just be like a doorman to lighty, I'm not sure
> whether
> its work the risk of an upgrade.

You'll need Apache 2.2.x for proxy_balancer if you're going to use
Mongrel.

With Mongrel, there's little need for fcgid.

> 2. Why is everyone saying Postgres - is it really that much better for
> Rails than MySQL.

It's not better "for Rails" than MySQL, it's just...NEVERMIND! Not
starting
a flame war today.

> 3. Do you guys keep your static files, e.g. CSS, JS, images in an
> 'unproxied' directory so that Apache still serves it, as I here
> this is
> quicker than Lighty and some people do this.

See recent posts about Apache, Mongrel, mod_proxy and
mod_proxy_balancer.

--
-- Tom Mornini
This topic is locked and can not be replied to.