要点:

  1. 只要在client机器上安装capistrano即可,服务器不需要装。
  1. 服务器要装好rails环境和版本控制工具
  1. 尽量不要使用sudo, 用www的用户即可,安全。

设置为 set :use_sudo, false

以下是我的配置文件(deploy.rb)

set :application, "netbar_cap"

set :repository, "your igt"

default_run_options[:pty] = true

set :use_sudo, false

#set :scm_command, "/usr/local/src/git-1.6.0.4/git"

set :scm, :git

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

role :web, "wbfwzx.com"

# Your HTTP server, Apache/etc

role :app, "wbfwzx.com"

# This may be the same as your `Web` server

role :db, "wbfwzx.com", :primary => true # This is where Rails migrations will run

#role :db, "your slave db-server here"

set :deploy_to, "/home/xiao/#{application}"

set :mongrel_conf, "#{deploy_to}/current/config/mongrel_cluster.yml"

set :runner, "xiao"

set :user, "xiao"

on :start do

`ssh-add`

end

namespace :deploy do

task :restart do

restart_mongrel_cluster

end

end

相关文章:

  • 2022-12-23
  • 2021-09-15
  • 2022-02-12
  • 2022-12-23
  • 2022-01-11
  • 2021-10-04
  • 2021-05-19
猜你喜欢
  • 2021-09-30
  • 2021-12-30
  • 2022-01-22
  • 2021-09-02
  • 2021-05-30
相关资源
相似解决方案