Agile Web Development with Rails (3rd edition)

Agile Web Development with Rails (3rd edition)

I am following the Passenger/Capistrano/Git deployment process outlined in Chapter 28. Everything seems to work well except being able to restart my application. I am on Ubuntu 8.10. Here is my configuration info:

set :application, "insurance"
set :user, "bruparel"
set :admin_runner, "bruparel"
set :domain, '192.168.1.105'
role :app, domain
role :web, domain
role :db, domain, :primary => true
default_run_options[:pty] = true
set :repository, "#{user}@#{domain}:git/#{application}.git"
set :deploy_to, "/home/#{user}/r_work/#{application}"
set :scm, "git"
set :branch, "master"
set :deploy_via, :remote_cache
set :scm_verbose, true
set :use_sudo, false
namespace :deploy do
desc "Restart Application"
task :restart do
run "touch #{current_path}/tmp/restart.txt"
end
end

When I run cap deploy:restart, I can see the restart.txt file is being “touched” correctly by Capistrano since the timestamp changes. However, Passenger fails to restart my application, I have to manually restart Apache for my app to pick up redeployed changes.

Following up on my own post, the restart process is working. However, I have several other follow up questions:

When I deploy from a client machine to a laptop connected via home network, the following statement creates a problem i the Capistrano deploy script:

set :deploy_via, :remote_cache

I commented it out and then the deploy process worked again. I have looked up the function of setting deploy_via to remote cache and found that a remote copy is cached by using this command and Capistrano does a net change and picks up only the changes from the repository and uses remote_cache to speed up the deployment process. It does not seem to work for me.

This is driving me crazy and shows my lack of linux network skills. I have two Ubuntu laptops connected via a home wireless network and they work fine. However, the DHCP allocates a different IP to my “server” laptop thereby causing ssh to think that I have a man in the middle attack going on when I try to connect to it using the “client” laptop. I was trying to find an easy way to assign them a local proxy DNS name which stays constant when I restart them, but cannot find a good answer. Does anyone know?