Subversion on Server Core
5/7/2008 8:40:05 PMTechnologies
- Windows Server 2008 x64
- Windows Server Core x64
- Subversion 1.4.6
- TortoiseSVN 1.4.8
Having set up Subversion on Windows 2000, 2003, and XP machines without a hitch, I'm happy to report that setting up Subversion on Windows Server 2008 Server Core is also easy!
One of the virtual machines that I set up for my home development environment was a server core machine dedicated to source control. I named it DEV-SOURCE. After looking at a few other source control solutions, specifically git and svk, I decided that subversion was all I need at this time and and would play really nice with my windows environment.
Quick Subversion Setup
I download and copy the svn setup file onto my DEV-SOURCE machine then run the install and complete the wizard. I used all the default settings except I unchecked the desktop and quick launch icons.
C:\Users\Administrator>cd installs
C:\Users\Administrator\Installs>svn-1.4.6-setup.exe
Once completed subversion is installed at C:\Program Files (x86)\Subversion.
To make using subversion easier I set it on the PATH using the setx tool. You need to log out and log back in so that the PATH environment variable is updated.
c:\Users\Administrator>setx PATH "%PATH%;C:\Program Files (x86)\Subversion\bin"
SUCCESS: Specified value was saved.
c:\Users\Administrator>shutdown /l
Creating the source code repository can be done with the svnadmin create command. I then change to the new repository to make sure all went well.
C:\Users\Administrator>svnadmin create c:\svn_repository
C:\Users\Administrator>cd c:\svn_repository
c:\svn_repository>dir
Directory of c:\svn_repository
05/01/2008 04:32 PM <DIR> .
05/01/2008 04:32 PM <DIR> ..
05/01/2008 04:32 PM <DIR> conf
05/01/2008 04:32 PM <DIR> dav
05/01/2008 04:32 PM <DIR> db
05/01/2008 04:32 PM 2 format
05/01/2008 04:32 PM <DIR> hooks
05/01/2008 04:32 PM <DIR> locks
05/01/2008 04:32 PM 234 README.txt
2 File(s) 236 bytes
7 Dir(s) 132,327,505,920 bytes free
To configure subversion I set the authorization and passwords as follows:
c:\svn_repository>notepad conf\svnserve.conf
Add these lines to the bottom:
anon-access = none
auth-access = write
password-db = passwd
c:\svn_repository>notepad conf\passwd
Add your user name and password:
evan = *****
Then I create the subversion service and start it.
c:\Users\Administrator>sc create svnserver binpath= "C:\Program Files (x86)\Subversion\bin\svnserv
e.exe --service -r c:\svn_repository" DisplayName= "Subversion" depend= tcpip start= auto
[SC] CreateService SUCCESS
c:\Users\Administrator>net start svnserver
The Subversion service is starting.
The Subversion service was started successfully.
Finally you will need to open up the subversion port 3690 in windows firewall for remote access.
c:\Users\Administrator>netsh advfirewall firewall add rule name="Subversion" dir=in action=allow
protocol=TCP localport=3690
Ok.
To test this out download and install tortoise svn on your client machine. Right click in a directory and go to TortoiseSVN -> Repo-browser. Connect to the server in my case DEV-SOURCE and make sure you can create a few folders. Happy coding!
Comments
Nice one Evan, really useful to know its possible! You'll even be forgiven for that wild hair of yours...just kidding.
Thanks,
Ross
Dustin Frost
7/31/2009 4:34:49 PMEvan,
I read through your documentation. I cannot find the svn-1.4.6-setup.exe on the Internet. I looked over the CollabNet, Tigris, SlikSVN, and VisualSVN sites with no luck. Where do you recommend I find the Subversion setup file? I'm running Windows Server 2008 x64.
Dustin Frost
7/31/2009 5:07:22 PMEvan,
I found the file (google.com svn-1.4.6-setup.exe) and followed your instructions and installed the subversion repository on our Windows Server 2008 x64 server. Ultimately our goal is to be-able to connect to my repository over the Internet securely. I have downloaded and instaled the tortoise svn and went into the repo browser. I've typed in our server name: www.ourservername.com/svn_repository but we get an error OPTIONS of 'www.ourservername.com/svn_repository could not connect to server (www.ourservername.com) Do you have any advice on how to expose the Subversion Repository to the Internet?
Best,
Dustin Frost
Jan
10/12/2009 5:24:31 PMThanks to you I came a long way, but not to the end. Luckily I found it myself and feel I must share this. I use a more recent version (1.6.5) and it didn't work.
telnet localhost 3690
did work, but the same from another computer only gave timeouts. nmap showed the server wasn't listening.
netstat -a
showed that only :: listened on 3690. So I added
--listen-host 0.0.0.0
to the svnserve parameters and this made it al work.
earthStrapped
1/17/2010 1:06:18 PMThis worked great! I didn't have success w/ 1.6.5, but I didn't really understand what Jan was saying. 1.4.6 worked great just as described.
As far as accessing over the internet [Dustin Frost], I wouldn't think this would be difficult. Try forwarding port 3690 on your router to the IP address of your core server machine.
Beat
5/17/2010 9:13:56 AMJans hint about --listen-host 0.0.0.0 was essential to me. I searched several hours for a reason, why the new W2k8 x64 refused connection from all my clients.
Thanks a lot!