How to Install and Configure Visual SVN Server for Windows

May 13th, 2010 by bhumish.shah § 0

This article will describe how you can get started with the subversion server based on Windows.

I’ll use the Visual SVN standard edition. Visual SVN is also available in the enterprise edition but it is not free. The standard edition is free and you can use it in a commercial environment.

Links for the Visual SVN Server : http://www.visualsvn.com/server/

Download links for the Visual SVN standard edition:http://www.visualsvn.com/server/download/

Download it and install with the administrator privileged on the system.

Visual SVN Server Installation

Select VisualSVN Server and Management Console.

Visual SVN Server Installation

Select the location where you want to install VisualSVN Server and store SVN repositories.

You can use 2 types of authentication:

1) Subversion Authentication: The SVN Server uses its own authentication. It will create its own database for users , groups and permission.

2) Windows Authentication : This option will allow you to assign rights to Windows users and groups.

Visual SVN Server Configuration

Now, I’ll describe how to use SVN authentication.

After installation open VisualSVN Server Manager. Create a New Repository. You can also use Trunk , Branches and Tags. Here, we are going to create a repository named subversion.

- Create one user for testing purposes and name it digicorp.

- After creating a subversion repository, right click on it and go to the Security tab.

- Remove “Permission to Everyone” or select “No Access to Everyone” and give read/write access to digicorp users.

Visual SVN Server Installation & Configuration

We are now done with the server aspect of the configuration. A link will be created for the subversion repository like this: https://terminal.digi-corp.com/svn/subversion/

You can also specify the IP address instead of giving a domain name like this: https://192.168.0.204/svn/subversion/

Now I’ll descibe the client aspect of the subversion server.

Download the Tortoise SVN client and install in on a Windows machine. You can not install Tortoise SVN client on a Linux machine. For linux System you can use SmartSvn, KDESvn, etc.

Here is a link to download Tortoise SVN client for Windows: http://sourceforge.net/projects/tortoisesvn/files/Application/1.6.8/TortoiseSVN-1.6.8.19260-win32-svn-1.6.11.msi/download

After installing the Tortoise SVN client, right click on the desktop and select SVN Checkout. Accept Certificate permanently.

URL of Repository : https://terminal.digi-corp.com/svn/subversion

Visual SVN Sever Installation & Configuration

Now we have completed both the server and client aspect of the configuration.

Visual SVN Server has the backup and restore functionality also. But we have to use the command line.

Go to the following location on Server: C:\Program Files\VisualSVN Server\bin\

Execute the following command to Take backup: svnadmin.exe dump subversion

This is a Simple SVN Server solution and is very useful for smaller organizations that want to start or test the Subversion functionality. For use in bigger organizations you can try Linux-based Subversion Server which is very stable and more reliable as well.

SVN Hooks Configuration

May 11th, 2010 by bhumish.shah § 2

Today, I will show you an excellent way of doing a code review of your team.

This article is based on Fedora, Redhat, CentOS distribution.

I’ll talk about how to configure an SVN commit event for email notification on repositories  named svnmailtesting.

After installing subversion in Linux you can find the subversion-tool in following location:

/usr/share/doc/subversion-1.4.4/tools

You can find mailer.conf in the following location:

/usr/share/doc/subversion-1.4.4/tools/hook-scripts/mailer/mailer.conf.example/

An example for the Mailer.conf. is the main file for configuration. It looks like this after removing the comments:

[general]
smtp_hostname = 192.168.0.208
[defaults]
diff = /usr/bin/diff -u -L %(label_from)s -L %(label_to)s %(from)s %(to)s
commit_subject_prefix = [SVN-Commit]
propchange_subject_prefix =
lock_subject_prefix =
unlock_subject_prefix =
from_addr = [email protected]
to_addr = [email protected]
reply_to =
generate_diffs = add copy modify
show_nonmatching_paths = yes
[maps]

This is a very simple file . You have to just change the smtp server, “from” address and “to” address according to your environment.

You can either configure mailer.conf.example and rename it to mailer.conf file

or

Just copy and paste the above code in mailer.conf file

For example :

#vim mailer.conf

Copy the code above and paste it in the  mailer.con file and  change the smtp server , “from” address and “to” address. After completing these steps, copy mailer.conf file to following location:

cp mailer.conf  /var/www/svn/repo/svnmailtesting/conf/

After completing the  steps go to the following path:

/var/www/svn/repo/svnmailtesting/hooks/

Rename post-commit.tpl file to post-commit and make it executeable so the apache user can execute this file:

# cd  /var/www/svn/repo/svnmailtesting/hooks/
# mv post-commit.tpl post-commit
# chmod 770 post-commit
#vim post-commit

Add the following line at the end of the file:

/usr/share/doc/subversion-1.4.4/tools/hook-scripts/mailer/mailer.py commit “$REPOS” “$REV”

After completing these steps, whenever a user commit in svn repositories (svnmailtesting), one mail will get sent from [email protected] to [email protected] account with the subject: You have configured in mailer.conf file.

Great, so now you have an excellent way of doing code reviews of the developers.

Please write in comment if I have missed anything here.

Where am I?

You are currently viewing the archives for May, 2010 at Digicorp.