Thursday, January 15, 2009

Subversion Installation - Step by Step Tutorial

Recently I played around installing SVN 1.5.1 with Apache 2.2.

Following paragraph provides detailed steps
1. Install Apache 2.2
2. During subversion installation ensure that you choose the proper Binding ie. Apache 2.2 (in our case)
3. Using the windows explorer, go to the installation directory of Subversion (usually c:\program files\Subversion) and find the files /httpd/mod_dav_svn.so and mod_authz_svn.so. Copy these files to the Apache modules directory (usually c:\program files\apache group\apache2\modules ).
4. Copy the file /bin/libdb*.dll and /bin/intl3_svn.dll from the Subversion installation directory to the Apache bin directory.
5. Edit Apache's configuration file (usually C:\Program Files\Apache Group\Apache2\conf\httpd.conf) with a text editor such as Notepad and make the following changes:

Uncomment (remove the '#' mark) the following lines:
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule dav_module modules/mod_dav.so
Add the following two lines to the end of the LoadModule section.
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
6. Now you are ready to check out the files. Create a local working folder and do an initial check out. Create the following folders trunk, branches and tags. Check in these folders into the repository. The main directories that you need to add to repository for the first time should go into trunk folder.

Whenever one wants to tag the code, you can do so by adding tags/ to the repository URL.

Configuration
Now you have set up Apache and Subversion, but Apache doesn't know how to handle Subversion clients like TortoiseSVN yet. To get Apache to know which URL will be used for Subversion repositories you have to edit the Apache configuration file (usually located in c:\program files\apache group\apache2\conf\httpd.conf) with any text editor you like (e.g. Notepad):
1. At the end of the config file add the following lines:

DAV svn
SVNListParentPath on
SVNParentPath D:\SVN
#SVNIndexXSLT "/svnindex.xsl"
AuthType Basic
AuthName "Subversion repositories"
AuthUserFile passwd
#AuthzSVNAccessFile svnaccessfile
Require valid-user

This configures Apache so that all your Subversion repositories are physically located below D:\SVN (Say). The repositories are served to the outside world from the URL: http://MyServer/svn/ . Access is restricted to known users/passwords listed in the passwd file.

Ensure that you create the repository at D:\SVN by using the following command:
svnadmin create D:\SVN
The above command assumes that there is a folder called “SVN” under D:\

2. To create the passwd file, open the command prompt (DOS-Box) again, change to the apache2 folder (usually c:\program files\apache group\apache2) and create the file by entering
3. bin\htpasswd -c passwd
This will create a file with the name passwd which is used for authentication. Additional users can be added with
bin\htpasswd passwd
4. Restart the Apache service again.
You can test your configuration by using: http://localhost:8090/svn/
It assumes that Apache Server is running on 8090 port. In my case, I had something else running on 80, so configured Apache server to run on 8090


Following two sites gives wealth of information about "Branching"
http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-branchtag.html

http://drc-dev.ohiolink.edu/wiki/TortoiseSVNHowTo

1 comment:

Anonymous said...

vinaa