UbuntuUbuntu Based

How To Install Apache Subversion on Ubuntu 22.04 LTS

Install Apache Subversion on Ubuntu 22.04

In this tutorial, we will show you how to install Apache Subversion on Ubuntu 22.04 LTS. For those of you who didn’t know, Apache Subversion (SVN) is an open-source version control system that is used to manage and track changes to files, such as source code, documents, and images. It allows multiple users to work on the same files concurrently, and it provides a central repository where all changes are stored and tracked.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Apache Subversion on Ubuntu 22.04 (Jammy Jellyfish). You can follow the same instructions for Ubuntu 22.04 and any other Debian-based distribution like Linux Mint, Elementary OS, Pop!_OS, and more as well.

Prerequisites

  • A server running one of the following operating systems: Ubuntu 22.04, 20.04, and any other Debian-based distribution like Linux Mint.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies for Subversion.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Apache Subversion on Ubuntu 22.04 LTS Jammy Jellyfish

Step 1. First, make sure that all your system packages are up-to-date by running the following apt commands in the terminal.

sudo apt update
sudo apt upgrade

Step 2. Installing Apache.

Subversion is dependent on Apache so first, we need to install Apache on the server. Now run the following command below to install the Apache web server:

sudo apt install apache2

By default, after the Apache installation successfully completed, the service should be up and running. To be certain, we need to start it again:

sudo systemctl enable apache2
sudo systemctl start apache2

For additional resources on installing Apache, read the post below:

Step 3. Installing Apache Subversion on Ubuntu 22.04.

By default, Subversion is available on Ubuntu 22.04 base repository. Now run the following command below to install the latest version of the Subversion cache to your Ubuntu system:

sudo apt install subversion subversion-tools libapache2-mod-svn

After that, enable the Apache modules and restart the Apache with the following commands:

sudo a2enmod dav
sudo a2enmod dav_svn
sudo systemctl restart apache2

Step 4. Configure SVN (Subversion) on Ubuntu 22.04.

Now we open the following configuration file with your favorite text editor:

nano /etc/apache2/mods-enabled/dav_svn.conf

Uncomment the lines below:

<Location /svn>
 DAV svn
 SVNParentPath /var/lib/svn
 AuthType Basic
 AuthName "Subversion Repository"
 AuthUserFile /etc/apache2/dav_svn.passwd
 Require valid-user
</Location>

Save and close the file, then restart Apache to apply the changes:

sudo systemctl restart apache2

Next, create an SVN repository on Ubuntu 22.04. Here we named it idroot-repo. To do this, you can use the following commands:

sudo mkdir -p /var/lib/svn/
sudo svnadmin create /var/lib/svn/idroot-repo

Change the ownership for the SVN repository:

sudo chown -R www-data:www-data /var/lib/svn
sudo chmod -R 775 /var/lib/svn

After that, create an SVN user in /etc/apache2/dav_svn.passwd file. These users will use it for the authentication of svn repositories:

sudo htpasswd -cm /etc/apache2/dav_svn.passwd admin

To create additional users you can use the following command below:

sudo htpasswd -m /etc/apache2/dav_svn.passwd idroot_user

Step 5. Accessing Apache Subversion.

Once successfully set up Subversion, now open a web browser and navigate to http://your-IP-address/svn/idroot-repo/.

Congratulations! You have successfully installed Subversion. Thanks for using this tutorial for installing Apache Subversion on Ubuntu 22.04 LTS Jammy Jellyfish system. For additional help or useful information, we recommend you check the official Apache website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!
Back to top button