Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Linux Tutorials»How to Install and Configure SVN Server on Ubuntu & LinuxMint

    How to Install and Configure SVN Server on Ubuntu & LinuxMint

    RahulBy RahulJuly 30, 20152 Mins Read

    Subversion is an product of Apache Software Foundation. It is open-source revision control system, which is designed to be a replacement for CVS. This article will help you install and configure SVN Server on Ubuntu & LinuxMint operating system.

    1. Install Required Packages

    First install required packages for Subversion server on your system.

    $ sudo apt-get update
    $ sudo apt-get install subversion subversion-tools libapache2-svn
    

    2. Configure Apache Module

    Now enable Dav svn module in Apache2 server using following command.

    $ sudo a2enmod dav_svn
    

    Now create main svn directory on your svn server.

    $ sudo mkdir /var/svn
    

    Lets edit Apache dav_svn module configuration file and add following settings at end of file.

    $ sudo vim /etc/apache2/mods-available/dav_svn.conf
    
    <Location /svn>
      DAV svn
      SVNParentPath /var/svn
    </Location>
    

    After making above changes, restart Apache service.

    $ sudo service apache2 restart
    

    3. Create Your First Repository

    Create your first svn repository named firstrepo, You can use any suitable name.

    $ cd /var/svn
    $ sudo svnadmin create firstrepo
    

    Now create a directory and create skeleton directories for your first repository.

    $ mkdir ~/mainrepo
    $ cd ~/mainrepo
    $ mkdir trunk tags branches
    

    Import skeleton directory to your first repository.

    $ sudo svn import ~/mainrepo file:///var/svn/firstrepo -m 'Adding Initial Directories'
    
    Adding         /root/mainrepo/tags
    Adding         /root/mainrepo/trunk
    Adding         /root/mainrepo/branches
    
    Committed revision 1.
    

    4. Setup Apache for First Repository

    Now edit dav_svn apache module configuration file and add your first repository settings.

    $ sudo vim /etc/apache2/mods-available/dav_svn.conf
    
    <Location /svn/firstrepo >
      AuthType Basic
      AuthName "Authorized Access Only"
      AuthUserFile /etc/apache2/dav_svn.passwd
      Require valid-user admin
    </Location>
    

    Now add user in password file for authentication of svn repositories.

    $ sudo htpasswd /etc/apache2/dav_svn.passwd admin
    

    Let’s restart Apache service again.

    $ sudo service apache2 restart
    

    Subversion First Repo

    5. Checkout Repository

    At this point you have successfully created svn repository for your first project. Let’s checkout your project to your working directory.

    $ svn co http://127.0.0.1/svn/firstrepo ~/firstrepo 
    
    Authentication realm:  Authorized Access Only
    Password for 'root': [Just Press Enter]
    Authentication realm:  Authorized Access Only
    Username: admin
    Password for 'admin': *******
    
    Store password unencrypted (yes/no)? yes
    A    /root/firstrepo/tags
    A    /root/firstrepo/trunk
    A    /root/firstrepo/branches
    Checked out revision 1.
    
    subversion svn
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow To Install Python 3.8 on RHEL/CentOS 7 & Fedora 34/33
    Next Article How To Enable Logs in MySQL Server

    Related Posts

    What is the /etc/aliases file

    2 Mins Read

    What is the /etc/nsswitch.conf file in Linux

    2 Mins Read

    How to Setup Squid Proxy Server on Ubuntu and Debian

    Updated:June 17, 20225 Mins Read

    How to Delete a Let’s Encrypt Certificate using Certbot

    Updated:June 3, 20222 Mins Read

    How to Install Latest Git on Ubuntu 22.04

    Updated:May 31, 20222 Mins Read

    How To Install LibreOffice on Ubuntu 22.04

    Updated:May 23, 20222 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • Filesystem Hierarchy Structure (FHS) in Linux
    • How to accept user input in Python
    • What is difference between var, let and const in JavaScript?
    • What is CPU? – Definition, Types and Parts
    • What is the /etc/aliases file
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.