
Introduction
Apache Subversion (SVN) is an open-source software version control system released under the Apache License. Software developers use SVN to manage and track changes to code and assets across projects. It supports several protocols for network access such as SVN, SVN+SSH, HTTP, and HTTPS. In this article, you will learn how to install Subversion on Ubuntu 20.04.
Prerequisites
- Deploy a fully updated Vultr Ubuntu 20.04 server.
- Create a non-root user with sudo access.
1. Install Apache2
Install Apache HTTP Web server.
$ sudo apt update
$ sudo apt install apache2 apache2-utils -yStart the Apache service.
$ sudo systemctl start apache2Enable the service to start on system boot.
$ sudo systemctl enable apache22. Install Apache Subversion
Install all required dependencies.
$ sudo apt-get install libapache2-mod-svn subversion-tools libsvn-dev -yYou will get a prompt, select Internet Site default option.
Install Subversion.
$ sudo apt install subversion -yEnable Apache modules to run SVN.
$ sudo a2enmod dav
$ sudo a2enmod dav_svnRestart the Apache service.
$ sudo systemctl restart apache23. Configure Apache2 for SVN
Edit the SVN apache configuration file.
$ sudo nano /etc/apache2/mods-enabled/dav_svn.confThe final file should look like the below lines. Close and save the file.
Alias /svn /var/www/svn
<Location /svn>
DAV svn
SVNParentPath /var/www/svn
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
</Location>Create project repositories.
$ sudo mkdir /var/www/svn
$ sudo svnadmin create /var/www/svn/projectChange repository permissions.
$ sudo chown -R www-data:www-data /var/www/svn
$ sudo chmod -R 775 /var/www/svn4. Create SVN Admin Accounts
Create a new SVN user admin.
$ sudo htpasswd -cm /etc/apache2/dav_svn.passwd adminRestart Apache server.
$ sudo systemctl restart apache2To access the web interface, open your browser and go to the URL http://server_IP/svn/project. For example:
http://192.0.2.10/svn/projectConclusion
You have successfully installed Apache Subversion on your server. To log in to the prompt, use admin as your username with the password you set during account creation. You can now configure SVN to version your projects.
More Information
For more information on Apache Subversion, please see the official documentation.