我觉得自己是世界上最愚蠢的人。这是我第一次使用 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,我可以用我的浏览器打开它。为什么我收到“连接失败”?开发环境中的应用程序正在运行。