0

I feel like the most foolish man in the world. This is the first time I am using capifony, but I cannot get it works.

My idea is, for test purposes, make a deploy locally.

I have two virtual servers:

<virtualhost *:80>
  DocumentRoot "/usr/local/webserver/www/development/myapp/web"
  ServerName myapp
  ServerAlias local.myapp.com
  CustomLog "/usr/local/webserver/www/development/log/development.log" combined
  ErrorLog "/usr/local/webserver/www/development/log/development.log.error.log"
  <directory "/usr/local/webserver/www/development/myapp/web">
    AllowOverride none
    Options Indexes FollowSymLinks
    Order allow,deny
    Allow from all  
  </directory>
</virtualhost>

<virtualhost *:80>
  DocumentRoot "/usr/local/webserver/www/production"
  ServerName myapp.production
  ServerAlias production.myapp.com
  CustomLog "/usr/local/webserver/www/production/log/production.log" combined
  ErrorLog "/usr/local/webserver/www/production/log/production.log.error.log"
  <directory "/usr/local/webserver/www/production">
    AllowOverride none
    Options Indexes FollowSymLinks
    Order allow,deny
    Allow from all  
  </directory>
</virtualhost>

My "production" server has a "log" folder and "index.php" file which I can open from my browser with "production.myapp.com". This is my deploy.rb file:

set :application, "myapp"
set :domain,      "production.#{application}.com"
set :deploy_to,   "/usr/local/webserver/www/production/#{application}"
set :app_path,    "app"
set :web_path,    "web"

set :repository,  "file:///usr/local/webserver/www/development/myapp"
set :scm,         :git
set :deploy_via,  :copy
set :branch,      "development"
set :update_vendors, true
set :use_sudo,      false

# Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, or `none`

set :model_manager, "doctrine"
set :dump_assetic_assets, true
# Or: `propel`

role :web,        domain                         # Your HTTP server, Apache/etc
role :app,        domain                         # This may be the same as your `Web` server
role :db,         domain, :primary => true       # This is where Symfony2 migrations will run


set  :keep_releases,  3

# Be more verbose by uncommenting the following line
logger.level = Logger::MAX_LEVEL

But I get this error when I execute cap deploy:setup

servers: ["production.myapp.com"] connection failed for: production.myapp.com (Errno::ECONNREFUSED: Connection refused - connect(2))

I can ping production.myapp.com, and I can open it with my browser. Why am I getting "connection failed"? The application in the development environment is working.

Richard Pérez
  • 1,467
  • 3
  • 15
  • 18
  • have you enabled the ssh on the servers? because capistrano is using it. – ihsan Jun 18 '13 at 02:04
  • @ihsan yes, but that was the problem I have openssh-client (ubuntu) so Ithough it was okay, but then I read in some part about SSHD and that result it was openssh-server, I installed and problem resolve :P. – Richard Pérez Jun 18 '13 at 12:40

2 Answers2

0

Okay after all the problem was relate to SSH, I am using Ubuntu and I had openssh-client installed, but the problem was I need to have openssh-server, after I installed, problem resolve.

But then I found another problem related with run capifony using same machine, specifically I was getting this error:

gzip stdin unexpected end of file capistrano

at the end I resolve trough this

http://brighternet.com/articles/deploying-static-sites-with-capistrano/#configure

In the part where you customize the task in order to use one tmp folder for the 'local' copy and another for the 'remote' repository

Richard Pérez
  • 1,467
  • 3
  • 15
  • 18
0

I encountered the same problem (I work on mac OS). I just enabled OpenSSH server thanks to this quick tutorial: http://www.gooze.eu/howto/using-openssh-with-smartcards/openssh-server-on-mac-os-x

Adrien G
  • 1,086
  • 2
  • 14
  • 32