Capifony连接Errno :: ECONNREFUSED

时间:2013-06-17 19:48:08

标签: symfony capifony

我觉得自己是世界上最愚蠢的人。这是我第一次使用capifony,但我无法使用它。

我的想法是,出于测试目的,在本地进行部署。

我有两个虚拟服务器:

<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>

我的“生产”服务器有一个“log”文件夹和“index.php”文件,我可以在浏览器中用“production.myapp.com”打开它。这是我的deploy.rb文件:

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

但是当我执行cap deploy:setup

时,我收到此错误
  

服务器:[“production.myapp.com”]连接失败:   production.myapp.com(Errno :: ECONNREFUSED:拒绝连接 -   连接(2))

我可以ping production.myapp.com,我可以用浏览器打开它。为什么我会“连接失败”?开发环境中的应用程序正在运行。

2 个答案:

答案 0 :(得分:0)

好的,所有问题都与SSH有关,我使用的是Ubuntu,我安装了openssh-client,但问题是我需要安装openssh-server,安装完毕后才解决问题。

但后来我发现了另一个与使用同一台机器运行capifony相关的问题,特别是我收到了这个错误:

gzip stdin unexpected end of file capistrano

最后我决定通过这个

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

在您自定义任务的部分,以便为“本地”副本使用一个tmp文件夹,为“远程”存储库使用另一个tmp文件夹

答案 1 :(得分:0)

我遇到了同样的问题(我在mac OS上工作)。我刚刚启用了OpenSSH服务器,这要归功于这个快速教程: http://www.gooze.eu/howto/using-openssh-with-smartcards/openssh-server-on-mac-os-x