I assume you have the following already installed:
- yum repository support
- current Apache RPM
- current Python RPM
- current mod_python RPM
- Subversion 1.0.x client server and repository
yum install subversionIf you don't have mod_python installed it is installed with:
yum install mod_pythonYou now must choose one of two options. To get the current HEAD version, which I haven't tested, do the following:
cvs -d :pserver:anonymous@cvs.sourceforge.net/cvsroot/viewcvs co viewcvsThe second option is to get the version I am using, which is tared here: viewcvs-1.0-dev-09012004.tgz. It is the HEAD revision from mid-day on September 1, 2004, and has no other special characteristics. You can download and untar it with the following commands:
wget http://www.baus.net/viewcvs-1.0-dev-09012004.tgz tar zxvf viewcvs-1.0-dev-09012004.tgzAfter doing one of the above change to the viewcvs directory:
cd viewcvsThere is an install script to get you started. Please note that it doesn't do everything necessary to get viewCVS running, but it is easy enough to run. The defaults are probably fine. Just press enter after each option. To run the script do the following:
./viewcvs-installYou now need to configure Apache to call viewCVS, and you must tell viewCVS where your Subversion repositories are.
Let's start with Apache. Again, on Fedora Core 2:
cd /etc/httpd/conf.dYou now need to create the file viewcvs.conf with the following contents. You can either paste the contents into your editor or using the cat command, paste the contents into the console window, then end the command with ctl-D. That's the true Linux hack way to do it. I assume you used the installation script defaults and viewCVS is installed at /usr/local/viewcvs-1.0-dev/. If not, edit ScriptAlias and PythonPath appropriately.
bash# cat > viewcvs.conf ScriptAlias /viewcvs "/usr/local/viewcvs-1.0-dev/www/cgi/viewcvs.cgi" <location /viewcvs> AddHandler python-program .py PythonPath "['/usr/local/viewcvs-1.0-dev/lib']+sys.path" PythonHandler apache PythonDebug On </location>You now must configure viewCVS to find your Subversion repositories. There are two ways to do this. The first is to tell viewCVS where all your repositories are. The second is to tell it what subdirectory your repositories are stored in. I choose the second method, since it makes it easy to add repositories in the future.
cd /usr/local/viewcvs-1.0-dev/Now edit the file viewcvs.conf.
Comment the svn_roots and cvs_roots lines out of the configuration using the # character. For instance, find the line:
cvs_roots = cvs: /home/cvsrootand replace it with:
#cvs_roots = cvs:/home/cvsrootAgain with subversion roots:
svn_roots = svn: /home/svnrootand replace it with
#svn_roots = cvs: /home/svnrootUncomment the root_parents = line and replaced it with
root_parents = /path/to/my/repos : svnOf course put the proper repository path in place of /path/to/my/repos
Now modify default_root to point to your main repository. For instance:
default_root = myrepoIn this case myrepo would be in the directory /path/to/my/repos/myrepo
Now restart Apache with:
service httpd restartThen use your web browser to view the repository:
http://myhostaddr/viewcvsYou should see the current revision of your repository.
If you liked this article you might be interested in my qmake and subversion revision howto which is here.
