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!