Capistrano 2.0 and Mongrel Recipies

Posted by Michael Tue, 27 Nov 2007 20:15:00 GMT

Capistrano 2.0 doesn’t work with those mongrel recipes we all have nowadays. We scratched our head at some hacks before finding a good solution via the blog world.

Thanks to Megablaix, Inc for posting this code. Works great for us, just tack it onto the end of your deploy.rb and go:

namespace :deploy do
  namespace :mongrel do
    [ :stop, :start, :restart ].each do |t|
      desc "#{t.to_s.capitalize} the mongrel appserver" 
      task t, :roles => :app do
        #invoke_command checks the use_sudo 
        #variable to determine how to run 
        # the mongrel_rails command
        invoke_command "mongrel_rails cluster::#{t.to_s} -C #{mongrel_conf}", :via => run_method
      end
    end
  end

  desc "Custom restart task for mongrel cluster" 
  task :restart, :roles => :app, :except => 
       { :no_release => true } do
    deploy.mongrel.restart
  end

  desc "Custom start task for mongrel cluster" 
  task :start, :roles => :app do
    deploy.mongrel.start
  end

  desc "Custom stop task for mongrel cluster" 
  task :stop, :roles => :app do
    deploy.mongrel.stop
  end
end

Posted in , , ,  | no comments | no trackbacks

Ruby and Erlang process bridge

Posted by Michael Thu, 10 May 2007 16:29:00 GMT

Erlang is a really great language for problem areas where a distributed system is involved, but it lacks the huge number of libraries that Ruby has. Wanna have your cake and eat it too? Yep, so do we. Enter Erlectricity, a Ruby to Erlang bridge.

It’s already on rubyforge, install it with:
sudo gem install erlectricity

We’re actively prototyping a software solution that would be better in Erlang as it needs to be massively concurrent (think deep packet inspection at 750Mbits). Two libraries we need for aggregation exist in Ruby but not Erlang. Now we can bridge the two and let Erlang do it’s thing and Ruby do what it does best, just not so fast.

Posted in , , , ,  | no comments | no trackbacks

Imapenguin Ruby on Rails Appliance

Posted by Michael Thu, 26 Apr 2007 12:49:00 GMT

Yes, we know the Rails appliance is still on rails 1.1.6 :-)

We’re developing an automated build system for incremental rails updates on the appliance and including MySQL support in May.

If you need it quicker, this is a 100% open source project. We don’t charge for it and wont, so let us know if you’re interested in joining the development team.

Posted in , ,  | no comments | no trackbacks

Rails mongrel cluster with apache 2.2 and mysql on Ubuntu Edgy (6.10)

Posted by Michael Wed, 14 Mar 2007 17:22:00 GMT

We’ve been doing a bunch of server setups for folks in VPS’s. I figure we’d save you the cost of hiring us by posting a quick rundown on an Ubuntu Edgy Rails setup:

sudo bash
apt-get update && apt-get upgrade
apt-get remove apache2
apt-get install libssl-dev
apt-get install zlib1g-dev
dpkg --purge apache apache2
apt-get install build-essential
apt-get install libreadline5-dev
cd /usr/local/src/
wget http://apache.mirror99.com/httpd/httpd-2.2.4.tar.gz

tar -xzvf httpd-2.2.4.tar.gz
cd httpd-2.2.4
./configure --enable-proxy --enable-proxy-balancer\
--enable-proxy-http --enable-rewrite --enable-cache\
--enable-headers --enable-ssl --enable-so
make && make install
/usr/local/apache2/bin/apachectl start

apt-get install mysql-server
/etc/init.d/mysql start

cd /usr/local/src/

wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.6.tar.gz
wget http://rubyforge.org/frs/download.php/17189/rubygems-0.9.2.zip
apt-get install unzip
unzip rubygems-0.9.2.zip
tar -xzvf ruby-1.8.6.tar.gz
cd ruby-1.8.6
./configure && make && make install

cd ../rubygems-0.9.2

ruby setup.rb

gem update
gem install rails --include-dependencies

apt-get install libmysqlclient15-dev
gem install mysql --include-dependencies
gem install mongrel --include-dependencies
gem install mongrel_cluster --include-dependencies

Then you need some optional housecleaning and deploy your app. We’ll assume you know this part. If not, you can flame me via email and I’ll help you.

  • set a mysql password and add appropiate users and permissions
  • setup iptables
  • add apache conf for mongrel cluster
  • add app required gems as needed
  • use capistrano set up your directories
  • migrate database
  • start clusters
  • apache and mysql to startupscripts
  • add mongrel to startup scripts

Posted in , , , ,  | no comments | no trackbacks

Ruby Gems: undefined method `refresh'

Posted by Michael Thu, 22 Feb 2007 20:11:43 GMT

If you’re getting:

Updating installed gems...
ERROR:  While executing gem ... (NoMethodError)
    undefined method `refresh' for #<Hash:0x1380250>

you need to remove your source_cache. Look in ~/.gem and in your site directory. Mine is in:

/usr/local/lib/ruby/

Posted in , ,  | no comments | no trackbacks

Easy Rails on a Mac

Posted by Michael Wed, 07 Feb 2007 16:02:57 GMT

Dave Benjamin just updated his step by step guide to install Rails on a Mac.

Mongrel + Ruby + Rails + Mac = Yum.

Posted in , , , ,  | no comments | no trackbacks

Defending against threats with a componentable solution PART 1

Posted by Michael Mon, 11 Dec 2006 11:12:07 GMT

We’re going to apply to put “componentable” in the dictionary.

Just what is “componenetable” you ask?

We’ve been looking at a score of “Unified threat” solutions for the last few months. On a VERY broad scope there are a few major components of a security architecture that need to be addressed:

threats_1.jpg

In this example we assume things like firewall/vpn/network based external attacks to the network are covered somewhere.

There are two basic solution groups to solving the above problem areas:

components_1.jpg

Appliances are:

  • Easy to install and manage
  • Typically have one interface

but:

  • Have questionable scaling issues
  • Typically make it difficult to replace one component

Software solutions:

  • Have good scaling solutions (it’s trivial to buy better hardware)
  • Make it easy to swap one product for a given solution

but:

  • Require multiple interface to control, manage and report
  • Require operating system management on top of the component’s management requirements

In PART 2, we’ll talk about some ways to select solutions that have some advantages of both approaches, then later in the series we’ll talk about how to develop your apps to do a hybrid of both approaches.

Posted in , , , ,  | no comments | no trackbacks

Mongrel Cluster Configure ERROR

Posted by Michael Wed, 08 Nov 2006 13:27:41 GMT

We’ve been asked this question 3 times this week, time to make the answer public. When trying to set up your

mongrel_cluster cluster::configure

you get

ERROR RUNNING 'cluster::configure': Plugin /cluster::configure\
does not exist in category /commands

You don’t have mongrel_cluster installed.


sudo gem install mongrel_cluster

Then slap yourself on the forehead and continue.

Posted in , , ,  | no comments | no trackbacks

Imapenguin's Ruby on Rails Appliance now Available

Posted by Michael Wed, 04 Oct 2006 14:06:06 GMT

It doesn’t get any easier than this. Download, boot, done.

Our Ruby on Rails Appliance ships with the latest Ruby on Rails installation on a lean Linux system. It will self update with bugfixes and security patches so you can concentrate on Ruby and Rails and not worry about the Operating system.

Downloads

Download it FREE here

Documentation is here on the Imapenguin Documentation site

Oh, and it’s 100% open source.

Posted in , , ,  | no comments | no trackbacks

New Ruby site goes online

Posted by Michael Mon, 11 Sep 2006 21:22:51 GMT

ruby.gif“After months and months of deliciously teasing screenshots, the real deal is now out for the world to see. The official Ruby language website has been redesigned. And what a wonderful design it is. Congratulations to the visual identity team and the contributors. It’s truly a work to be proud of.”

(Via Riding Rails.)

Posted in  | no comments | no trackbacks

Older posts: 1 2