{"id":147,"date":"2007-06-12T16:21:08","date_gmt":"2007-06-12T22:21:08","guid":{"rendered":"http:\/\/jameskovacs.com\/2007\/06\/12\/Installing+Subversion+As+A+Windows+Service"},"modified":"2007-06-12T16:21:08","modified_gmt":"2007-06-12T22:21:08","slug":"installing-subversion-as-a-windows-service","status":"publish","type":"post","link":"https:\/\/www.jameskovacs.com\/index.php\/2007\/06\/12\/installing-subversion-as-a-windows-service\/","title":{"rendered":"Installing Subversion as a Windows Service"},"content":{"rendered":"<p>Having done this a few times before and always ending up scouring the documentation regarding exactly how to enable the options I need, I&#8217;m hereby committing it to long-term memory&#8230;<\/p>\n<p>Subversion 1.4.0 and later support running Subversion directly as a Windows Service. This allows you to access your repository via TortoiseSVN, svn.exe, etc. using:<\/p>\n<p>svn:\/\/server\/RepoName<\/p>\n<p>You can find <a href=\"http:\/\/subversion.tigris.org\/faq.html#svnserve-win-service\">information<\/a> in the Subversion FAQ as well as a link to a <a href=\"http:\/\/svn.collab.net\/repos\/svn\/trunk\/notes\/windows-service.txt\">document<\/a> describing exactly how to set it up. There is no tool provided to configure the Windows Service. So you&#8217;re stuck using sc.exe, the Service Control command line tool, which ships with various versions of Windows. It is rather quirky, even for command line tools. Note that the name\/value pairs are &#8220;Name=&#8221; followed by a space followed by &#8220;Value&#8221;. The equals sign is part of the name and won&#8217;t work if the equals sign is omitted or if you insert a space before the equals sign.*<\/p>\n<p>Here&#8217;s how I typically configure Subversion to run as a service:<\/p>\n<p>sc create &lt;ServiceName&gt; binPath= &#8220;\\&#8221;&lt;PathToSvnBin&gt;\\svnserve.exe\\&#8221; &#8211;service -r &lt;SrcRepoRoot&gt;&#8221; DisplayName= &#8220;Subversion Service&#8221; depend= Tcpip start= auto obj=&nbsp;&lt;Computer or Domain\\ServiceAccount&gt; password= &lt;Password&gt;<\/p>\n<p>where<\/p>\n<p>&lt;ServiceName&gt; is the name of the service (as used in commands such as net stop &lt;ServiceName&gt;).<\/p>\n<p>&lt;PathToSvnBin&gt; is the fully-qualified path to svnservce.exe. N.B. You have to surround it with \\&#8221; to escape the path if it contains spaces.<\/p>\n<p>&lt;SrcRepoRoot&gt; is the fully-qualified path to the directory that contains all your repositories.<\/p>\n<p>&lt;ComputerOrDomain\\ServiceAccount&gt; is the user account under which you want to run the service. You need to include the computer or domain name (depending on if it&#8217;s a local or domain account, respectively).<\/p>\n<p>For my environment, it ends up looking like this:<\/p>\n<p>sc create svnserve binPath= &#8220;\\&#8221;C:\\Program Files\\Subversion\\bin\\svnserve.exe\\&#8221; &#8211;service -r c:\\SrcRepos&#8221; DisplayName= &#8220;Subversion Service&#8221; depend= Tcpip start= auto obj= Server\\SvnDaemon password= P@ssw0rd<\/p>\n<p>I usually use a local computer account, SvnDaemon, for running my repositories. After creating the account, I remove it from the Users group. By removing the account from Users, no one can log in using that account and it also removes it from the main log-in screen in Windows XP and Vista. In Local Security Policy&#8230; Local Policies&#8230; User Rights Assignment&#8230;, grant SvnDaemon the &#8220;Log on as a service&#8221; privilege. Explicitly grant Full Control to c:\\SrcRepos.<\/p>\n<p>Last thing you need to do is punch a hole in your firewall to allow connections on the standard svn port, which is TCP 3690.<\/p>\n<p>Now you can start the service via &#8220;net start svnserve&#8221;.&nbsp;Your firewall&nbsp;might prompt you to grant permission for svnserve.exe to listen on the Subversion port.<\/p>\n<p>Time to test. Launch the TortoiseSVN RepoBrowser and enter &#8220;svn:\/\/server\/RepoName&#8221;. You should be able to now browse your repository.<\/p>\n<p>* Note that PowerShell doesn&#8217;t grok the &#8220;Name=&#8221; syntax. PowerShell tries to interpret it as some sort of assignment. I haven&#8217;t bothered digging in to find out how to instruct PowerShell to treat the &#8220;Name=&#8221; literally. In the meantime, it works just fine from cmd.exe. <img decoding=\"async\" alt=\"Confused\" src=\"http:\/\/messenger.msn.com\/MMM2006-04-19_17.00\/Resource\/emoticons\/confused_smile.gif\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Having done this a few times before and always ending up scouring the documentation regarding exactly how to enable the options I need, I&#8217;m hereby committing it to long-term memory&#8230; Subversion 1.4.0 and later support running Subversion directly as a Windows Service. This allows you to access your repository via TortoiseSVN, svn.exe, etc. using: svn:\/\/server\/RepoName [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,11],"tags":[],"class_list":["post-147","post","type-post","status-publish","format-standard","hentry","category-agile","category-miscellaneous"],"_links":{"self":[{"href":"https:\/\/www.jameskovacs.com\/index.php\/wp-json\/wp\/v2\/posts\/147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jameskovacs.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jameskovacs.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jameskovacs.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jameskovacs.com\/index.php\/wp-json\/wp\/v2\/comments?post=147"}],"version-history":[{"count":0,"href":"https:\/\/www.jameskovacs.com\/index.php\/wp-json\/wp\/v2\/posts\/147\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jameskovacs.com\/index.php\/wp-json\/wp\/v2\/media?parent=147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jameskovacs.com\/index.php\/wp-json\/wp\/v2\/categories?post=147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jameskovacs.com\/index.php\/wp-json\/wp\/v2\/tags?post=147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}