TurnKey Linux Virtual Appliance Library

TKLPatch for Ruby Enterprise - Passenger (Production environment for ruby web apps)

I just saw in other post that Alon suggested TKLPatching an instalation of Ruby Enterprise. I just took the first part of my Gitorious TKLPatch and converted it to a TKLPatch that can be used as base for installing other Ruby projects. This patch is for turnkey-core-beta-lucid-x86.

Hope it's usefull! 

Features:

* Ruby Enterprise 1.8.7 

* RubyGems 1.3.7

* Passenger 2.2.15

* SSL Support Enabled.

* Apache Rewrite module enabled (convenience)

What it Does:

1. Download and installs Ruby Enterprise & RubyGems 1.3.7. Creates symlinks to usr/bin

# Install Ruby Enterprise and RubyGems
wget http://rubyforge.org/frs/download.php/71100/ruby-enterprise_1.8.7-2010.0...
dpkg -i ruby-enterprise_1.8.7-2010.02_i386_ubuntu10.04.deb
rm ruby-enterprise_1.8.7-2010.02_i386_ubuntu10.04.deb
ln -s /usr/local/bin/ruby /usr/bin/ruby
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
tar xf rubygems-1.3.7.tgz
cd rubygems-1.3.7/
ruby setup.rb
ln -s /usr/local/bin/gem /usr/bin/gem
cd /root/
rm -Rf rubygems-1.3.7/

2. Installs apache, passenger and apache modules

install build-essential apache2-mpm-prefork apache2-prefork-dev libapr1-dev libaprutil1-dev ssl-cert
gem install --no-ri --no-rdoc --version 2.2.15 passenger
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.15/bin/passenger-install-apache2-module -a
echo "LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.15/ext/apache2/mod_passenger.so" > /etc/apache2/mods-available/passenger.load
echo "<IfModule mod_passenger.c>" > /etc/apache2/mods-available/passenger.conf
echo "   PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.15" >> /etc/apache2/mods-available/passenger.conf
echo "   PassengerRuby /usr/local/bin/ruby" >> /etc/apache2/mods-available/passenger.conf
echo "</IfModule>" >> /etc/apache2/mods-available/passenger.conf
a2enmod passenger
a2enmod rewrite  
a2enmod ssl 
a2ensite default-ssl
service apache2 restart
3. Clean up apt cache
	cleanup_apt
Attached: 
Basil Kurian's picture

My suggestion

Add MySQL too into the build as it is normally required in most applications


Liraz Siri's picture

We'll look into making Ruby Enterprise the default...

Ruby Enterprise looks like a drop in replacement for Ruby that is more memory efficient so we'll have to look into the pros and cons of using it in our standard Ruby on Rails appliance.

(edited to remove foot from mouth)

RoR Appliance update?

Any notions on when the standard RoR appliance will be updated once the new TKL core is out of beta?

The Rails appliance is excellent now, and REE would make it even better.

Another consideration is that Rails 3 is near.

Liraz Siri's picture

Upcoming Rails appliance will be based on Rails 3

We're aiming to start pushing out updates within a few weeks.

Rails 3 was recently released (Aug 29). The new rails appliance will be based on it. REE is available as a package for Ubuntu 10.04 so if we don't run into too many issues there's a good chance we'll include it in the upcoming release as well.

What's the ultimate goal of this appliance?

I've never downloaded the rails appliance, but I thought of updating this appliance earlier. As you know, I'm a big fan of rails (although I haven't made my first app with it!). Is it intended to be a rails dev env for developing? or a rails production env for deploying a final app? 

If it is intended to be a dev env, I think it's a must to setup rvm so to have multiple versions of ruby to test the app against it. 

As a production environment I don't see it very useful. Every rails app should bundle it's own rail under the vendor folder. I don't think of deploying to Rails app using the same system-wide rails gems. 

That's why I ultimately left this out of my queue of work! I'd like to help with this one if you can clarify how is it to be used. (ahhhh that short screencast telling you how to use your tkl appliance is missing! :P)

Rails Appliance Use

 

With the liberal use of virtual machines, I think the appliance can work for both purposes, in its current form.

My production use for the appliance is as an "end user", e.g. deployment of a single in-house application, rather than as a hosting platform. So a single static version of Ruby/Rails is fine. Any upgrade of either, or any other component, would be deployed to another virtual machine. A single machine instance dedicated to a single application.

And the appliance could also be used, again as a vm, for a quick, standard development setup on a pc or mac, so rvm would be a useful addition.

I'm more from the application side than system admin, but glad to help out if I can.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)