0

我觉得自己是世界上最愚蠢的人。这是我第一次使用 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>

我的“生产”服务器有一个“日志”文件夹和“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,我可以用我的浏览器打开它。为什么我收到“连接失败”?开发环境中的应用程序正在运行。

4

2 回答 2

0

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

于 2014-08-25T14:23:32.800 回答
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 文件夹用于“本地”副本,另一个用于“远程”存储库

于 2013-06-18T12:48:57.970 回答