{"id":433,"date":"2022-04-04T07:57:49","date_gmt":"2022-04-04T07:57:49","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2015\/09\/22\/setup-svn-server-with-apache2-in-ubantu\/"},"modified":"2022-12-23T06:19:50","modified_gmt":"2022-12-23T06:19:50","slug":"setup-svn-server-with-apache2-in-ubantu","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/setup-svn-server-with-apache2-in-ubantu\/","title":{"rendered":"How to Setup SVN Server with Apache2 in Ubuntu"},"content":{"rendered":"\n<p>This article will help you for step by step setup of Subversion (svn) server on Ubuntu 18.04 LTS &amp; 16.04 LTS systems.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1 \u2013 Install Apache<\/h2>\n\n\n\n<p>First of all, you need to install the Apache webserver to access the svn server using HTTP URLs. Skip this step if you already have Apache web server on your system.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get update\nsudo apt-get install apache2\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2 \u2013 Install SVN Server<\/h2>\n\n\n\n<p>Use the following command to install subversion packages and their dependencies. Also, install svn module for Apache libapache2-mod-svn packages on your system.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get install subversion libapache2-mod-svn libapache2-svn libsvn-dev\n<\/pre>\n\n\n\n<p>After installation, enable required Apache modules and restart Apache service.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo a2enmod dav dav_svn\nsudo service apache2 restart\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3 \u2013 Create First SVN Repository<\/h2>\n\n\n\n<p>Use the following commands to create your first svn repository with name&nbsp;<strong>myrepo<\/strong>. Also, set the required permissions on newly created directories.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo mkdir -p \/var\/lib\/svn\/\nsudo svnadmin create \/var\/lib\/svn\/myrepo\n\nsudo chown -R www-data:www-data \/var\/lib\/svn\nsudo chmod -R 775 \/var\/lib\/svn\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4 \u2013 Create Users for Subversion<\/h2>\n\n\n\n<p>Now create first svn user in&nbsp;<strong>\/etc\/apache2\/dav_svn.passwd<\/strong>&nbsp;file. These users will use for authentication of svn repositories for checkout, commit processes.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo touch \/etc\/apache2\/dav_svn.passwd\nsudo htpasswd -m \/etc\/apache2\/dav_svn.passwd admin\n<\/pre>\n\n\n\n<p>To create additional users, use following commands.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo htpasswd -m \/etc\/apache2\/dav_svn.passwd user1\nsudo htpasswd -m \/etc\/apache2\/dav_svn.passwd user2\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5 \u2013 Configure Apache with Subversion<\/h2>\n\n\n\n<p>Subversion Apache module package creates an configuration file&nbsp;<strong>\/etc\/apache2\/mods-enabled\/dav_svn.conf<\/strong>. You just need to make necessary changes to it.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo vi \/etc\/apache2\/mods-enabled\/dav_svn.conf\n<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">Alias \/svn \/var\/lib\/svn\n&lt;Location \/svn&gt;\n\n   DAV svn\n   SVNParentPath \/var\/lib\/svn\n\n   AuthType Basic\n   AuthName \"Subversion Repository\"\n   AuthUserFile \/etc\/apache2\/dav_svn.passwd\n   Require valid-user\n     \n&lt;\/Location&gt;\n<\/pre>\n\n\n\n<p>Save the file and restart the Apache service to apply the new configuration.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo service apache2 restart\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 6 \u2013 Access Repository in Browser<\/h2>\n\n\n\n<p>Use HTTP URLs to access your repository in the browser. It will prompt for authentication. Use login credentials created in Step 5. Change example.com with your system hostname, domain name or IP address.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> http:\/\/example.com\/svn\/myrepo\/\n<\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/tecadmin.net\/wp-content\/uploads\/2016\/11\/subversion1.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/tecadmin.net\/wp-content\/uploads\/2016\/11\/subversion1.png\" alt=\"Install Svn Server 1\" class=\"wp-image-10903\"\/><\/a><\/figure><\/div>\n\n\n\n<p><a href=\"https:\/\/tecadmin.net\/wp-content\/uploads\/2016\/11\/subversion2.png\" target=\"_blank\" rel=\"noopener\"><\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article will help you for step by step setup of Subversion (svn) server on Ubuntu 18.04 LTS &amp; 16.04 LTS systems. Step 1 \u2013 Install Apache First of all,&#8230; <\/p>\n","protected":false},"author":1,"featured_media":3349,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[590,1122,545,593,399,230,1474,1479,1478,395,1475,1477,1476,213,1341],"class_list":["post-433","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorised","tag-apache2","tag-guide","tag-how","tag-process","tag-server","tag-setup","tag-setup-svn-server","tag-setup-svnserver-using-apache2-in-ubantu","tag-setup-the-svnserver","tag-svn","tag-svn-server-setup","tag-svn-server-setup-with-apache2","tag-svn-server-with-apache2","tag-tutorial","tag-ubantu"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/433","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=433"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/433\/revisions"}],"predecessor-version":[{"id":29464,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/433\/revisions\/29464"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/3349"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}