You are here:Home»KB»Programming»General»Subversion (SVN)»Setting up a Windows based Subversion (SVN) Repository
Tuesday, 06 January 2015 18:49

Setting up a Windows based Subversion (SVN) Repository

Written by

SVN is short for Subversion

This article will deal with the problem of running your own Windows Based SVN Tracker on your own Pc so you controll your files and do not have to pay a subscription.

There are a few free to use SVN Repositories on the net but have stipulations such as your project must be OpenSource

Server Software

Free Windows Based SVN Servers

  Collabnet Subversion EdgeVisualSVN Server XAMPP BasedTortoiseSVN
Free Windows Based SVN Servers
Info
  • Not only is this a client but it can be used as a Sudo-Subverion Server
Pros  
  • Free
  • Opensource
  • Installs in one stack:
    • Apache HTTP Server
    • Apache Subversion
    • ViewVC - Browser Based Visual Repository extension
    • Web Based Admin (Responsive Design)
    • Java 1.6 JRE/JDK
    • Python
  • Auto Update feature
  • Web Based Admin - controls most stuff and can be accessed remotely
  • SVN Edge has a feature called "Discover Repositories" that automatically adds all the existing repositories you have. You just point it at the folder that contains your repositories.
  • REST API - for things like adding repositories and can be used by 3rd parties
  • can configure secure or non-secure
  • can set any port number
  • You can select the installation folder
  • you can set the repository Folder Seperately
  • can sysnc backups and files to CloudForge
  • Option of a free CloudForfge account for backups (250mb limit)
  • Network and Disk Statistics
  • creates its own SSL Certificate for SSL
  • Active Directory Authentication Support
  • Good Documentation - Also linked inside the Web Admin
  • Email admins on certain events
  • scheduled backups
  • Free
  • Installs in one stack:
    • Apache HTTP Server
    • Apache Subversion
    • Windows Management Snap-In
  • Graphically driven
  • Microsoft Management Console add-in
  • easy to configure and setup
  • can configure secure or non-secure
  • 8mb Installer Package
  • creates its own SSL Certificate for SSL
  • You can select the installation folder
  • you can set the repository Folder Seperately
  • Free
  • can be run on an existing Xampp stack
  • SVN can potentially be made portable with this method
  • more configurable
  • free
  • easy to setup a repository
  • can use the TortoiseSVN client to perform client side hooks
  • ideal for an inexperience single developer who just wants to start using a SVN repository quickly
Cons
  • 103mb Installer Package
  • on intial setup wizard the final step tries to get you to set a CloudForge account up. Click the cross on the 'Get Started' wizard button at the top left to cancel out.
  • Windows only
  • no remote admin in the free version
  • can only bind to preset port numbers
  • can only select the following ports
    • unsecure (http) 80/8080/81
    • secure (https) 443/8443
  • Free version cannot be installed on a computer with active directory (on a domain)
  • Extended configuration
  • Requires Xammp to be running
  • steeper learning curve
  • not a proper SVN server
  • does not have server side hooks
  • can really only support 1 developer because it does not handle locked files over networks properely

Binaries Only

This is the most difficult of all windows setup options, you basically are install another stack and have to configure the settings mainly through the command line. These are most definately installed as seperate software and are not portable. Unless you have any particular reason for installing binaries i would consider using Xammp as a abaase and install the SVN into that, you can then easily backup all of your work and configuration. I personally prefere the AIO packages where there is a central management of the SVN and stack.

Free Online SVN, GIT and Mecurial Repositories

  • Free source code hosting for Git and Mercurial by Bitbucket - Is Bitbucket free for small teams? Yes! Sign up for the 5 users free plan and you can have unlimited public and private repositories.
  • http://beanstalkapp.com/ – Secure, private and reliable Git and Subversion hosting. View activity, browse files, compare revisions. Great user interface. Integrates with a bunch of popular services, including Twitter! From $15 a month
  • http://unfuddle.com/ – popular subversion and git hosting and hosted project management solution for software development teams. Comes with a handy Widget for Mac OS – you can monitor account activity across all of your projects from one simple interface. Free with 2 people, with 1 project for up to 200MB storage
  • http://www.sliksvn.com/ – another option for free hosting, but not as good as unfuddle, subscriptions are competitive. Free with 1 person, with 1 project for up to 100MB storage
  • http://xp-dev.com – Subversion, GIT and Mercurial hosting. A decent feature set and represent excellent value for money. From $5 a month with unlimited projects, users and up to 2GB of storage
  • CodePlex - Open Source Project Hosting - free, and uses Subversion (through the TFS hook), as well as giving you forums, documentation areas, etc.:
  • Google Code - Project Hosting on Google Code provides a free collaborative development environment for open source projects.
  • GitHub - Unlimited Collaborators and Repositoriesbut you must pay for provate ones. GitHub is greate for opensource projects.
  • DreamHost - Shared Web Hosting - Although not free, this accounts offers 'Ruby On Rails' and a Subversion Repository included in the price.

Tutorials / Useful

Binaries' Installation Docs

Which One Should I Install?

currently if you are using windows you can select either VisualSVN Server or CollabNet Subversion Edge (i need to try both). If you are running linux you really only have the choice of CollabNet if you want an AIO Package. I have not examined the Xampp setups yet, but these are more hands on for people to set up.

CollabNet Subversion Edge - Most feature, is free, opensource and actively developed by the founders of Subversion (CollabNet)

CollabNet Subversion Installation

Security Settings

  • change the admin username and password to something complex especially if you are going online with this.
  • it is not currently possible to change the 'admin' username

Make Server Available from a FQDN

Setting up the online presences of your windows subversion server so you can access it from the internet.

At the moment your subversion server is currently only available to your local network, so neither you or other people working on projects can access the server. The following instruictions will bridge the final gap to having your own SVN server running under your control with no montly fees and where you can keep your files private.

Theses instructions assume you have a cpanel account

  1. create a dynamic-IP account (i used NOIP because they are free and my router supports them)
  2. configure your router or PC client (as appropriate) to correctely update your IP to your dynamic-IP provider
  3. create a dynamic domain. I use a random domain to prevent hackers scanning the free domains for potential targest ie. drguosdh334lkkjsad34.ddns.net
  4. setup a CNAME in you cPanel svn.mydomain.com pointing to drguosdh334lkkjsad34.ddns.net with a TTL of 64 seconds (Read This on TTL)
  5. give your PC/Sever a static IP address
  6. when you set up your SVN server you set the repository to be on a port, ie 18080, you need to port forward this port in the router and point it to your PC/Server
  7. allow this port to be used in your firewall
  8. if you want the remote admin panel to be available remotely aswell you need to port forward one of those aswell. (CollabNet insecure - http://localhost:3343/csvn, secure - https://localhost:4434/csvn/, you only need to forward the one you want, i would recommend only use secure, if secure is selected but you go to the in-secure a meta refresh is performed to re-direct you to the secure version)

You can now access you SVN server from the outside world using drguosdh334lkkjsad34.ddns.net (FQDN)  but you cannot use your FQDN locally. To fix that do the following

  1. edit your 'hosts' file as administrator
  2. add the following line
    127.0.0.1 drguosdh334lkkjsad34.ddns.net

Done, you now have a fully working Subversion server online via http://svn.mydomain.com/. you might be wondering why i have added an extra domain step to the instructions above. I have used a random domain name that should be hard for hackers to find and then use that to probe my netwrok, because using NOIP i basically give a domain name to my IP. I can use http://svn.mydomain.com/ to make my life easier to configure Matis and any other required software such as TortoiseSVN but while maintaining some extra security.

  • If the domain drguosdh334lkkjsad34.ddns.net becomes comprimised i can change the Dynamic-IP withou having to reconfigure my Subversion software.
  • If you wanted you do not need to add the cPanel DNS step in, you could use a sensible domain from a Dynamic-IP provider and use that domain to configure all of your software directely.
  • You will have to allow any SSL Certificate prompts that appear because you will be using effectively a different domain than localhost

Hostname (in WebAdmin)

  • in server setting it might be advantageous to change the Hostname to match your new domain, svn.mydomain.com , I do not know if this is absolutely required but keeps things the same.
  • You might might want to edit your shortcut to be http://svn.mydomain.com:3343/csvn :3343/csvn , again this is not mandator

Notes

  • 18080 - alternate port suggestion
  • From the Web Admin i could not get either of the following to work:

    Repository parent:    https://Mypc:18080/svn/
    or 
    Browse repositories:    https://Mypc:18080/viewvc/
    Solutions:
    • i had VisualSVN installed aswell, i had to do a full uninstall of VisualSVN and edgeSVN and re-install of edgeSVN
    • when it was not working it had an IP as the FQDN (The fully qualified Hostname), when the edgeSVN works it put in my computer name as the FQDN ie Mypc
    • If on a Dynamic IP make sure when you restart the server/windows PC that you have the same IP address and that subversion is not bound to another IP. Using the computers name or 127.0.0.1 would resolve dynamic IP adddress issues, or just use static IP address.
  • help files for viewvc are only from within the program itself

NB:

  • no other configuration was required to get SVN or ViewVC to work
  • also browser adblockers might affect functionality

SVN / Subversion General Notes

  • You cannot put repositories in subfolders. According to the rules all repositories should be in the root folder

CollabNet Subversion Edge Installation Notes

Edge Webadmin Service does not install and run during setup

When you install collabnet all goes well and you get to the webpage at the end saying that it is waiting for the service to start. It eventually times out and point you towards their help page.

The server does not start because according to the CollabNet official wikie there is something wrong with the Java Path. Whether it is missing or pointing to the wrong version, either way this prevents the service getting installed properely.

The remedy suggested, is to run there installservice.bat (located in {subversioin}/scwrapper/bat/), which does indeed install the missing WebAdmin service. When you then start the WebAdmin service  you get the following error:

Error 503 Service Unavailable

Causes

  • The 503 error is caused by incompatible Java (JRE) version.
  • You get this error because the Java based Service/WebAdmin cannot start properely.
  • This can be caused by installing another piece of software (ie netbeans) that installs a different version of java (ie JRE 8) which alters the path accordingly to its installation procedure. It is possible to install several version of java, but the path to java that is left in the enviromental variable is usually points to the last installed version of java.

NB You should note that the Apache Subversion Service will not start because it does not have a httpd.conf yet. You use the Web Admin to make this file on the intial setup of Subversion Edge so dont worry about the subversion service yet. When you get this service running you can save your settings which will fix the Subversion service.

Solution to these issues can be one of the following

  1. Uninstall the latest version of java (ie jre 8) making sure you have jre7 left installed, run the deleteservice.bat and then run installservice.bat to re-install the service but with the correct bin path
  2. Edit the service bin path to reflect JRE 7 in the registry, see the example below.
"C:\Program Files\Java\jre7/bin/java.exe" "-classpath" "D:\Documents\Developer\SubversionEdge\svcwrapper\wrapper.jar" "-Xrs" "-Dwrapper.service=true" "-Dwrapper.working.dir=D:\Documents\Developer\SubversionEdge\svcwrapper\..\appserver" "-Dwrapper.config=D:\Documents\Developer\SubversionEdge\svcwrapper\conf\wrapper.conf" "-Dwrapper.additional.1x=-Xrs" "org.rzo.yajsw.boot.WrapperServiceBooter" 

Notice that it points to java 7

Read 5263 times Last modified on Wednesday, 11 February 2015 10:17