Setting up Subversion Environment

[article]
Summary:
This article describes the SVN installation on both server and client sides. Depending on the setup required, SVN installation could be anything from trivial to a nightmare.

This article describes the SVN installation on both server and client sides. Depending on the setup required, SVN installation could be anything from trivial to a nightmare.

We will describe the most common setup: accessing SVN via HTTP protocol using the Apache HTTP server, which is much closer to trivial than to nightmare. We have chosen this setup, since it seems to be the most common and also it’s a basis for more advanced setups (e.g. for LDAP integration). The steps are following:

    • Install Apache HTTP Server
    • Install Subversion
    • Configure Apache with Subversion

If you wish to live without Apache, then you can consult the Subversion Book or the Links section which points to some other tutorials on installing SVN with svn: protocol access.

Installing Apache
Subversion requires Apache 2.0.x edition (not the latest 2.2.x). The MSI installer can be downloaded from http://httpd.apache.org/download.cgi. Don't forget to choose the 2.0.x version. After downloading, start the installer and go thought the installation screens. When leaving the default values, you should end up with Apache installed as a Windows service and running on port 80. If you run some personal firewall or similar protection software, make sure to disable it so that it does not block any installation steps. Also, some communication programs, like Skype, occupy the port 80 by default, so it's safer to close them in advance. After the installation is finished, you will see the feather-like Apache status icon in the taskbar. Pointing your web browser to localhost will display Apache's welcome screen. That's all for basic Apache's installation.

Installing Subversion
The 'Downloads' section at http://subversion.tigris.org/ contains the link for the user-friendly exe installer. It contains components for both client and server side. During the installation make sure to check the option to install the Apache modules. After the installation is complete, the Subversion documentation icon should appear on your desktop. It's a Windows-help version of the Subversion Book, which contains the most complete information on any topic related to Subversion. Now, if you open the console window and try to type the svn or svnadmin command you will get the help screen (if not, then you might need to restart/relogin to update your path system variable).

Configure Apache with Subversion
The Subversion installation modifies your Apache configuration file to load the modules, which handle the Subversion requests. Now we will finalize the configuration by pointing Apache to your SVN repository. Open the httpd.conf file (usually in "C:\Program Files\Apache Group\Apache2\conf") and add the following text to the end: DAV svn SVNParentPath C:/SVN This tells Apache that all subfolders of C:/SVN are SVN repositories which will be accessible via the /repos URL.

Restart Apache for the settings to take effect (use the feather icon in your icon tray). Now, execute the following command to create the repository: c: mkdir \SVN cd \SVN svnadmin create sandbox. The last command creates the new SVN repository with name sandbox. Pointing your browser to localhost/repos/sandbox/ will now show the content of the repository revision 0 (zero). Note that we did not have to restart the Apache to add the repository.

Those, who prefer to have just one repository might use SVNPath instead of the SVNParentPath directive in httpd.conf and give the path up to the repository folder (e.g. c:/SVN/sandbox/ in our case).

Adding security
Now we have the repository created and accessible, but there are no restrictions and logins required, which is something we definitely don't want. Therefore we will add some security to our repository. We start with authentication (who you are) and then proceed to authorization (what are you allowed to do).

About the author

TechWell Contributor's picture TechWell Contributor

The opinions and positions expressed within these guest posts are those of the author alone and do not represent those of the TechWell Community Sites. Guest authors represent that they have the right to distribute this content and that such content is not violating the legal rights of others. If you would like to contribute content to a TechWell Community Site, email editors@techwell.com.

AgileConnection is one of the growing communities of the TechWell network.

Featuring fresh, insightful stories, TechWell.com is the place to go for what is happening in software development and delivery.  Join the conversation now!

Upcoming Events

Nov 09
Nov 09
Apr 13
May 03