Topic: Capistrano, seperate database/content servers?

Hi guys,

Since my current rails install is acting a bit flaky I'm trying to get capistrano working with the railsmachine stack. Like everyone else I'm trying to follow http://showmedo.com/videos/video?name=r … eriesID=48 which got me a long way.

My problem is that my mysql server isn't running on the same machine as the content. After some googling I came up with this for my deploy.rb:

set :domain, "x.x.x.134"
role :web, domain
role :app, domain
role :scm, domain
role :db,  "x.x.x.135", :primary => true

set :application, "my_app"
set :deploy_to, "/var/www/apps/#{application}"

set :user, 'deploy'
set :repository, "svn+ssh://#{user}@#{domain}#{deploy_to}/repos/trunk"
set :rails_env, "production"
etc...


As you can see the ip ending in 134 is my web-server and 135 the database.

At first everything seemed to be working just fine, rails was installed, /var/www was created on .134 and a bunch of other stuff. But then it started trying to create /var/www on the database server too, which failed (permission denied.)

Now the permission denied message surprised me since the deploy user has sudo rights on both machines. That said why is it copying /var/www over to the database machine in the first place? Is my config incorrect? Does it always do this? Any help would be much appreciated!