Skip navigation.

Syndicate

Syndicate content

User login

Setting up SVN on Dreamhost

Now that I’m decommissioning my colo box at CI Host, I finally have to move my SVN server over to my Dreamhost account. I tried back in February when I moved everything else over to Dreamhost but I couldn’t get it to work. I tried again this time around and had better luck.

I think my problem before was that I created the SVN repository before the host that contained it had finished initializing (things like creating domains and subdomains and enabling services with Dreamhost are asynchronous and often take way longer than it seems they should), which is what this excerpt from the Dreamhost Support Wiki hints at:

If you create your repository before its intended host is fully created (and resolved), you may have an inaccessible repository. Assuming it doesn’t yet contain any information (how could it?), just delete it and recreate it

So, I deleted the repository, created a new subdomain (svn.apocryph.org) and created a new SVN repository at svn.apocryph.org/svn. This time I waited for the subdomain to finish creating before creating the SVN repository, and it seems to have worked much better. Unlike my last attempt, this time I actually see the SVN repository files in ~/svn/svn, which means I have something to point svnadmin at.

Once that was done, I went to my old SVN server and did a svndump /usr/local/apocryph_svn | gzip > svndump.gz, which created a compressed dump of the archive. I uploaded that dump to my Dreamhost user directory with sftp, then did a gunzip -c svndump.gz | svnadmin load /home/USERNAME/svn/svn (Note the svn/svn is due to my choice in SVN project name; if I’d called my project foo instead, the path would’ve been svn/foo; hindsight’s always 20/20).

With that, my SVN repository was moved. Now I want to install WebSVN at http://svn.apocryph.org/. I downloaded WebSVN 2.0rc4, and extracted it into the doc root for svn.apocryph.org. Per the instructions in install.txt, I renamed includes/distconfig.inc to config.inc and edited it to reflect my SVN server and credentials. I have public read enabled on my repository, so I used blank strings for the username and password.

I really want syntax highlighting functionality, so I need to install enscript. The Dreamhost Support Wiki WebSVN page has some simple install steps:

mkdir src
cd src
wget http://www.iki.fi/mtr/genscript/enscript-1.6.4.tar.gz
tar xvzf enscript-1.6.4.tar.gz
cd enscript-1.6.4
./configure --prefix=$HOME
make
make install

I then set the enscript path in the config.inc file to /home/USERNAME/bin (NB: This isn’t the path of the enscript binary, it’s the path where the enscript binary is located, which tripped me up). While at it, I also set the appropriate sed and tar and gzip paths, to enable directory tarballs.

To actually enable enscript I uncommented the $config->enableEnscript(); line; similarly for tarball directory downloads I uncommented $config->allowDownload();.

I was disappointed to see that C# isn’t among the enscript supported languages, but I guess one shouldn’t be too surprised.

Anyway, with just a little effort I now have a nice WebSVN front-end to my SVN repository, successfully migrated over to Dreamhost. Too easy.