Confused...using svn, capistrano, and remote server?

hello, i am learning to use these tools but i am confused on how to do
this.

basically i have webspace with a awesome rails host and would like to be
able to launch my project the way its suppose to. i hear many nice
things about capistrano and such.

so for the past few months, ive been working on a few rails apps on my
local machine. now that i am rdy to launch, what/how/where do i setup
the svn?

i assume this for initial creation is this correct?

  1. set/create a svn repository on my web rails account.
  2. create a empty rails project skeleton repository on my web rails
    account
  3. check out the skeleton version from the web rails account to my local
    machine or import my working copy on my local machine into the newly
    created repository on my web rails account?(which is better?)

next.

now when i need to make changes to my web rails application

  1. checkout the latest version on my web rails account.
  2. make my changes on my local machine
  3. configure capistrano to my rails app on my local machine
  4. rake deploy the bad boy?

hello thanks for the awesome response and for providing the link!

a few questions?

  1. Do an svn checkout to get the login/password cached by SVN on the
    host. Delete this checkout.

i do the checkout on my local machine, on the host machine, via the svn
co http…command? do i still create a rails skeleton on the host
machine? or do i do the checkout on the host machine and delete that
version?

i guess im confused about how there are 2 svn repositories. one on my
local and one on the host. is it not possible that both svn repositories
be mismatched?

thanks for the help.

Coda Hale has some extensive directions on this:
http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/

Basically, you need to install teh capistrano gem locally, make sure
that both localhost and external host have svn installed, create a
repository that is accessible by url and not file:/// and then go from
there.

If you don’t want to deply with a cluster, I’d follow the instructions
on the manual:
http://manuals.rubyonrails.com/read/book/17

Sn in direct response to your questions:

No. Capistrano does the svn checkout. The process would be as follows.
This assumes that your local source code is already under version
control and you have a repository that is accessible from your
deployment host via svn:// or http://

  1. Setup Capistrano locally (including deploy.rb)
  2. Do an svn checkout to get the login/password cached by SVN on the
    host. Delete this checkout.
  3. Setup your database.yml file to match yoru deployment machine
  4. svn commit -m “setting up for capistrano deployment”

You can then either cold_deploy or use setup to get the directory
structure setup.

At that point you should be able to cap deploy and get it working.
Again, Coda’s directions are pretty good if youw ant to deploy wiht a
cluster, otherwise go for the rails manual.

Note: if you’re looking to use 301 redirects on old URLs, and you are
deploying with a cluster, you can’t place them in .htaccess. I wrote
an extensive article on it here:
http://www.boboroshi.com/2006/12/20/301-redirects-rails-capistrano-and-mongrel_cluster

ENjoy!

On 27 Dec 2006, at 18:19, boboroshi wrote:

Coda Hale has some extensive directions on this:
http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-
rails-mongrel-apache-capistrano-and-you/

Basically, you need to install teh capistrano gem locally, make sure
that both localhost and external host have svn installed, create a
repository that is accessible by url and not file:/// and then go from
there.

Has anyone written directions on how to setup up apache/capistrano/
mongrel_cluster on a server with plesk 8.1 (our customers need to be
able to manage their own e-mailaddresses in a nice interface etc.)?
There are a few vague threads hanging around here and there, but none
of them have helped me any further. Our server is running Ubuntu 6.06
LTS, Apache 2.0.55, Ruby 1.8.5, MySQL 5.0.21.

I’ve been able to get my Rails app up and running by doing it
manually and hacking into the /var/www/vhosts/mydomain.com/conf/
httpd.include file. This shouldn’t be the way to go, as the first
lines of the httpd.include file clearly state:

ATTENTION!

DO NOT MODIFY THIS FILE OR ANY PART OF IT. THIS CAN RESULT IN

IMPROPER PLESK

FUNCTIONING OR FAILURE, CAUSE DAMAGE AND LOSS OF DATA. IF YOU

REQUIRE CUSTOM

MODIFICATIONS TO BE APPLIED TO THE CONFIGURATION, PLEASE, PERFORM

THEM IN THE

FOLLOWING FILE(S):

/var/www/vhosts/mydomain.com/conf/vhost.conf

/var/www/vhosts/mydomain.com/subdomains//conf/

vhost.conf

However, I’ve tried just about any possible configuration in the
vhost.conf file, but haven’t gotten it to work.

Best regards

Peter De Berdt

Peter De Berdt wrote:

Has anyone written directions on how to setup up apache/capistrano/
mongrel_cluster on a server with plesk 8.1 (our customers need to be
able to manage their own e-mailaddresses in a nice interface etc.)?
There are a few vague threads hanging around here and there, but none
of them have helped me any further. Our server is running Ubuntu 6.06
LTS, Apache 2.0.55, Ruby 1.8.5, MySQL 5.0.21.

As far as I know, you can’t run a mongrel cluster under Apache 2.0.x,
because you need mod_proxy_balancer, and that requires Apache 2.2.

I have successfully upgraded a machine running Plesk 8.1 to Apache 2.2,
but be warned that this requires rebuilding ALL the Apache modules, plus
a bunch of other things you wouldn’t necessarily expect. As I recall,
there isn’t any “how” to it – you just do what needs to be done until
everything works. I did get it working, and retained full Plesk
functionality, without modifying the “DO NOT MODIFY THIS FILE” file:-)

I think I started with this link and the other references it points to:

http://mongrel.rubyforge.org/docs/apache.html

But you do have to take care not to step on Plesk. It’s doable, but
probably not for the faint of heart:-)

–Al Evans

On 28 Dec 2006, at 00:24, Al Evans wrote:

NOT MODIFY THIS FILE" file:-)
Yeah, I know, I’ve already installed Apache 2.2 in /usr/local/
(instead of the default ubuntu location) in order to not overwrite
the default installation. I guess now I’d have to change the init.d
apache2 script to pick up the version, but I was wondering if anyone
could give me pointer so that I don’t screw up the plesk installation.

Best regards

Peter De Berdt

hi boboroshi,
i think i understand now after learning more about svn last night. but
what i kind of dont understand is this…when i do a checkout on my
remote server , that basically puts what the latest remote server
version of my app onto my local machine. if i then delete that copy on
my local machine, apply capistrano to a local rails app, how does
capistrano know to check it into where the remote server rails app
resides and put that as the latest?

if my svn is on my local, what is the purpose of having another svn on
the remote?

thanks for the help!

Peter De Berdt wrote:

On 28 Dec 2006, at 00:24, Al Evans wrote:

NOT MODIFY THIS FILE" file:-)
Yeah, I know, I’ve already installed Apache 2.2 in /usr/local/
(instead of the default ubuntu location) in order to not overwrite
the default installation. I guess now I’d have to change the init.d
apache2 script to pick up the version, but I was wondering if anyone
could give me pointer so that I don’t screw up the plesk installation.

As I recall, I backed up everything so that I could test the new
version, and restart the old version when the testing failed.

I changed the script in init.d to point to the new version, changed the
“modules” link in /etc/httpd to point to the new modules directory, and
tried to restart Apache. This led to several rounds of
build-and-install, working from the errors I got. Eventually, I got it
started with nothing commented out in the config files, and all Plesk
functionality available.

Then I added mod_proxy and mod_proxy_balancer to the main config file,
and basically went by the mongrel cluster config given in:

http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/

…with appropriate changes so as not to step on anything Plesk thought
it owned. So the site-specific config files went into /etc/httpd/conf.d
as they normally would.

Eventually, everything worked. It’s been stable and fast.

Hope this helps!

–Al Evans

thanks justin for the clarification.

however, my noob self just needs a tad bit more understanding. (or maybe
much more)

is what i am thinking correct?

  1. i have completed my rails application on my local machine.
  2. svn client is both installed on my machine and remote server.
  3. i create the first version of my svn on the remote server.
  4. i import my completed application into version 1 svn.
  5. i create my database for my application on the remote server.
  6. on my local machine, i can Check out the version of my application
    located on the remote server.
  7. make changes on how i see fit, and check it back into the svn located
    on the remote server.
  8. on my local machine copy, i apply my capistrano and configure the
    deploy.rb
  9. rake deploy the rails app and it will checkout the latest version
    located on the remote server, put it into the releases folder, sym links
    it, and runs a migration?

*question, the rake deploy creates any tables and updates my tables with
whatever is in my schema.rb?

*the plugins installed will also be fine?

thanks, everyones been much help

please disregard above post. i think i know what the deal is!

koloa wrote:

if my svn is on my local, what is the purpose of having another svn on
the remote?

When boboroshi wrote “make sure that both localhost and external host
have svn installed”, (s)he meant that both must have the svn client
installed. The SVN repository could be anywhere on the Internet.

regards

Justin F.