small medium large xlarge

Adam_caravelle_pragsmall
02 Nov 2008, 20:33
Adam Beguelin (9 posts)

In the “Deploy with Capistrano” section the output of the capify command doesn’t match the text that follows. The two files that are discussed in the text are not what is output from the capify command.

This is a pretty dense section of the book. It would be nice to know if the example directory,

/Library/Rails/blog/current

is a normal place for someone to deploy their code on Linux/Apache. (What I’m doing.) It seems like a Mac style path. I would expect it to be something like /var/www/rails/blog/current on Apache.

I’m developing on a Mac and deploying on CentOS.

Also, should the directories on the deployment machine be owned by the apache user?

Thanks, Adam

PS I’m finding the book very useful.

Adam_caravelle_pragsmall
02 Nov 2008, 20:53
Adam Beguelin (9 posts)

The book doesn’t say much about the expected structure of the repository. I’m using git but my my rails code isn’t at the top level of my git repo. Is this a requirement?

Also, the cap deploy:setup fails because:

sorry, you must have a tty to run sudo

My hosted machine is locked down. I’m sure I’ll run into port issues as well. If you’re deploying on a remote server, how dangerous is it to open up ports like 8000 to the world? Is there an easy way to use all this mongrel/capistrano goodness over ssh so I don’t have to open up a bunch of ports on my deployment server?

Adam_caravelle_pragsmall
04 Nov 2008, 02:56
Adam Beguelin (9 posts)

I was able to get the deployment to work. A few things I learned that may be useful to others.

Check out the “Capistrano”:http://www.capify.org/getting-started site for lots of good info.

The deploy directories can be whatever you want. With Apache on Linux it’s usually /var/www but it can be /Library if you want.

In the deploy.rb file you can avoid using sudo by adding this line:

set :use_sudo, false

You will need to create directories on the server in such a way that your login can write to them. I used the apache group and them added my login to that group. This means the various directories need to be owned by apache and be group writable.

Also, I didn’t need to open ports for Mongrel. It seems all the connections are local, so this wasn’t an issue.

And the git repo does need to be the top level. I created a branch and moved things around using git mv and after that things worked. You can specify the branch in deploy.rb as well like this:

set :branch, “deploy”

Hope this helps.

You must be logged in to comment