{"id":182,"date":"2010-08-09T14:38:42","date_gmt":"2010-08-09T19:38:42","guid":{"rendered":"http:\/\/www.compdigitec.com\/labs\/?p=182"},"modified":"2011-01-16T18:22:07","modified_gmt":"2011-01-16T23:22:07","slug":"setting-up-a-subversion-server-using-apache-on-ubuntu","status":"publish","type":"post","link":"http:\/\/www.compdigitec.com\/labs\/2010\/08\/09\/setting-up-a-subversion-server-using-apache-on-ubuntu\/","title":{"rendered":"Setting up a Subversion server using Apache on Ubuntu"},"content":{"rendered":"<p>Subversion is an excellent open-source solution for keeping track of the different versions while developing software. Here, we will see how to set up a subversion server on an Ubuntu 10.04 LTS Server to provide programmers with the ability to use Subversion.<\/p>\n<p><strong>Prerequisities<\/strong><\/p>\n<p>Apache 2 should have already been installed and configured with SSL &#8211; if not, see the <a href=\"https:\/\/help.ubuntu.com\/10.04\/serverguide\/C\/httpd.html\">Ubuntu Server Guide<\/a> for more details. Install the packages <em>subversion<\/em> and <em>libapache2-svn<\/em>:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">sudo apt-get install subversion libapache2-svn<\/pre>\n<p><strong>Setting up<\/strong><\/p>\n<ol>\n<li>Create a home for the Subversion files:\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">sudo mkdir -p \/var\/svn<\/pre>\n<\/li>\n<li>Open up <strong>\/etc\/apache2\/mods-available\/dav_svn.conf<\/strong> in your favourite text editor of choice, and add the following text at the bottom (ignore anything already there):\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">&lt;Location \/svn&gt;\r\n     DAV svn\r\n     SVNParentPath \/var\/svn\r\n     SVNListParentPath On\r\n     AuthType Basic\r\n     AuthName &quot;Subversion Repository&quot;\r\n     AuthUserFile \/etc\/subversion\/passwd\r\n     &lt;LimitExcept GET PROPFIND OPTIONS REPORT&gt;\r\n        Require valid-user\r\n     &lt;\/LimitExcept&gt;\r\n  &lt;\/Location&gt;<\/pre>\n<\/li>\n<li>Add a user to the Subversion &#8211; if you don&#8217;t, you may end up with strange errors like &#8220;<strong>svn: Server sent unexpected return value (500 Internal Server Error) in response to MKACTIVITY request<\/strong>&#8221; when trying to commit.\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">sudo htpasswd -c \/etc\/subversion\/passwd admin<\/pre>\n<p>It will prompt for a password &#8211; just give it something.<\/li>\n<li>You&#8217;re good to go &#8211; although without any projects the server won&#8217;t have anything to commit to. Add a project to the server:\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">sudo mkdir -p \/var\/svn\/project\r\nsudo svnadmin create \/var\/svn\/project<\/pre>\n<\/li>\n<\/ol>\n<p><strong>Results\/Errors<\/strong><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">svn commit -m nomsg test1 test2\u00a0 --username=root --password=top_secret_root_password_here<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">svn: Commit failed (details follow):\r\nsvn: Server sent unexpected return value (500 Internal Server Error) in response\r\n to MKACTIVITY request for '\/svn\/project\/!svn\/act\/53aca034-c64b-5b41-8bf4-\r\n2715d91af049'<\/pre>\n<p>This error is because you do not have a valid login passed to the server, although it could use a much, much more descriptive message than &#8220;Internal Server Error&#8221;. Remember the login is <em><strong>not<\/strong><\/em> the Unix login, but instead the login created with htpassed.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">svn commit -m nomsg test01 test02 --user\r\nname=admin\u00a0 --password=password_createdby_htpasswd_here<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">Adding\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 test01\r\nAdding\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 test02\r\n\r\nCommitted revision 1.<\/pre>","protected":false},"excerpt":{"rendered":"<p>Subversion is an excellent open-source solution for keeping track of the different versions while developing software. Here, we will see how to set up a subversion server on an Ubuntu 10.04 LTS Server to provide programmers with the ability to use Subversion. Prerequisities Apache 2 should have already been installed and configured with SSL &#8211; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14,3],"tags":[16,704,862,703,545,28],"_links":{"self":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/182"}],"collection":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/comments?post=182"}],"version-history":[{"count":0,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/182\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/media?parent=182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/categories?post=182"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/tags?post=182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}