small medium large xlarge

Generic-user-small
31 Mar 2010, 19:09
Ivan Holsbach Schuster (4 posts)

A need help. I search the internet and didn’t find anything that works. Could you tell me what is wrong?

I have a application that want to deploy in the same machine (Ubuntu 9.1 + apache2 + passenger + capistrano) I seems to go OK till I tried run “deploy:setup” I put git file in a directory of the same machine (at “/home/ivan/git/sge.git” ) The app development directory is: /home/ivan/Sistemas/Ror/sge I would like to deploy the app in the directory “/var/www/sge”

When executing “cap deploy:setup” I’m receiving the error:

  • executing `deploy:setup’
  • executing “mkdir -p /var/www/sge /var/www/sge/releases /var/www/sge/shared /var/www/sge/shared/system /var/www/sge/shared/log /var/www/sge/shared/pids && chmod g+w /var/www/sge /var/www/sge/releases /var/www/sge/shared /var/www/sge/shared/system /var/www/sge/shared/log /var/www/sge/shared/pids” servers: [“localhost”] connection failed for: localhost (Errno::ECONNREFUSED: Connection refused - connect(2))

My /home/ivan/Sistemas/Ror/sge/config/deploy.rb

# Excerpted from “Agile Web Development with Rails, 3rd Ed.”, # published by The Pragmatic Bookshelf. # Copyrights apply to this code. It may not be used to create training material, # courses, books, articles, and the like. Contact us if you are in doubt. # We make no guarantees that this code is fit for any purpose. # Visit http://www.pragmaticprogrammer.com/titles/rails3 for more book information. #— # be sure to change these set :user, ‘ivan’ set :domain, ‘localhost’ set :application, ‘sge’

file paths

set :repository, “/home/ivan/git/#{application}.git” set :deploy_to, “/var/www/#{application}”

distribute your applications across servers (the instructions below put them

# all on the same server, defined above as ‘domain’, adjust as necessary) role :app, domain role :web, domain role :db, domain, :primary => true

you might need to set this if you aren’t seeing password prompts

default_run_options[:pty] = true

As Capistrano executes in a non-interactive mode and therefore doesn’t cause

# any of your shell profile scripts to be run, the following might be needed # if (for example) you have locally installed gems or applications. Note: # this needs to contain the full values for the variables set, not simply # the deltas. # default_environment[‘PATH’]=’:/usr/local/bin:/usr/bin:/bin' # default_environment['GEM_PATH']=':/usr/lib/ruby/gems/1.8'

miscellaneous options

set :deploy_via, :remote_cache set :scm, ‘git’ set :branch, ‘master’ set :scm_verbose, true set :use_sudo, false

task which causes Passenger to initiate a restart

namespace :deploy do task :restart do run “touch #{current_path}/tmp/restart.txt” end end

optional task to reconfigure databases

after “deploy:update_code”, :configure_database desc “copy database.yml into the current release path” task :configure_database, :roles => :app do db_config = “#{deploy_to}/config/database.yml” run “cp #{db_config} #{release_path}/config/database.yml” end

My /etc/apache2/httpd.conf

ServerName localhost DocumentRoot /var/www/sge/public

My /etc/apache2/apache2.conf (added lines)

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/ext/apache2/mod_passenger.so PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.11 PassengerRuby /usr/bin/ruby1.8

Samr_small_pragsmall
02 Apr 2010, 13:27
Sam Ruby (634 posts)

Re: @Errno::ECONNREFUSED: Connection refused@

Is sshd running?

Generic-user-small
02 Apr 2010, 16:11
Ivan Holsbach Schuster (4 posts)

You are ‘the’ guy! Thank you very much!

By the way, excellent book. You have done a very good job. Congratulations!

Ivan

You must be logged in to comment