{"id":4846,"date":"2014-03-12T00:03:55","date_gmt":"2014-03-11T16:03:55","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=4846"},"modified":"2023-06-22T20:56:02","modified_gmt":"2023-06-22T20:56:02","slug":"how-to-install-and-configure-subversion-1-8-on-centos-6-5","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-install-and-configure-subversion-1-8-on-centos-6-5\/","title":{"rendered":"How to Install and Configure Subversion 1.8 on CentOS 6.5"},"content":{"rendered":"<p>Subversion, also known as SVN, is an open-source version control system that manages files and tracks changes made to them. It allows you to recover older files and directories and examine the history of your files and directories to see how they have changed over time.<\/p>\n<p>This tutorial will guide you through the process of installing and configuring Subversion 1.8 on CentOS 6.5.<\/p>\n<h2>Step 1: Preparing the WANdisco Repository<\/h2>\n<p>The first step in the installation process is to prepare the WANdisco repository. This can be done by executing the following commands:<\/p>\n<pre>\r\nwget opensource.wandisco.com\/RPM-GPG-KEY-WANdisco -O \/tmp\/RPM-GPG-KEY-WANdisco\r\n<\/pre>\n<p>This command downloads the WANdisco repository&#8217;s GPG key and saves it to a temporary directory.<\/p>\n<pre>\r\nwget opensource.wandisco.com\/RPM-GPG-KEY-WANdisco -O \/tmp\/RPM-GPG-KEY-WANdisco\r\n--2014-03-11 23:29:59--  http:\/\/opensource.wandisco.com\/RPM-GPG-KEY-WANdisco\r\nResolving opensource.wandisco.com... 54.248.108.17\r\nConnecting to opensource.wandisco.com|54.248.108.17|:80... connected.\r\nHTTP request sent, awaiting response... 200 OK\r\nLength: 1759 (1.7K) [application\/octet-stream]\r\nSaving to: \u00e2\/tmp\/RPM-GPG-KEY-WANdisco\u00e2\r\n\r\n100%[==========================================================&gt;] 1,759       --.-K\/s   in 0.003s\r\n\r\n2014-03-11 23:30:00 (665 KB\/s) - \u00e2\/tmp\/RPM-GPG-KEY-WANdisco\u00e2\r\n<\/pre>\n<h2>Step 2: Importing the RPM-GPG-KEY-WANdisco<\/h2>\n<p>Once the key is downloaded, it needs to be imported. This can be done with the following commands:<\/p>\n<pre>\r\nrpm --import \/tmp\/RPM-GPG-KEY-WANdisco\r\nrm -rf \/tmp\/RPM-GPG-KEY-WANdisco\r\n<\/pre>\n<p>The first command imports the key, and the second command deletes the key from the temporary directory as it&#8217;s no longer needed.<\/p>\n<h2>Step 3: Configuring the WANdisco Repository File<\/h2>\n<p>The next step is to configure the WANdisco repository file. This can be done by editing the file at \/etc\/yum.repos.d\/WANdisco-1.8.repo and adding the following content:<\/p>\n<pre>\r\n[WANdisco]\r\nname=WANdisco SVN Repo 1.8\r\nenabled=1\r\nbaseurl=http:\/\/opensource.wandisco.com\/rhel\/6\/svn-1.8\/RPMS\/\r\ngpgcheck=1\r\n<\/pre>\n<p>This configuration enables the WANdisco SVN Repo 1.8 and sets the base URL for the repository.<\/p>\n<h2>Step 4: Installing Subversion Using Yum Install<\/h2>\n<p>With the repository configured, you can now install Subversion and the mod_dav_svn module using the yum install command:<\/p>\n<pre>\r\nyum install subversion mod_dav_svn -y\r\n<\/pre>\n<p>This command installs Subversion and the mod_dav_svn module, which is required for Subversion to work with the Apache HTTP server.<\/p>\n<pre>\r\nyum install subversion mod_dav_svn -y\r\nLoaded plugins: fastestmirror\r\nDetermining fastest mirrors\r\nepel\/metalink                                                                | 5.2 kB     00:00\r\n * Webmin: download.webmin.com\r\n * base: centos.ipserverone.com\r\n * epel: epel.mirror.net.in\r\n * extras: centos.ipserverone.com\r\n * updates: centos.ipserverone.com\r\nWANdisco                                                                     |  951 B     00:00\r\nWANdisco\/primary                                                             |  65 kB     00:00\r\nWANdisco                                                                                    309\/309\r\nWebmin                                                                       |  951 B     00:00\r\nWebmin\/primary                                                               |  21 kB     00:00\r\nWebmin                                                                                      168\/168\r\nbase                                                                         | 3.7 kB     00:00\r\nbase\/primary_db                                                              | 4.4 MB     00:45\r\nepel                                                                         | 4.2 kB     00:00\r\nepel\/primary_db                                                              | 6.0 MB     01:51\r\nextras                                                                       | 3.4 kB     00:00\r\nextras\/primary_db                                                            |  19 kB     00:00\r\nupdates                                                                      | 3.4 kB     00:00\r\nupdates\/primary_db                                                           | 2.1 MB     00:18\r\nSetting up Install Process\r\nResolving Dependencies\r\n--&gt; Running transaction check\r\n---&gt; Package mod_dav_svn.x86_64 0:1.8.8-1 will be installed\r\n---&gt; Package subversion.x86_64 0:1.8.8-1 will be installed\r\n--&gt; Processing Dependency: libserf-1.so.1()(64bit) for package: subversion-1.8.8-1.x86_64\r\n--&gt; Running transaction check\r\n---&gt; Package serf.x86_64 0:1.3.2-2 will be installed\r\n--&gt; Finished Dependency Resolution\r\n\r\nDependencies Resolved\r\n\r\n====================================================================================================\r\n Package                   Arch                 Version                Repository              Size\r\n====================================================================================================\r\nInstalling:\r\n mod_dav_svn               x86_64               1.8.8-1                WANdisco                77 k\r\n subversion                x86_64               1.8.8-1                WANdisco               2.2 M\r\nInstalling for dependencies:\r\n serf                      x86_64               1.3.2-2                WANdisco                43 k\r\n\r\nTransaction Summary\r\n====================================================================================================\r\nInstall       3 Package(s)\r\n\r\nTotal download size: 2.3 M\r\nInstalled size: 7.8 M\r\nDownloading Packages:\r\n(1\/3): mod_dav_svn-1.8.8-1.x86_64.rpm                                        |  77 kB     00:00\r\n(2\/3): serf-1.3.2-2.x86_64.rpm                                               |  43 kB     00:00\r\n(3\/3): subversion-1.8.8-1.x86_64.rpm                                         | 2.2 MB     00:19\r\n----------------------------------------------------------------------------------------------------\r\nTotal                                                               112 kB\/s | 2.3 MB     00:20\r\nRunning rpm_check_debug\r\nRunning Transaction Test\r\nTransaction Test Succeeded\r\nRunning Transaction\r\n  Installing : serf-1.3.2-2.x86_64                                                              1\/3\r\n  Installing : subversion-1.8.8-1.x86_64                                                        2\/3\r\n  Installing : mod_dav_svn-1.8.8-1.x86_64                                                       3\/3\r\nStopping httpd: [  OK  ]\r\nStarting httpd: [  OK  ]\r\n  Verifying  : mod_dav_svn-1.8.8-1.x86_64                                                       1\/3\r\n  Verifying  : subversion-1.8.8-1.x86_64                                                        2\/3\r\n  Verifying  : serf-1.3.2-2.x86_64                                                              3\/3\r\n\r\nInstalled:\r\n  mod_dav_svn.x86_64 0:1.8.8-1                      subversion.x86_64 0:1.8.8-1\r\n\r\nDependency Installed:\r\n  serf.x86_64 0:1.3.2-2\r\n\r\nComplete!\r\n<\/pre>\n<h2>Step 5: Setting Up SVN Directories<\/h2>\n<p>After installing Subversion, you need to set up the SVN directories. This can be done with the following commands:<\/p>\n<pre>\r\nmkdir \/svn\r\nmkdir \/svn\/repos\r\nmkdir \/svn\/users\r\nmkdir \/svn\/permissions\r\nchown -R apache:apache \/svn\r\n<\/pre>\n<p>These commands create the necessary directories and set the ownership of the \/svn directory to the Apache user.<\/p>\n<h2>Step 6: Configuring the Apache HTTP Server<\/h2>\n<p>Next, you need to configure the Apache HTTP server to work with Subversion. This can be done by editing the \/etc\/httpd\/conf\/httpd.conf file and adding the following content:<\/p>\n<pre>\r\n&lt;VirtualHost *:80&gt;\r\n ServerAdmin webmaster@svn.webhostinggeeks.local\r\n DocumentRoot \/svn\/repos\r\n ServerName svn.webhostinggeeks.local\r\n ErrorLog logs\/svn.webhostinggeeks.local-error_log\r\n CustomLog logs\/svn.webhostinggeeks.local-access_log common\r\n&lt;\/VirtualHost&gt;\r\n<\/pre>\n<p>This configuration sets up a virtual host for the Subversion repositories.<\/p>\n<h2>Step 7: Backing Up the Original Subversion File<\/h2>\n<p>Before making changes to the Subversion configuration, it&#8217;s a good idea to back up the original file. This can be done with the following command:<\/p>\n<pre>\r\nmv \/etc\/httpd\/conf.d\/subversion.conf \/etc\/httpd\/conf.d\/subversion.conf.bak\r\n<\/pre>\n<p>This command renames the original subversion.conf file to subversion.conf.bak.<\/p>\n<h2>Step 8: Creating and Configuring the subversion.conf File<\/h2>\n<p>Now you can create a new subversion.conf file and configure it for your setup. This can be done by creating the file at \/etc\/httpd\/conf.d\/subversion.conf and adding the following content:<\/p>\n<pre>\r\nLoadModule dav_svn_module modules\/mod_dav_svn.so\r\nLoadModule authz_svn_module modules\/mod_authz_svn.so\r\n&lt;Location \/svn\/repos&gt;\r\n DAV svn\r\n SVNParentPath \/svn\/repos\r\n AuthType Basic\r\n AuthName \"Authorization Realm\"\r\n AuthUserFile \/svn\/users\/passwords\r\n AuthzSVNAccessFile \/svn\/permissions\/svnaccess\r\n Require valid-user\r\n&lt;\/Location&gt;\r\n<\/pre>\n<p>This configuration loads the necessary modules for Subversion and sets up basic authentication for the repositories.<\/p>\n<h2>Step 9: Creating the First Repository<\/h2>\n<p>With the server configured, you can now create your first repository. This can be done with the following commands:<\/p>\n<pre>\r\nsvnadmin create \/svn\/repos\/testrepo\r\nchown -R apache:apache \/svn\/repos\/testrepo\r\n<\/pre>\n<p>These commands create a new repository named testrepo and set the ownership to the Apache user.<\/p>\n<h2>Step 10: Creating a User to Access the Repository<\/h2>\n<p>Next, you need to create a user that can access the repository. This can be done with the following command:<\/p>\n<pre>\r\nhtpasswd -c \/svn\/users\/passwords svnuser1\r\n<\/pre>\n<p>This command creates a new user named svnuser1 and prompts you to enter a password for the user.<\/p>\n<h2>Step 11: Creating the svnaccess File<\/h2>\n<p>To control access to the repository, you need to create an svnaccess file. This can be done by creating the file at \/svn\/permissions\/svnaccess and adding the following content:<\/p>\n<pre>\r\n[testrepo:\/]\r\nsvnuser1 = rw\r\n<\/pre>\n<p>This configuration grants read and write access to the svnuser1 user for the testrepo repository.<\/p>\n<h2>Step 12: Restarting the Apache HTTP Server<\/h2>\n<p>Finally, you need to restart the Apache HTTP server for the changes to take effect. This can be done with the following command:<\/p>\n<pre>\r\nservice httpd restart\r\n<\/pre>\n<h2>Step 13: Testing the Subversion Server<\/h2>\n<p>With everything set up, you can now test your Subversion server by accessing the testrepo repository from a web browser at the following URL:<\/p>\n<pre>\r\nhttp:\/\/svn.webhostinggeeks.local\/svn\/repos\/testrepo\/\r\n<\/pre>\n<p>If everything is set up correctly, you should be prompted to enter the username and password for the svnuser1 user, and then be able to access the testrepo repository.<\/p>\n<h2>Commands Mentioned<\/h2>\n<ul>\n<li><span class=\"fw-bold\">wget<\/span> \u2013 Used to download files from the internet.<\/li>\n<li><span class=\"fw-bold\">rpm &#8211;import<\/span> \u2013 Used to import a GPG key.<\/li>\n<li><span class=\"fw-bold\">vi<\/span> \u2013 A text editor used to edit configuration files.<\/li>\n<li><span class=\"fw-bold\">yum install<\/span> \u2013 Used to install packages.<\/li>\n<li><span class=\"fw-bold\">mkdir<\/span> \u2013 Used to create directories.<\/li>\n<li><span class=\"fw-bold\">chown<\/span> \u2013 Used to change the ownership of files or directories.<\/li>\n<li><span class=\"fw-bold\">mv<\/span> \u2013 Used to move or rename files.<\/li>\n<li><span class=\"fw-bold\">svnadmin create<\/span> \u2013 Used to create a new Subversion repository.<\/li>\n<li><span class=\"fw-bold\">htpasswd -c<\/span> \u2013 Used to create a new user for the Subversion repository.<\/li>\n<li><span class=\"fw-bold\">service httpd restart<\/span> \u2013 Used to restart the Apache HTTP server.<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>In this tutorial, we&#8217;ve walked through the process of installing and configuring Subversion 1.8 on CentOS 6.5. We&#8217;ve covered everything from preparing the WANdisco repository and importing the RPM-GPG-KEY-WANdisco, to configuring the Apache HTTP server and creating your first Subversion repository.<\/p>\n<p>By following these steps, you should now have a fully functional Subversion server that you can use to manage your files and track changes. Remember, if you&#8217;re new to version control systems like Subversion, it&#8217;s worth taking the time to understand how they work and how they can benefit your web development projects. For more information on this and other related topics, be sure to check out our articles on <a href=\"https:\/\/webhostinggeeks.com\/blog\/apache-http-server-explained\/\">Apache<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/nginx-server-explained\/\">Nginx<\/a>, and <a href=\"https:\/\/webhostinggeeks.com\/blog\/litespeed-web-server-explained\/\">LiteSpeed<\/a> web servers, as well as our guides on <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-dedicated-server-hosting\/\">dedicated server<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-vps-hosting\/\">VPS server<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-cloud-hosting\/\">cloud hosting<\/a>, and <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-shared-hosting\/\">shared hosting<\/a>.<\/p>\n<h2>FAQs<\/h2>\n<ol itemscope itemtype=\"https:\/\/schema.org\/FAQPage\">\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is Subversion?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">Subversion, also known as SVN, is an open-source version control system. It manages files and tracks changes made to them, allowing you to recover older files and directories and examine the history of your files and directories to see how they have changed over time.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is the purpose of the WANdisco repository in this tutorial?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">The WANdisco repository is used to download and install Subversion and the mod_dav_svn module, which is required for Subversion to work with the Apache HTTP server.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is the role of the Apache HTTP server in this setup?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">The Apache HTTP server is used to serve the Subversion repositories over HTTP. This allows you to access your repositories from a web browser.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is the purpose of the svnaccess file?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">The svnaccess file is used to control access to the Subversion repositories. It specifies which users have read and write access to each repository.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">How do I test my Subversion server?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">You can test your Subversion server by accessing one of your repositories from a web browser. If everything is set up correctly, you should be prompted to enter your username and password, and then be able to access the repository.<\/span>\n            <\/p>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Subversion, also known as SVN, is an open-source version control system that manages files and tracks changes made to them. It allows you to recover older files and directories and&#8230;<\/p>\n","protected":false},"author":6,"featured_media":5600,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[2055,1060],"tags":[1244,1536,1546,1811],"class_list":["post-4846","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-subversion","tag-centos","tag-linux","tag-linux-utilities","tag-subversion"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/4846","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=4846"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/4846\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/5600"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=4846"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=4846"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=4846"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}