Efficient Steps To SVN Server Setup on Debian 12

This guide will teach you SVN Server Setup on Debian 12 Bookworm. Apache Subversion or SVN is a version control system that tracks changes in files and directories. Software development teams commonly use it to manage and maintain the different versions of their codebase. Also, it allows multiple developers to collaborate on projects efficiently.

In this guide, you will learn to Install and Configure SVN Server on Debian 12.

Step-by-Step Guide For SVN Server Setup on Debian 12

Before you start SVN Server Setup on Debian 12, you must access your server as a non-root user with sudo privileges. For this purpose, you can check the Initial Server Setup with Debian 12.

Step 1 – SVN Server Setup on Debian 12

The SVN packages are available in the default Debian 12 repository. First, run the system update with the command below:

sudo apt update

Then, you need to install Apache to access the SVN server using HTTP URLs. To do this, use the following command:

sudo apt install apache2 -y

Now you can install SVN and also install the Apache module to make SVN work with Apache. To do this, run the following command:

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

After your installation is finished, enable the Apache modules and restart the Apache with the following commands:

$ sudo a2enmod dav
$ sudo a2enmod dav_svn
$ sudo systemctl restart apache2

Step 2 – Apache Subversion Configuration on Debian 12

At this point, you need to configure Apache with Subversion on Debian 12. To do this, you need to open the dav_svn.conf file with your desired text editor like Vi editor or Nano editor:

sudo vi /etc/apache2/mods-enabled/dav_svn.conf

At the file, look for the following lines and uncomment them by removing the # at the beginning of the lines.

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

Your file should look like this:

SVN Server Setup on Debian 12

When you are done, save and close the file.

To apply the changes restart Apache with the following command:

sudo systemctl restart apache2

Step 3 – Configure SVN Server Repository on Debian 12

At this point, you need to create an SVN repository on Debian 12. Here we named it myrepo. To do this, you can use the following commands:

$ sudo mkdir -p /var/lib/svn/
$ sudo svnadmin create /var/lib/svn/myrepo

Also, you need to set the correct permissions for the new directories that you have created:

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

Then, you need to create an SVN user in /etc/apache2/dav_svn.passwd file. These users will use it for the authentication of SVN repositories on Debian 12.

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

This will create a user named admin and you will be asked to give it a password.

Output
New password:
Re-type new password:
Adding password for user admin

To create additional users you can use the following commands:

$ sudo htpasswd -m /etc/apache2/dav_svn.passwd user1
$ sudo htpasswd -m /etc/apache2/dav_svn.passwd user2

Step 4 – Access the SVN Server Repository

Now you can access the SVN repository on Debian 12 by typing your server’s IP address in your web browser followed by /svn/myrepo/:

http://server-IP-address/svn/myrepo/

You should enter your credentials and click sign in.

Access SVN Repository

Now you will see your SVN repository from your web interface.

SVN server repo Debian 12

Here are some of the key functionalities that Apache Subversion can perform:

  • Version Control
  • Collaboration
  • Branching and Merging
  • Access Control
  • History and Tracking
  • Conflict Resolution
  • Offline Support
  • Integration with Development Tools

For more information, you can visit the official subversion docs.

Conclusion

Apache Subversion is a powerful version control system that provides essential features for managing and tracking changes to codebases. At this point, you have learned the SVN Server Setup on Debian 12.

Hope you enjoy it. Also, you may like to read the following articles:

TYPO3 CMS Installation Setup on Debian 12

Install and Access the Wekan Server on Debian 12

Install PowerShell on Debian 12 Terminal

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!