How to Install Subversion 1.6.16 on CentOS 5.5 Server

Share this Article :

Subversion is a open source version control system that will manages files and will keep the changes made to the files, over time. This will allows us to recover older versions of the data or examine the history of how the data changed. In this post, i will show you on how to install Subversion 1.6.16 on CentOS 5.5.

Prerequisite : How to Install Apache Httpd Web Server on Linux

1. Download Subversion 1.6.16

    [[email protected] data]# wget http://opensource.wandisco.com/centos/5/RPMS/i386/mod_dav_svn-1.6.16-1.i386.rpm
    --2011-03-29 20:20:22--  http://opensource.wandisco.com/centos/5/RPMS/i386/mod_dav_svn-1.6.16-1.i386.rpm
    Resolving opensource.wandisco.com... 212.7.198.163
    Connecting to opensource.wandisco.com|212.7.198.163|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 77152 (75K) [application/x-redhat-package-manager]
    Saving to: `mod_dav_svn-1.6.16-1.i386.rpm'
    
    100%[===========================================>] 77,152      47.1K/s   in 1.6s
    
    2011-03-29 20:20:25 (47.1 KB/s) - `mod_dav_svn-1.6.16-1.i386.rpm' saved [77152/77152]
    
    [[email protected] data]# wget http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-1.6.16-1.i386.rpm
    --2011-03-29 20:22:31--  http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-1.6.16-1.i386.rpm
    Resolving opensource.wandisco.com... 212.7.198.163
    Connecting to opensource.wandisco.com|212.7.198.163|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 2191952 (2.1M) [application/x-redhat-package-manager]
    Saving to: `subversion-1.6.16-1.i386.rpm'
    
    100%[===========================================>] 2,191,952   53.4K/s   in 51s
    
    2011-03-29 20:23:25 (41.9 KB/s) - `subversion-1.6.16-1.i386.rpm' saved [2191952/2191952]
    
    [[email protected] data]# wget http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-devel-1.6.16-1.i386.rpm
    --2011-03-29 20:26:47--  http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-devel-1.6.16-1.i386.rpm
    Resolving opensource.wandisco.com... 212.7.198.163
    Connecting to opensource.wandisco.com|212.7.198.163|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 3407709 (3.2M) [application/x-redhat-package-manager]
    Saving to: `subversion-devel-1.6.16-1.i386.rpm'
    
    100%[===========================================>] 3,407,709   53.6K/s   in 62s
    
    2011-03-29 20:27:51 (53.9 KB/s) - `subversion-devel-1.6.16-1.i386.rpm' saved [3407709/3407709]
    
    [[email protected] data]# wget http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-perl-1.6.16-1.i386.rpm
    --2011-03-29 20:28:05--  http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-perl-1.6.16-1.i386.rpm
    Resolving opensource.wandisco.com... 212.7.198.163
    Connecting to opensource.wandisco.com|212.7.198.163|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 1103833 (1.1M) [application/x-redhat-package-manager]
    Saving to: `subversion-perl-1.6.16-1.i386.rpm'
    
    100%[===========================================>] 1,103,833   66.8K/s   in 21s
    
    2011-03-29 20:28:28 (52.3 KB/s) - `subversion-perl-1.6.16-1.i386.rpm' saved [1103833/1103833]
    
    [[email protected] data]# wget http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-python-1.6.16-1.i386.rpm
    --2011-03-29 20:28:36--  http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-python-1.6.16-1.i386.rpm
    Resolving opensource.wandisco.com... 212.7.198.163
    Connecting to opensource.wandisco.com|212.7.198.163|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 1286789 (1.2M) [application/x-redhat-package-manager]
    Saving to: `subversion-python-1.6.16-1.i386.rpm'
    
    100%[===========================================>] 1,286,789   30.2K/s   in 42s
    
    2011-03-29 20:29:20 (30.1 KB/s) - `subversion-python-1.6.16-1.i386.rpm' saved [1286789/1286789]
    
    [[email protected] data]# wget http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-tools-1.6.16-1.i386.rpm
    --2011-03-29 20:30:09--  http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-tools-1.6.16-1.i386.rpm
    Resolving opensource.wandisco.com... 212.7.198.163
    Connecting to opensource.wandisco.com|212.7.198.163|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 390211 (381K) [application/x-redhat-package-manager]
    Saving to: `subversion-tools-1.6.16-1.i386.rpm'
    
    100%[===========================================>] 390,211     54.9K/s   in 7.2s
    
    2011-03-29 20:30:19 (53.1 KB/s) - `subversion-tools-1.6.16-1.i386.rpm' saved [390211/390211]
    
    [[email protected] data]# ls
    mod_dav_svn-1.6.16-1.i386.rpm       subversion-perl-1.6.16-1.i386.rpm
    subversion-1.6.16-1.i386.rpm        subversion-python-1.6.16-1.i386.rpm
    subversion-devel-1.6.16-1.i386.rpm  subversion-tools-1.6.16-1.i386.rpm

2. Install the RPM packages

    [[email protected] data]# rpm -Uvh --nosignature mod_dav_svn-1.6.16-1.i386.rpm subversion-1.6.16-1.i386.rpm subversion-devel-1.6.16-1.i386.rpm subversion-perl-1.6.16-1.i386.rpm subversion-python-1.6.16-1.i386.rpm subversion-tools-1.6.16-1.i386.rpm
    Preparing...                ########################################### [100%]
    1:subversion             ########################################### [ 17%]
    2:subversion-perl        ########################################### [ 33%]
    3:mod_dav_svn            ########################################### [ 50%]
    4:subversion-devel       ########################################### [ 67%]
    5:subversion-python      ########################################### [ 83%]
    6:subversion-tools       ########################################### [100%]
    [[email protected] data]#

3. Setting up directories

    mkdir /svn
    mkdir /svn/repos
    mkdir /svn/users
    mkdir /svn/permissions
    
    chown -R apache:apache /svn

4. Configure httpd Apache server as below:

    DocumentRoot /svn/repos
    ServerName svn.local
    ErrorLog logs/svn.local-error_log
    CustomLog logs/svn.local-access_log common

5. Create and Configure subversion.conf

[[email protected] ~]# vi /etc/httpd/conf.d/subversion.conf

     
    # Needed to do Subversion Apache server.
    LoadModule dav_svn_module     modules/mod_dav_svn.so
    
    # Only needed if you decide to do "per-directory" access control.
    LoadModule authz_svn_module   modules/mod_authz_svn.so
    
    #
    # Example location directive.
    #
    
    <Location /svn/repos>
            DAV svn
            SVNParentPath /svn/repos
            AuthType Basic
    	AuthName "Authorization Realm"
    	AuthUserFile /svn/users/passwords
            AuthzSVNAccessFile /svn/permissions/svnaccess
            Require valid-user
    </Location>
    
    

6. Create first repository using svnadmin command

    [[email protected] ~]# svnadmin create /svn/repos/testsvn
    [[email protected] ~]# chown -R apache:apache /svn/repos/testsvn

7. Create htpasswd user to access the testsvn repository

    [[email protected] ~]# htpasswd -c /svn/users/passwords user1
    New password:
    Re-type new password:
    Adding password for user user1
    
    [[email protected] ~]# htpasswd -m /svn/users/passwords user2
    New password:
    Re-type new password:
    Adding password for user user2

8. Create svnaccess file to access the testsvn repository

    [[email protected] ~]# vi /svn/permissions/svnaccess
    [groups]
    testgroup = user1, user2
    
    [testsvn:/]
    @testgroup = rw

9. Test your subversion server from browser http://192.168.2.5/svn/repos/testsvn/

    testsvn - Revision 0: /
    
    --------------------------------------------------------------------------------
    Powered by Subversion version 1.6.16 (r1073529).

Proceed to below URL if you want to view your repository using WebSVN or Viewvc.
How to Install WebSVN on CentOS
How to Install and Configure Viewvc on CentOS


3 Comments

  1. Wouter Goossens
  2. mhstar

Leave a Reply