Why?
There are dozens of Subversion hosts out there but in my opinion, the pricing has always been too high for what they offer. In a world where you can get a VPS on the Rackspace Cloud for around $11 a month, $15 for just Subversion with user and repository limits makes no sense.
Well it turns out you can run your own Subversion server easily with their svnserve deamon. Even cooler, is that there exists an open source app called Warehouse which lets you access your SVN repository via the web. Not only does it look cool and has features on par with paid hosting services, but it also lets you administer svnserve through their interface, thus eliminating one of the woes of rolling your own Subversion. With one of the low priced servers offered by Cloud VPS providers, you can set up your own tailored Subversion system at a fraction of the cost.
That being said, there are some exceptions. If your Subversion needs are all public/open source repositories, Google Code is tough to beat at the price of free. If you don’t have the patience or desire to manage your own server, Beanstalk provides an excellent service with many cool features and options.
How?
Deploying, Installing, and Configuring a VPS isn’t easy. Even less so when the app you are trying to run is written in Ruby on Rails. But that is what is great about Cloud VPS services. You deploy a server, tinker with it, screw it up beyond belief, and at the end of the day you can simply delete it and start again.
Well I can’t think of how many guides helped me deploy my own servers, so I thought I’d give back with my own tutorial that incorporates it all into a deployable system that can help many starting developers out there. Read on and you will learn how to deploy not only a measly Subversion server, but a Ruby on Rails web stack as well, all on a small 256 MB VPS instance.
Where?
There are plenty of Cloud VPS providers out there. Off the top of my head, there’s Slicehost, Linode, Rackspace Cloud, and A Small Orange. The guide can certainly be adapted to a provider of your choosing, but I’ve picked a 256 MB instance on the Rackspace Cloud since they are the cheapest of the group. They sell bandwidth instead of bundling it which is useful at these traffic levels. They are also oriented towards short term deployments so it is conductive to testing on a clone of your slice rather than attempting changes on your production server.
It might be worth noting that Slicehost was purchased by Rackspace a while back so they use the same hardware and VPS images so their guides are interchangeable. Slicehost’s are prettier so that is why I’ve linked to those instead.
OS-Wise, I’m sure this works on any distro out there, but keep in mind this guide is written for CentOS 5.3 so all the nuances described here might only apply to this OS flavor. If the commands don’t work line for line and you are on Ubuntu server, it might be different folder layouts or who knows what. I recommend CentOS if you have a choice of distro.
Software-stack-wise, I’ve chosen the following based on actual testing, optimization, and ease of deployment on a 256 MB slice:
- Subversion with svnserve for repository access.
- Warehouse for web repository access.
- Ruby on Rails powered by a Thin web server cluster.
- Nginx web server for static requests.
- MySQL as the backend database.
When?
Over the next couple of days I’ll post each part of the guide. I’ve divided things into three logical sub-guides as follows:
- Set up Cloud Server, OS, and deploy Web Stack.
- Initialize your repository and get svnserve up and running.
- Download, install, and initialize Warehouse.
- Configure svnserve and add Repositories to Warehouse.
- Create post-commit hooks and automate access files.
Let’s get started!

© 2009