How To Install Apache SVN Server On Ubuntu 20.04

We can install the apache SVN server in ubuntu 20.04. Let’s see, how to install SVN on ubuntu.

Apache SVN is a software versioning and revision control system distributed as open-source under Apache license. you can maintain the version of your file here including old and current with a timestamp.

You can use the TortoiseSVN software to use the SVN on your desktop machine GUI. 

How To Install Apache SVN Server On Ubuntu 20.04

First of all, you need to update and install an apache web server on ubuntu using the following commands. 

sudo apt update
sudo apt install apache2

Check Out: How To Reset MySQL 8 Root Password On Ubuntu 20.04

Install Subversion: 

When you have installed the Apache then start the service and install the subversion and it’s required SVN packages. 

sudo systemctl start apache2
sudo systemctl enable apache2
sudo apt install subversion libapache2-mod-svn libapache2-svn libsvn-dev

Once the package is installed. we need to enable the Apache modules and reload the service. 

sudo a2enmod dav dav_svn authz_svn
sudo systemctl reload apache2

Check Out: How To Install Windows Server 2016 On Vmware Workstation

Create an SVN Directory:

Create an SVN directory where your files or folder will be kept. 

sudo mkdir -p /opt/svn

Now, Create an SVN repository and also change the ownership using the below command. I have created “SVNDATA“. 

sudo svnadmin create /opt/svn/SVNDATA
sudo chown -R www-data:www-data /opt/svn/SVNDATA

Now create a subversion user using the following command. 

ubuntu@ubuntu:~$ sudo htpasswd -cm /etc/svn-user curious
New password: 
Re-type new password: 
Adding password for user curious

Check Out: How To Install Firejail and Run Unsecure Application On Linux

Configure Apache For Subversion:

We will need to create an apache virtual host to access subversion through a web browser. 

sudo vim /etc/apache2/sites-available/svn.conf

Add the below code. 

<VirtualHost *:80>
     ServerName svn.exam.com
    <Location /svn>
    DAV svn
    SVNParentPath /opt/svn
    AuthType Basic 
    AuthName "Subversion Repository"
    AuthUserFile /etc/svn-user
    Require valid-user
</Location>
     ErrorLog ${APACHE_LOG_DIR}/svn-error.log
     CustomLog ${APACHE_LOG_DIR}/svn-access.log combined
</VirtualHost>

Save and close the file then restart the apache service. 

sudo systemctl restart apache2

We need to disable the default virtual host on apache. 

cd /etc/apache2/sites-available/
sudo a2dissite 000-default.conf
sudo systemctl restart apache2

Enable the SVN virtual host using the following command. 

sudo a2ensite svn.conf
sudo systemctl restart apache2

Check Out: How To Install Apache Cassandra 3.11 Database On CentOS 7/8

Test The Configuration:

Once you have completed the above task. we need to check whether it’s working or not. Now hit the URL: http://svn.exam.com/svn/SVNDATA/

Enter the SVN username and password.

install apache svn ubuntu

That’s it.

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

1 thought on “How To Install Apache SVN Server On Ubuntu 20.04”

Leave a comment