Adam Howitt's Blog

Sep 26
2008

Steps to setup Subversion 1.5.2 on a Windows Server

I've install Subversion on several windows machines lately and after repeatedly having to re-research how to do it by scanning through my Google Bookmarks and History, I've decided to save it somewhere I'll remember to look! Your mileage may vary depending on your environment but this works for me:

Install SVN
  1. Download and run binaries MDI for 1.5.2
  2. Edit environment variables to add svn_editor to point at your choice. Mine was
    "c:\program files\Notepad++\Notepad++.exe"

Create a Repo

  1. svnadmin create "c:\repos\mynewrepo" cd c:\repos\mynewrepo\conf
  2. edit svnserve.conf
    • set realm=myrealm where myrealm is distinct for the repo you are creating
    • set anon-access=none and uncomment this line
    • set auth-access=read and uncomment
    • set password-db=passwd and uncomment
  3. edit passwd file
    • remove the default users
    • add users in the format uname = password one per line
  4. test the repo is working (optional)
    • in one command prompt window type
      svnserve --daemon --root "c:\repos\mynewrepo"
    • in another command prompt window type
      svn mkdir svn://localhost/myproject
    • your svn_editor of choice should open so add a comment at the top and close it
    • in the command prompt window it should ask you to authenticate
    • it defaults to the current logged in username so unless you created that user hit return to skip
    • enter the username of a user you added in the passwd file
    • enter the password
    • you should see "committed revision 1"
Setup SVN as a service
  1. Open command prompt and type:
    sc create ecoscenesvn binpath= "c:\Program Files\Subversion\bin\svnserve.exe --service --root c:\repos\mynewrepo --listen-port myPort" displayname= "SVN Reponame" depend= Tcpip
    Note:myport helps you differentiate between the ports to use for different repos
  2. Go to services panel and start the service
  3. Open a command prompt
  4. Go to a directory to perform a test checkout
  5. svn checkout svn://localhost:81/myproject
    (if you created a myproject in the test and you used port 81 as the listen-port)
  6. You should see "checked out revision 1"

Note: you can also test this with tortoisesvn by using the repo browser by pointing it at the URL svn://hostnameorip:81/ where hostnameorip is your server hostname or an IP address and port 81 was the listen port

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
[Add Comment] [Subscribe to Comments]
  1. Use VisualSVNServer

    http://www.visualsvn.com/server/

  2. Nice - thanks Michael. That's really useful. I still need to the initial setup reminders but I'll be trying this very soon!

[Add Comment]