Saturday, April 26, 2008

Deployment: Part 1

So we're nearing the stage of our deployment and decided to perform a dry run on J's spare computer. We installed the Ubuntu server on his machine, along with all the stuff we needed (SSH, Ruby, Rails, gems, etc.)

We then decided to go with Ubuntu server + Apache + Mongrel Cluster + Capistrano for an action-packed deployment. We decided on Ubuntu since we have had such a good impression with them and have had experience with troubleshooting on an Ubuntu machine. Apache + Mongrel Cluster seems to be a fast-growing standard, although there are many configurations to choose from. We had been doing research and found that this configuration would be the most painless. As well, this configuration is supposed to handle very well. We used Capistrano to help with our deployment and to make maintenance much easier when deploying on a remote server.

Basically, the whole setup revolved around Capistrano. So... off we went to figure out how to use it. This took us a very long time as we had to troubleshoot some problems.

The first problem that was not even mentioned on the Capistrano site was logging into the remote server with a particular username. In the examples, they simply say to just use:

role :app, my.server.com

However, this will log you into the remote server with the username you have with the local machine. This is not what we wanted, so we ended up having to attach the username in front:

role :app, username@my.server.com

Next, when the server was trying to checkout our repository from SVN, it crapped out. We added this to our deploy.rb to get around this:

default_run_options[:pty] => true

Now, our deploy ran fine, until we got to Mongrel Cluster T.T

Hopefully this will get you out of the rough, unless you're using Mongrel Cluster, which I'll cover in the next post.


W

No comments: