Setting Up Subversion and ViewVC on Dreamhost
Posted by Johnny on January 29th, 2009 filed in Technology, Tips & TricksWhile I don’t normally use source control for personal projects, I figured it would be a handy tool to sync files between numerous computers, and useful for a site that’s likely to go through many revisions. While setting up Subversion is pretty straightforward on Dreamhost, I sought an explanation for the /home/<username>/svn created after your first code import – it turns out this is where Subversion maintains your repository (I had naively mistaken it for a directory of checked out code). During this search I came across a nice how-to on Bernie Zimmerman’s blog about setting up ViewVC, an excellent web interface for viewing Subversion repositories, and one that I had used extensively back at Yahoo!.
Once installed, you can access ViewVC by hitting http://domain.com/path/to/viewvc.cgi. For those who prefer a prettier URL (also useful for accessing files directly by path) in the form of http://domain.com/path/to/viewvc/path/to/file, follow the directions in this Bat Country post on setting up Apache mod_rewrite directives to achieve this.
One last feature I felt like adding was the ability to view my repository directly by hitting my top-level SVN URL, rather than entering the full path to ViewVC. To do this, create an index.php file at your domain root with the following code
<?php header("Location:http://domain.com/path/to/viewvc"); ?>
which will redirect you to ViewVC when you hit http://domain.com/.
Leave a Comment