Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Hendrik Mans http://www.mans.de

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Mongrel and Apache fun with Capistrano 2.0

I got the Mongrel recipes from somewhere else -- I sadly don't remember where -- and modified them a bit.

   1  
   2  namespace :deploy do
   3    namespace :mongrel do
   4      [ :stop, :start, :restart ].each do |t|
   5        desc "#{t.to_s.capitalize} the mongrel appserver"
   6        task t, :roles => :app do
   7          run "mongrel_rails cluster::#{t.to_s} --clean -C #{mongrel_conf}"
   8        end
   9      end
  10    end
  11    
  12    namespace :apache do
  13      desc "Start Apache"
  14      task :start, :roles => :web do
  15        sudo "/etc/init.d/httpd start > /dev/null"
  16      end
  17  
  18      desc "Stop Apache"
  19      task :stop, :roles => :web do
  20        sudo "/etc/init.d/httpd stop > /dev/null"
  21      end
  22  
  23      desc "Restart Apache"
  24      task :restart, :roles => :web do
  25        sudo "/etc/init.d/httpd restart > /dev/null"
  26      end
  27    end
  28  
  29    desc "Custom restart task for mongrel cluster"
  30    task :restart do
  31      deploy.mongrel.restart
  32      deploy.apache.restart
  33    end
  34  
  35    desc "Custom start task for mongrel cluster"
  36    task :start, :roles => :app do
  37      deploy.mongrel.start
  38      deploy.apache.start
  39    end
  40  
  41    desc "Custom stop task for mongrel cluster"
  42    task :stop, :roles => :app do
  43      deploy.apache.stop
  44      deploy.mongrel.stop
  45    end
  46  
  47  end
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS