Setting up ViewVC on Dreamhost

Album Cover: Various Positions

"Her beauty and the moonlight overthrew ya."
Leonard Cohen / Hallelujah

Posted on November 15, 2008 2:06 PM in Web Development
Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

I set up a Subversion repository on Dreamhost today. Anyone who knows Subversion knows (or should know) that ViewVC is the perfect complement. It provides a web interface for browsing your Subversion repository, looking at new and old versions of files, diffs of changes, etc.

So naturally, once I got Subversion all set up, I wanted to set up ViewVC as well. Unfortunately, though, while the Subversion section of Dreamhost's wiki is very informative and helpful, the ViewVC section leaves quite a bit to be desired.

I wasn't phased by the lacking documentation, though, and believe it or not, I was able to get ViewVC up-and-running on my Dreamhost server in no time. The following is a run-through of what I did, in case anyone else finds it useful.

Downloading ViewVC

At the time of writing, the latest version of ViewVC is version 1.0.7. I found the link to the zipped tarball and then downloaded it directly onto my web server, like so:

wget http://viewvc.tigris.org/files/documents/3330/44050/viewvc-1.0.7.tar.gz

Installing ViewVC

Once I decompressed and extracted the files from the downloaded package, I executed the installation script from within the extracted folder like so:

./viewvc-install

When prompted for the installation path, I initially tried to just use the default (/usr/local/viewvc-1.0.7), but I didn't have the proper permissions for that (understandably so), so I created a new directory on my webserver at /home/<myusername>/tools and then chose /home/<myusername>/tools/viewvc-1.0.7 as the installation path to use. I stuck with the default setting for the DESTDIR path option, and next thing I knew, all of the files were being installed.

Configuring ViewVC

Once everything was installed, the script instructed me to update the viewvc.conf file in the directory I just installed everything to. I left mostly everything in the file untouched, but made the following changes:

  1. Commented out the cvs_roots option since I'm using ViewVC for a Subversion repository and not a CVS repository
  2. Uncommented the svn_roots option for the same reason, and pointed it to my recently created repository (svn_roots = svn: /home/<myusername>/svn/<myprojectname)
  3. Commented out the line default_root = cvs and added a new line beneath it that looked the same, but using svn instead of csv

Making ViewVC Web-accessible

The next thing the script instructed me to do was to configure my web server in such a way that ViewVC would be accessible via the web. It gave a few options, but the simplest one seemed to be copying the viewvc.cgi script from its install location (/home/<myusername>/tools/viewvc-1.0.7/bin/cgi/viewvc.cgi) to the root of the subdomain I created when setting up Subversion (and taking heed to some important advice). Once I did that, I could see the ViewVC interface in my web browser at the aforementioned subdomain.

Keeping Love ViewVC Locked Down

At this point, I had pretty much accomplished my initial task, which was to get ViewVC working with my new Dreamhost Subversion repository, but I also wanted to make sure that not just any regular Joe the Plumber off the street could access my repository and see what evil deeds I've been up to.

Fortunately for me, much like Dreamhost's Subversion setup instructions and much unlike their ViewVC documentation, their information on password-protecting directories is useful and pointed me directly to the control panel interface for managing the password-protection settings and allowed me to set up usernames and passwords authorized to view my new ViewVC interface.

Comments

youdontmeanmuch on November 21, 2008 at 7:31 PM:

Awesome, thanks for sharing. Provided i have time i think i'll give this ago this weekend.

Permalink

Jeremy Ehrhardt on December 30, 2008 at 12:53 AM:

Thanks. These instructions were a great starting point for my own setup. I wrote up some extra info about how to set up more convenient URLs for repository content and a few other configuration tweaks to make it look nicer and work faster.

Permalink

Jon z on March 04, 2009 at 5:23 AM:

my boss is sort of OCD about extra files and stuff, if I leave the tar file for a new library or something lying around for more than a few hours he will ask if he can delete it. And I'm sort of a nut about clean URLs.. so I ended up making a symlink from the root of the hostname to the viewvc.cgi file.

Good to find another DH user.

Permalink

Guy on March 24, 2009 at 4:00 AM:

Thanks a lot for this walkthrough, very useful. I just got a DH 'Private Server' so I'm looking to use SVN on there a lot more now. Not sure which is better, TRAC or ViewVC but they both seem to be very useful.

Permalink

rhedlfyl on May 15, 2017 at 5:23 AM:

Post Comments

If you feel like commenting on the above item, use the form below. Your email address will be used for personal contact reasons only, and will not be shown on this website.

Name:

Email Address:

Website:

Comments:

Check this box if you hate spam.