我正在用https://github.com/yeah/uberspacify测试https://github.com/yeah/uberspacify,这是一个https://github.com/capistrano/capistrano接收集合。在开始使用uberspacify之前,我按照uberspace提供的文件中的描述配置了服务器。我的RubyOnRails应用程序刚刚发布得很好。现在我已经通过uberspacify进行了部署,下面的错误是用/var/www/virtual/john/logs/error_log编写的
错误连接被拒绝:代理: HTTP:尝试连接到127.0.0.1:44477 (*)失败
注意,每次部署时,端口44477都是不同的。
该网站本身指出:
503 Service Temporarily Unavailable
The server is temporarily unable to service your request due to
maintenance downtime or capacity problems. Please try again later.
Apache/2.2.15 (CentOS) Server at foobar.phoenix.uberspace.de Port 443下面是我准备的Capfile:
# Capfile
load 'deploy'
# Uncomment if you are using Rails' asset pipeline
load 'deploy/assets'
load 'config/deploy' # remove this line to skip loading any of the default tasks下面是deploy.rb中的配置:
# config/deploy.rb
# include uberspacify base recipes
require "uberspacify/base"
# comment this if you don"t use MySQL
require "uberspacify/mysql"
# the Uberspace server you are on
server "phoenix.uberspace.de", :web, :app, :db, :primary => true
# your Uberspace username
set :user, "john"
# a name for your app, [a-z0-9] should be safe, will be used for your gemset,
# databases, directories, etc.
set :application, "foobar"
# the repo where your code is hosted
set :scm, :git
set :repository, "git@bitbucket.org:obama/#{application}.git"
set :branch, "master"
# optional stuff from here
# By default, your app will be available in the root of your Uberspace. If you
# have your own domain set up, you can configure it here
# set :domain, "www.dummyapp.com"
# By default, uberspacify will generate a random port number for Passenger to
# listen on. This is fine, since only Apache will use it. Your app will always
# be available on port 80 and 443 from the outside. However, if you"d like to
# set this yourself, go ahead.
# set :passenger_port, 55555
# By default, Ruby Enterprise Edition 1.8.7 is used for Uberspace. If you
# prefer Ruby 1.9 or any other version, please refer to the RVM documentation
# at https://rvm.io/integration/capistrano/ and set this variable.
set :rvm_ruby_string, "1.9.3@#{application}"我运行了以下命令:
$ bundle exec cap deploy:setup
$ bundle exec cap deploy:migrations我想知道uberspacify是否负责所有的配置。RubyOnRails的uberspace教程使用fcgi,.htaccess使用重写规则。而且,他们做的是,而不是,使用rvm。
下面是应用程序的Gemfile:
source 'https://rubygems.org'
ruby '1.9.3'
gem 'rails', '~> 3.2.13'
gem 'counter_culture', git: 'https://github.com/dorilla/counter_culture'
gem 'jquery-rails', '~> 3.0.2'
gem 'therubyracer', '~> 0.11.4', require: 'v8'
gem 'attribute_normalizer', '~> 1.1.0'
gem 'pry', '~> 0.9.12.2'
# Parsing ShapeFiles
gem 'rgeo', '~> 0.3.20'
gem 'rgeo-shapefile', '~> 0.2.3'
gem 'georuby', '~> 2.0.0'
gem 'dbf', '~> 2.0.6'
gem 'gdal', '~> 0.0.5'
gem 'capistrano', '~> 2.15.5'
gem 'uberspacify', '~> 0.9.3'
gem 'mysql2', '~> 0.3.13'
group :assets do
gem 'sass-rails', '~> 3.2.5'
gem 'coffee-rails', '~> 3.2.2'
gem 'uglifier', '~> 2.1.1'
end
group :development do
gem 'debugger', '~> 1.6.0'
end
group :development, :test do
gem 'sqlite3', '~> 1.3.7'
gem 'rspec-rails', '~> 2.14.0'
gem 'rspec-smart-formatter', '~> 0.0.4', require: false
gem 'factory_girl_rails', '4.2.1'
gem 'factory_girl_extensions', '2.1.0'
end
group :production do
gem 'mysql2', '~> 0.3.13'
end令人感兴趣的是,在成功安装$ toast arm gdal之前,我可能需要通过toast包管理器,via:$ gem install gdal安装gdal库。解析ShapeFiles需要此gem。
我注意到在成功处理~/.passenger和deploy:migrations之后,没有deploy:setup目录。
发布于 2013-08-02 10:33:04
问题的解决得到了巨大的帮助:“可怜的人!
以下是有助于分析服务器上问题的步骤。
$ curl http://localhost:{PORT}。端口可以在~/html/.htaccess或~/service/rails-{yourapp}/run中找到。$ ~/service/rails-{yourapp}/run并注意错误。/var/www/virtual/$USER/rails/{yourapp}/current中可以找到当前的部署。$ bundle exec passenger start -p $PORT -e production$ svc -u ~/service/rails-{yourapp}的服务启动$ svc -d ~/service/rails-{yourapp}在这个尝试和错误的过程中,我们发现存在PATH问题,我们注意到~/service/rails-{yourapp}/run源$HOME/.bash_profile可以看到这里。值得一提的是,我将zsh与oh和自定义dotfiles结合使用。我们注意到我已经在~/.zshrc中配置了rvm。这个文件已经包含源命令。了
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"我们发现这实际上阻碍了rvm将相同的语句放入~/.bash_profile中,因为它已经是记录在这里了。
总结一下:如果您从自定义的dotfiles中删除rvm配置,uberspacify将完美地设置并启动will服务器。
@uberspacify:我建议您重写rvm脚本,以注意提到的这里警告并做出适当的反应。
发布于 2013-07-31 11:06:01
我是“Uberspacify”的作者。你的Rails应用程序似乎还没有启动(目前)。这就是为什么Apache在端口44477上报告“拒绝连接”的原因--这是uberspacify为乘客和Apache之间的内部通信随机选择的端口。
要调试这一点,您可能需要签出/var/www/virtual/< your username>/rails/<your app>/shared/log中的日志文件。
此外,请确保“撤消”您根据Uberspace的说明所做的任何配置更改。它们的指令只用于FCGI的部署,与Uberspacify没有任何关系(而且很可能不兼容)。使用Uberspace and的唯一先决条件是一个常规的Rails应用程序和一个Uberspace帐户。
https://stackoverflow.com/questions/17945826
复制相似问题