Andy Churchstone
2006-May-11 17:44 UTC
[Rails] Recommendations for Apache 2 with mod_fcgid
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/using-mod_fcgid-for-ruby-on-rails-applications 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! -- Posted via http://www.ruby-forum.com/.
>>>>> "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 betweenI''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
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 On 5/12/06, Calle Dybedahl <rails@cyberpomo.com> wrote:> > >>>>> "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 > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060512/522e9308/attachment.html
>>>>> "Adam" == Adam Denenberg <straightflush@gmail.com> writes:> 2) apache 2.2 with mod_proxy_balancerI''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
Andy Churchstone
2006-May-12 16:56 UTC
[Rails] Re: Recommendations for Apache 2 with mod_fcgid
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. -- Posted via http://www.ruby-forum.com/.
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