Download, install and configure ViewVC for Subversion
Updated on April 24th, 2009.
ViewVC is a Subversion repository browser software having many useful features. You need python and a web browser to run it. If you are maintaining a Subversion server, you should install it to view repositories, files, branches, directories, versions or comparison between versions.
Step 1. Get the latest version of viewvc from here, when writing of this article the latest version was 1.2-dev. I’m using the development branch, you can use more stable. Untar it and start installation:
# tar xzf viewvc-1.2-dev.tar.gz
# cd viewvc-1.2-dev
# ./viewvc-install
Step 3. Answer simple questions. Default choice is okay for normal operation.
Step 4. Edit its config file which is self explainatory. Various options are there, you should read carefully and make use of. For basic working just update following options related to your Subversion server:
# cd /usr/local/viewvc-1.2-dev/
# vi viewvc.conf
svn_roots = cgi-bin: /svn/cgi-bin
root_parents = /svn : svn
default_root = cgi
root_as_url_component = 1
here, root_parents is directory which contains all you repositories. It can be avoided in case your repositories are spread over multiple locations. default_root is the name of repository(set in svn_roots) to be displayed by viewvc automatically.
Step 5. Open your httpd.conf file for Apache settings and write:
# vi /etc/httpd/conf/httpd.conf
ScriptAlias /viewvc /usr/local/viewvc-1.2-dev/bin/cgi/viewvc.cgi
ScriptAlias /queryvc /usr/local/viewvc-1.2-dev/bin/cgi/query.cgi
We are making a scriptalias to access viewvc through running its cgi script. The second line, which make alias of query.cgi is optional but recommended. It enables you to search for repositories, branches, files in your cvs/subversion.
ViewVC should run fine now, but in case you still found that its throwing some exception/error something like something like No module named svn found , pls proceed to the solution which I’ve posted here.