{"id":1310,"date":"2014-10-26T22:33:58","date_gmt":"2014-10-27T04:33:58","guid":{"rendered":"http:\/\/blog.supportpro.com\/?p=1310"},"modified":"2019-10-30T04:21:17","modified_gmt":"2019-10-30T10:21:17","slug":"how-to-install-and-setup-svn-on-cpanel-server","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/how-to-install-and-setup-svn-on-cpanel-server\/","title":{"rendered":"How to install and setup SVN on cPanel server"},"content":{"rendered":"<p><span style=\"line-height: 1.5em;\">\u00a0 \u00a0 <strong>Subversion<\/strong> (SVN) is an open source version control system. It helps you keep track of a collection of files and folders. Any time you change, add or delete a file or folder that you manage with Subversion, you commit these changes to your Subversion repository, which creates a new revision in your repository reflecting these changes. You can always go back, look at and get the contents of previous revisions.<\/span><\/p>\n<p>This article will help you for step by step setup SVN server on a cPanel\/WHM server.<\/p>\n<p><strong>Prerequisite<\/strong><\/p>\n<p>1. sqlite3 php module<br \/>\n2. Apache mod_dav module.<\/p>\n<p><strong>Installing php sqlite3 module<\/strong><\/p>\n<p>Run the following command in the server terminal<\/p>\n<p><em>#php -m | grep sqlite<\/em><\/p>\n<p>If the module is installed already, it will return<\/p>\n<p><em>sqlite3<\/em><\/p>\n<p>If the module is not enabled, run easyapache to enable the module<!--more--><\/p>\n<p><strong>Installing mod_dav (if needed)<\/strong><\/p>\n<p>Run the following command in the terminal:<\/p>\n<p><em>#httpd -M | grep dav<\/em><\/p>\n<p>If mod_dav is already installed, it will return:<\/p>\n<p><em>dav_module (static)<\/em><br \/>\n<em>dav_fs_module (static)<\/em><\/p>\n<p>If this module is already enabled, run EasyApache and enable this module.<\/p>\n<p>Note: If both sqlite3 and mod_dav is not enabled, you can install them in a single EasyApache.<br \/>\n<strong>Install Subversion<\/strong><\/p>\n<p>In order to properly configure latest version of Subversion it needs to be compiled from its sources. Download and install subversion using the following commands.<br \/>\nAlways check the https:\/\/subversion.apache.org\/download\/ for the latest version<\/p>\n<p><em>#cd \/usr\/local\/src\/<\/em><br \/>\n<em>#wget http:\/\/mirror.cc.columbia.edu\/pub\/software\/apache\/subversion\/subversion-1.8.10.tar.gz tar xzvf subversion-1.8.10.tar.gz \/\/unzip the file<\/em><br \/>\n<em>#cd subversion-1.8.10\/<\/em><br \/>\n<em>#.\/configure &#8211;with-apxs=\/usr\/local\/apache\/bin\/apxs &#8211;with-apr=\/usr\/local\/apache\/bin\/apr-1-config &#8211;with-apr-util=\/home\/cpeasyapache\/src\/httpd-2.2\/srclib\/apr-util\/<\/em><br \/>\nLatest version of sqlite3 is needed. If the configure fails with following error:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nAn appropriate version of sqlite could not be found. We recommend\u00a03.7.15.1, but require at least 3.7.12.<br \/>\nPlease either install a newer sqlite on this system<\/p>\n<p>or<\/p>\n<p>get the sqlite 3.7.15.1 amalgamation from:<br \/>\nhttp:\/\/www.sqlite.org\/sqlite-amalgamation-3071501.zip<br \/>\nunpack the archive using unzip and rename the resulting<br \/>\ndirectory to:<br \/>\n\/usr\/local\/src\/subversion-1.8.10\/sqlite-amalgamation<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>Then run following commands to enable latest sqlite3<\/p>\n<p><em>#wget http:\/\/www.sqlite.org\/sqlite-amalgamation-3071501.zip<\/em><br \/>\n<em>#unzip sqlite-amalgamation-3071501.zip<\/em><br \/>\n<em>#mv sqlite-amalgamation-3071501 sqlite-amalgamation<\/em><\/p>\n<p>And run the configure again. It should work.<\/p>\n<p>If the configure fails with following error<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nchecking for APR&#8230; configure: error: the &#8211;with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file.<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>You need to correct the &#8220;&#8211;with-apr-util=&#8221; path specified. Look for httpd-*.*.** (where the stars are your script version) and update accordingly and run the configure, make and make install commands.<\/p>\n<p><strong>Subversion and Apache<\/strong><\/p>\n<p>When using WHM and EasyApache, you can\u2019t just modify the Apache configuration to include the Subversion modules. Instead, you must use the Include Editor, which you can find by browsing to \u201cApache Configuration\u201d in the WHM menu. There, you must use the Pre Main Include. Select the latest Apache version from the dropdown list and a textarea will appear. Add the following to it and click on \u201cUpdate\u201d:<\/p>\n<p><em>LoadModule dav_svn_module \/usr\/local\/libexec\/mod_dav_svn.so<\/em><br \/>\n<em>LoadModule authz_svn_module \/usr\/local\/libexec\/mod_authz_svn.so<\/em><\/p>\n<p><strong>Set up your repository<\/strong><\/p>\n<p>use one repository per domain \/ subdomain. These instruction will work for multiple repositories.<\/p>\n<p>For our explaining, consider the domain name is <strong>supportpro.com<\/strong> and <strong>support<\/strong> is the cPanel username.<\/p>\n<p>First, you need to add a new virtual host for your repository:<\/p>\n<p><strong>#mkdir -p \/etc\/httpd\/conf\/userdata\/std\/2\/support\/supportpro.com<\/strong><\/p>\n<p>Next, you need to create the Subversion config file<br \/>\n<strong>#vi \/etc\/httpd\/conf\/userdata\/std\/2\/support\/supportpro.com\/svn.conf<\/strong><\/p>\n<p>And copy following to the svn.conf file. For every repository you wish to create, add another &lt;location&gt; block.<\/p>\n<p><em>&lt;IfModule mod_dav_svn.c&gt;<\/em><br \/>\n<em> &lt;Location \/svn&gt;<\/em><br \/>\n<em> DAV svn<\/em><br \/>\n<em> SVNPath \/home\/support\/public_html\/svn<\/em><br \/>\n<em> AuthType Basic<\/em><br \/>\n<em> AuthName &#8220;SupportPro SVN&#8221;<\/em><br \/>\n<em> AuthUserFile \/home\/support\/public_html\/passwd<\/em><br \/>\n<em> Require valid-user<\/em><br \/>\n<em> &lt;\/Location&gt;<\/em><br \/>\n<em> &lt;\/IfModule&gt;<\/em><\/p>\n<p>Tell cPanel to update the Apache configuration to use the custom vhost includes:<br \/>\n<em>#\/scripts\/ensure_vhost_includes &#8211;all-users<\/em><br \/>\n<em>#service httpd restart<\/em><\/p>\n<p>Now, create the actual repository files:<\/p>\n<p><em>#su svnaccount &#8211;<\/em><br \/>\n<em>#cd public_html<\/em><br \/>\n<em>#svnadmin create svn<\/em><br \/>\n<em>#chmod 775 -R svn<\/em><\/p>\n<p><strong>\u00a0Add Subversion users<\/strong><\/p>\n<p><em>#\/usr\/local\/apache\/bin\/htpasswd \/home\/support\/public_html\/passwd username<\/em><\/p>\n<p>\/\/enter password when asked.<\/p>\n<p><strong>Test<\/strong><\/p>\n<p>Go to http:\/\/supportpro.com\/svn to test your repository. It should ask for your user and password.<\/p>\n<p>If you require help, <a href=\"https:\/\/www.supportpro.com\/requestquote.php\">contact SupportPRO Server Admin <\/a><\/p>\n<p style=\"text-align: center;\"><!--HubSpot Call-to-Action Code --><span id=\"hs-cta-wrapper-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-node hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\"><!-- [if lte IE 8]><\/p>\n\n\n\n\n\n<div id=\"hs-cta-ie-element\"><\/div>\n\n\n<![endif]--><a href=\"https:\/\/www.supportpro.com\/freecheckup.php\"><img decoding=\"async\" id=\"hs-cta-img-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-img\" style=\"border-width: 0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b.png\" alt=\"Server not running properly? Get A FREE Server Checkup By Expert Server Admins - $125 Value\" \/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '9d590242-d641-4383-94b4-8cfd62f0af6b', {}); <\/script><\/span><!-- end HubSpot Call-to-Action Code --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 Subversion (SVN) is an open source version control system. It helps you keep track of a collection of files and folders. Any time you change, add or delete&hellip;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[5,1,7,3],"tags":[],"class_list":["post-1310","post","type-post","status-publish","format-standard","hentry","category-general-topics","category-miscellaneous","category-server-tweaking","category-technical-articles"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1310","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=1310"}],"version-history":[{"count":5,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1310\/revisions"}],"predecessor-version":[{"id":4426,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1310\/revisions\/4426"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=1310"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=1310"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=1310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}