Monday, June 04, 2007

Subversion, Apache(httpd), ViewCVS windows XP setup and configuration

Subversion, Apache HTTP server and viewcvs goes hand in gloves if one wants to run subversion as a version control(source control) for any production environment.

Followed the following steps to configure all three together.

1. Installed subversion1.4.3 from http://subvsersion.tigris.org version as svn-1.4.3-setup.exe

2. Installed the activestate python from ftp.activestate.com version as ActivePython-2.5.0.0-win32-x86.msi

3.
Installed svn-python binding for python2.5 and subversion1.4.3 from http://subversion.tigris.org version as svn-python-1.4.3.win32-py2.5.exe
  • One has to be very specific about the python, subversion and svn-python bindings. Ensure that the svn python binding versions should be same as that of subversion and python installed.
4. Test that the python shell can load svn-python bindings
  • launch C:/Python25/python.exe
  • from python shell enter : import svn.repos , it should not give any error trace.
  • exit python shell.
5. Got viewCVS from http://viewcvs.sourceforge.net version as viewvc-1.0.4.zip.
  • Unzipped viewvc-1.0.14.zip and renamed viewvc-1.0.4/viewvc-install as viewvc-1.0.4/viewvc-install.py and double-clicked it. This will ask some simple configuration query, i preferred default.
6. Edited C:/Program Files/viewvc-1.0.4/viewvc.conf
  • commented # cvs_roots = cvs: /home/cvsroot
  • Modified svnroots line as svn_roots = svn-root: c:/opt/svn-root , this is because i am having one svn repo named "svn-root" in C:/opt directory.
  • Modified root_parents line as root_parents = C:/opt : svn and removed ',' from the end of line.
  • Modified default_root line as default_root = svn-root
7. Test the viewcvs and subversion configuration and integration
  • Through command line run standalone.py -g from C:/Program Files/viewvc-1.0.4/bin/ location.
  • It will allow one to browse the repository with the default browser and if it works then only we can go further to integrate viewcvs with apache.
8. Installed apache httpd from http://www.apache.org as version apache_2.0.59-win32-x86-no_ssl.msi
  • Subversion win32 binaries are compiled for apache2.0.x and will not work with apache2.2.x.
  • "dav_svn_module in file /modules/mod_dav_svn.so is garbled" - perhaps this is not an apache module DSO ? This is the error one would get if tries to run apache-2.2.x with win32 subversion.
9. Edited httpd.conf file
  • Search for ScriptAlias in httpd.conf file and add one more line below all the ScriptAlias as ScriptAlias /viewcvs "C:/Program Files/viewvc-1.0.4/bin/cgi/viewvc.cgi"
  • Restart apache httpd server
  • Now, one can browse the repository.
10. One need GNU diffutils installed and in the PATH to enable the viewcvs feature of diff between two revisions. Get GNU diffutil from this Link...

cheers, make world open.

9 comments:

Anonymous said...

Great post! 10x.
My only comment is that you need GNU diff utils installed and in the PATH in order for the diff to work.

Vijay Kumar said...

Thanks a lot for your addition...
I must add this advice to my post.

Vijay.

lakshman said...

Hi Vijay,

Excellent post.

My only comment is that it might be a good idea to make a distinction between svn-1.4.3-setup.exe and CollabNetSubversion-server-1.4.3-6.win32.exe.

CollabNetSubversion does not include python binding but implements the repository as FSFS by default.

svn-1.4.3-setup.exe includes python binding but implements the repository as BDB.

Thanks
Lakshman

hellosacto said...

Thanks for the excellent post! it helped me a lot with my Viewvc setup. One thing that I had to change in the ScriptAlias line is that mine does not have "s' after /Viewvc
Mine says "ScriptAlias /Viewvc...."

Also, I have one question. When you said "you need GNU diff utils installed and in the PATH in order for the diff to work." Do you mean I have to install this Diffutils in Viewvc installation folder "C:\program files\Viewvc-1.0.4" ?
Thanks a lot!
Tim

M said...

Thanks a lot for your detailed steps.

Only thing I am not clear about is the GNU diff utils. I believe it only works for non-windows OS.
Can you tell me where to look for more info on this.

Thanks
Mansoor

Pramod said...

Thanks for the excellent post...!!

I've one question. I configured it successfully, but now getting error while trying to view .mpp or .vsd file directly from viewvc/weblink. Is there any plug-in do we've to add for that?


Thanks,
Pramod.

Pramod said...

Hi

Is any one having solution on problem which is in my last comment? Still I m facing that problem.


Pramod..

chatgro said...

Hi Vijay,
I was having installed tortoisecvs and cvsnt already and then without uninstalling the same I proceed as per ur guidelines and get done every thing without any error.
The only thing I notice when in the python shell we command for "import cvs.repos"
no error or any thing else we see.
Then we exit from the shell and proceed further.
and every thing is done as per ur instructions but still unable to see it on the browser.
right now checking on the same machine

Unknown said...

Hi Vijay,
when I run as standalone.py -g it works and as soon as i quit this the server stops.
secondly by keeping alive the seesion i m not able to access from out side and even seeting up the authz and passwd files.
pls help and also to import repositories from tortoisecvs system