Subversion is often abbreviated as SVN. It is an open-source version control system that is used to manage and track changes to code and assets across projects. Subversion is one of many version control options available today. Using Subversion allows you to access a complete history of the changes made to the files and folders of your server and also recover your older versions of files. In this article, you will learn How To Install Subversion On Ubuntu 20.04, 21.04 step by step. Order your desired package on Eldernode and purchase your own Ubuntu VPS Hosting.
Table of Contents
Tutorial Install Subversion On Ubuntu 20.04
As a developer, you may be eager to use Subversion since it operates across networks and provide the very latest changes to the software. At the time of writing this article, Apache Subversion 1.14.1 is released. Join us with this guide to review the process of installing Subversion On Ubuntu 20.04.
Prerequisites to Install Subversion on Ubuntu 20.04
To let this tutorial work better, please consider the below Prerequisites:
_ A non-root user with Sudo privileges. To setup, follow Initial server setup on Ubuntu 20.04.
_ A valid domain name pointed to your IP address.
_ A static IP address configured on your server.
Install and Configure Subversion (SVN) on Ubuntu 20.04
Subversion has been around for a while now but is still being used by many. It is easy to set up and administer SVN. Let’s go through the steps of this guide to learn How to install and configure Subversion.
Step 1:
SVN Server requires an Apache webserver to access the svn server using HTTP URLs. So, first of all, use the following commands to install the Apache webserver on your system:
sudo apt update
sudo apt -y install apache2 apache2-utils
And then, to install Apache SVN, run:
sudo apt -y install vim tree subversion libsvn-dev libapache2-mod-svn subversion-tools
Then, use the command to enable Apache modules required by SVN:
sudo a2enmod dav dav_svn
sudo systemctl restart apache2
To check configuration syntax, run:
sudo apachectl -t
And finally, restart the apache2 service by running the command below:
sudo systemctl restart apache2
Step 2:
In this step, you will create SVN user. The user authentication information is saved on /etc/apache2/dav_svn.passwd. Ao, to create your admin Subversion user, run:
sudo htpasswd -cm /etc/apache2/dav_svn.passwd admin
Then, provide your admin user password.
Used Options:
-c: Create a new file.
-m: Force MD5 encryption of the password (default).
Note: When adding other users, don’t use the -c option, just pass -m to modify the file:
sudo htpasswd -m /etc/apache2/dav_svn.passwd user1
sudo htpasswd -m /etc/apache2/dav_svn.passwd user2
sudo htpasswd -m /etc/apache2/dav_svn.passwd user1
Step 3:
After a successful installation, you need to create a new repository for it. You can put your repository inside /var/lib/svn/ directory. To create an SVN repository, run:
sudo mkdir -p /var/lib/svn/sudo mkdir -p /var/lib/svn/
Then, use the command below to create a repository:
sudo svnadmin create /var/lib/svn/<repo-name>
Next, set the owner of the directory /var/lib/svn to www-data user & group:
sudo chown -R www-data:www-data /var/lib/svn
sudo chmod -R 775 /var/lib/svn
How to Access SVN Web Interface on Ubuntu 20.04
To access your repository in the browser, use HTTP URLs. When it prompts you to authenticate, use login credentials created in Step 2:
http://server_ip_or_hostname/svn/<reponame>
Note: Remember to put your system hostname, domain name, or IP address in the above command.
Then, you can log in with created username and password.
Conclusion
In this article, you learned How To Install Subversion On Ubuntu 20.04. If you have successfully passed all the required steps, the latest version of Subversion should be installed on your Ubuntu system.