Tips for Deploying Rails Apps with Vlad the Deployer

Posted by Scott on Sep 29th, 2007

I deployed a Ruby on Rails application using Vlad the Deployer for the first time today. Vlad is a much, much simpler alternative to Capistrano, which I’ve also used.

However, the process wasn’t as smooth as it could have been. I ran into the following issues that required some digging:

1. My subversion repository is accessed via an https web server, which happens to use a self-signed SSL certificate. The svn program prompts you to verify and save this certificate the first time you perform a checkout. Vlad hung on this prompt until I logged into my deployment server as the user and manually completed a checkout from the repository.

2. My subversion repository is also password-protected using HTTP authentication. Vlad apparently doesn’t know how to deal with this, as I couldn’t find any documented variables to set an svn username or password. However, I could override the subversion command, and add switches for the username and password in my deploy.rb file:

set :svn_cmd, "svn --username=\"USERNAME\" --password=\"PASSWORD\""

3. The vlad:start task runs apachectl to give apache a kick after starting up mongrel. That binary was not in my user’s path, so I had to edit the user’s .bashrc file to add /usr/sbin to the $PATH environment variable. Second, the apachectl command needs to be run with root privileges, and Vlad seems to have no knowledge of sudo. To fix this, I was going to override the vlad:start task, and started poking around the gem sources to see how the original task was defined. That’s when I noticed that it sets the variable :web_command internally, so I was instead able to override that with another addition to my deploy.rb file:

set :web_command, "sudo apachectl"

These weren’t a huge deal, but that’s only because I’ve dealt with Capistrano and have an idea of what variables should exist to configure these kinds of options. I’m liking Vlad a lot.

In fact, I’m pretty sure for October I’ll be doing a presentation for NHRuby.org on Vlad the Deployer.

Backing Up Linux Systems

Posted by Scott on Sep 29th, 2007

I’ve used a decent number of backup systems on the Linux platform. From my UNH SysAdmin days, AMANDA was the system of choice, and we backed up to DLTs. Since then I’ve had the luxury of not needing solutions that are quite so enterprise-y. Mostly I’ve gotten to know rsync pretty well and integrated it into some home-grown scripts.

Recently I came across two open source backup packages which are based on rsync but give you more power, rsnapshot and BackupPC. The latter is fairly complex and geared toward enterprise environments, and even has a web-based interface for viewing backup reports. But for backing up an individual workstation with an external backup drive, rsnapshot can’t be beat. Its configuration file is easy to understand and get going with in minutes, and it’s well tailored for straightforward backup applications, with a bit of flexiblity where it makes the most sense (rsnapshot works well across networks for remotely backing up systems as well). Both of them make wise use of hardlinks to dramatically decrease the size of consecutive backup sets.

Check these apps out if you haven’t heard of them and want to look to simplify your backup system.

The Epic Ride (Completed)

Posted by Scott on Sep 23rd, 2007

My century bike ride yesterday was a success. I completed the ride in about seven hours, including breaks, with my riding time just over 6.5 hours. That’s 100.3 miles at an average speed of 15.2 MPH. The weather turned out excellent, with cloudy skies in the morning keeping the temperature down in the upper 60s.

Heading up Route 1A in Rye, NH

It’s really motivating to do long rides in groups. When you’re riding solo, all the aches, pains, and uncertainty are hard to ignore. I don’t think I could have done this ride alone.

NH Seacoast Century Ride

Now my goal is to keep riding as much as I can this fall and winter, and maintain my fitness until spring arrives.

The Epic Ride

Posted by Scott on Sep 16th, 2007

The title of this post also happens to be the title of my college admissions essay, which was about a mountain bike ride. This time, though, I’m talking about a road ride. Specifically, the Tri-State Seacoast Century, which I will be riding in this coming weekend, rain or shine. I’m planning to attempt the 100-mile ride, which will be my first century ride if I’m successful.

So far this year I’ve put 1200 miles on my bike and done a couple of solo 70-mile rides. I think once you can ride 50-60 miles, it’s all mental after that. You just keep turning the pedals over until you’ve reached your goal. Since there will be hundreds of other cyclists doing this ride, it should be easier to stay motivated.

I expect the ride will take me somewhere around 7 hours to complete. I’m really looking forward to it, as it’s a personal goal I set for myself late in the Spring.

CAPTCHA Usability Improves

Posted by Scott on Sep 4th, 2007

I just noticed a major usability improvement regarding the use of CAPTCHA images for login verification. Namely, don’t show one until you’ve received a failed login attempt. NewEgg does this, and a colleague tells me Google has been doing it, too. It makes perfect sense – give your user the benefit of the doubt the first time around, and then enforce use of the CAPTCHA if you suspect you might be the target of a brute-force attack.

Blog Badges



[FSF Associate Member]

Archives