My program doesn't have bugs. It just develops random features.

Legacy:Setting Up A Subversion Server

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search

Setting up a Subversion Server under Windows[edit]

There are a few ways to set up a Subversion server on your Windows machine. The easiest way, is just to put a shortcut to the svnserve.exe program with appropriate arguments in your Startup folder, but this has some drawbacks:

  • It's only running when you're logged in.
  • It causes an empty command window to show up on your desktop. This can be minimized, but it still shows up in the taskbar.


A better way would actually be to set up the Subversion server as a Windows service, which avoids both of these problems. This document will describe how to do this.


Download the Windows Resource Kit Tools[edit]

The "Windows Server 2003 Resource Kit Tools" package can be downloaded from Microsoft's download site (http://www.microsoft.com/downloads) under the "System Management Tools" download category (or directly from http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en). Note that Microsoft does seem to have a number of confusingly-similarly named packages available for download from their site. You're looking for the one which has a file name of rktools.exe.


Install the Windows Resource Kit Tools[edit]

As with Subversion, this is a simple matter of double-clicking the downloaded installer and following the prompts. After doing this, to test that the installation all went ok, open a command prompt window (Start->Run, "cmd"), and type "instsrv". You should get a brief message describing INSTSRV's command syntax. (If you don't, try looking for INSTSRV.EXE in the location you told the Resource Kit to install, and use its full path name instead)


Configure Subversion to Run as a Service[edit]

First we will need to install an appropriately-named service using the SRVANY.EXE utility provided by the Resource Kit. To do this, you will need to open a command window and type the following:

 instsrv "Subversion" "C:\Program Files\Windows Resource Kits\Tools\srvany.exe"  
 

(This assumes you've installed the Resource Kit Tools in the default location of C:\Program Files\Windows Resource Kits\Tools. If you installed it somewhere else, obviously, you'll need to change the path to srvany.exe appropriately.)


The SRVANY program is designed to allow any program to run as a service, but we still need to tell it what program it's supposed to be running. Unfortunately, this step requires a little bit of fiddling with the Windows Registry.


NOTE: Changing the wrong things in the Registry can seriously break your Windows system. Always be careful when using the Windows Registry Editor, and be sure to back up your system before doing changes like this. (That having been said, if you're careful about what you change, using the Registry Editor usually isn't as scary as it sounds)

Start up the Registry Editor by choosing "Run..." from the Start menu and typing the following:

 regedt32  


On the left side of the Registry Editor is what looks like a directory tree view (these are locations in the registry, not actual directories on the disk, but the navigation is the same). Find the following path and select this folder:

 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Subversion  


  1. From the Edit pulldown menu, select New->Key
  2. For the name of the new key, type "Parameters"
  3. From the Edit pulldown menu, select New->String Value
  4. For the name of the new string value, type "Application"
  5. From the Edit pulldown menu, select "Modify" (or just double-click the new "Application" key in the right pane)

An "Edit String" dialog box will appear. Type the following:

 C:\Program Files\Subversion\bin\svnserve.exe  

(This assumes Subversion is installed in C:\Program Files\Subversion, of course)


  1. From the Edit pulldown menu, select New->String Value
  2. For the name of the new string value, type "AppParameters"
  3. From the Edit pulldown menu, select "Modify" (or just double-click the new "AppParameters" key in the right pane)

An "Edit String" dialog box will appear. Type the following:

 -d -r C:\Subversion  

(the -d- flag tells it to run as a daemon (server) process, and the -r C:\Subversion- tells it where the directory with the repositories lives)



Now our service should be configured properly, we just need to give it a try:

  1. Open the Services control panel (this may be under the "Administrative Tools" subfolder in Control Panels).
  2. You should now be able to find a "Subversion" service in the list of services. Select this service.
  3. From the Action menu, select "Start".


If all goes well, the Subversion process should now say "Started" in its Status column.


You now have a Subversion server running, serving all of the repositories under your C:\Subversion directory. This means that repositories which you've been accessing with URLs like:

 file:///C:/Subversion/repository_name  

..can now also be accessed as..

 svn://localhost/repository_name  

(note that there are only two slashes (//) before "localhost")


So let's give our new server a try. Assuming that you've set up a repository as described in Setting up Subversion, we should be able to access it now as svn://localhost/UT_work:

  1. Right click on a file or folder somewhere (doesn't matter where) and select "TortoiseSVN->Repo-Browser" from the pop-up menu.

For the repository URL, type:

 svn://localhost/UT_work  



You should see your repository and its contents show up in the Repository Browser window.


The Easy Alternative[edit]

If all that is far too complicated for you, there also is a small commandline tool for setting up SVNServe as a service: SVNService. Extract SVNService.exe to the same directory as SVNServe.exe (by default that is C:\Program Files\Subversion\bin) and you are ready to go.

Usage is really easy:

Installing the service 
SVNService -install [SVNServe parameters]  

This will create a new service with the name "SVNService". The service is initially configured to be started manually.\\

Useful SVNServe parameters might be "-d -r D:\Path\To\Repository".

Changing the service parameters 
SVNService -setup [new SVNServe parameters]
 
Removing the service 
SVNService -remove  

This will also stop the service if it's till running.


Note that SVNService can manage only one service. You'll have to go the long way described above if you want more than that.


Controlling Access[edit]

By default, Subversion repositories accessed through a Subversion server are readable by anyone, but only writable by people who have been specifically authorized to do so. Obviously, you will want to do a bit of configuration to specify who's allowed to do what, and how Subversion is supposed to tell who people are.


This configuration is done by editing the svnserve.conf file located in the conf directory of each repository (for example, C:\Subversion\UT_work\conf\svnserve.conf). Open this file in a text editor.


In the configuration file, lines starting with # are comments, so as you can see, the default file has everything commented out. You will want to add a few lines (or uncomment the ones that are already there):

 [general]  
 anon-access = read  
 auth-access = write  
 password-db = passwd  
 realm = My Subversion Repository  
 

(obviously, you can change the anon-access and auth-access lines if this isn't the behavior you want. For example, you could change them to anon-access=none if you don't want anonymous users seeing your repository contents, and auth-access=read if you only want to provide read access to the people you specify (in which case you will only have write access via local (file:) URLs))


The realm parameter is a way of grouping multiple repositories to use a single login. If two repositories have the same realm, all Subversion clients will assume they can use the same username/password to login to them. Since we're not working with multiple repositories (yet), it doesn't really matter what we put here as long as it's unique, but it is displayed by many clients when prompting for a password, so it's good to use something descriptive.


The password-db parameter specifies the name of a file to have usernames and passwords in, which is relative to the conf directory. In this case, we've specified a filename of passwd, so we now need to create a passwd file in the same directory as our svnserve.conf. In the new passwd file, add the following:

 [users]  
 my_username = my_password  
 

(Obviously, replace my_username and my_password with an appropriate username and password for yourself). You can also add as many other account usernames and passwords as you want in the same form under the [users] section.


There is one other aspect to access which needs to be mentioned: In order for other people to access your new Subversion server, they will need to be able to connect to your machine on TCP port 3690. You will need to make sure that your machine is reachable from the outside world (not behind a NAT router or firewall of some kind) and that port 3690 is not blocked by any personal firewall software you may have installed). Other users should then be able to access your repository using URLs of the form:

 svn://your_hostname_or_ip/repository_name  
 

Related Topics[edit]


Other Resources[edit]

http://support.microsoft.com/kb/q137890/ 
Microsoft Knowledge Base article on how to use INSTSRV and SRVANY.
http://subversion.tigris.org/ 
The Subversion web site.



----