In this tutorial we are going to learn how to install Apache SVN on Ubuntu 18.04. We will also install and configure its prerequisites. Subversion is a product of Apache Software Foundation. It helps you keep track of a collection of files and folders. Any time you change, add or delete a file or folder that you manage with Subversion, you commit these changes to your Subversion repository, which creates a new revision in your repository reflecting these changes. You can always go back, look at and get the contents of previous revisions.
I recommend to use a minimal Ubuntu server setup as a basis for the tutorial, that can be a virtual or a root server image with an Ubuntu 18.04 Bionic Beaver minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.
Install Apache SVN on Ubuntu 18.04
Step 1. First, ensure your system and apt package lists are fully up-to-date by running the following:
apt-get update -y apt-get upgrade -y
Step 2. Installing Apache web server.
Install Apache server for accessing SVN server using HTTP URLs:
apt install apache2 apache2-utils
Step 3. Install Apache SVN on Ubuntu 18.04.
Use the following command to install subversion packages and their dependencies:
apt install subversion subversion-tools libapache2-mod-svn
Step 4. Configure Apache SVN.
Now, create a repository as per your requirements. In here, I am creating /opt/svn as the base and will create a “myrepos” repository in it:
mkdir /opt/svn svnadmin create /opt/svn/myrepos
Change the permission of the repository:
chown -R www-data:www-data /opt/svn/myrepos/
Next, configure Apache with Subversion:
Add the following content:
<Location /svn> DAV svn SVNParentPath /opt/svn AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/apache2/dav_svn.passwd Require valid-user </Location>
Then, create additional users, use following commands:
htpasswd -cm /etc/apache2/dav_svn.passwd ramona
Restart the apache server:
systemctl restart apache2
Step 5. Access Apache Subversion.
Use HTTP URLs to access your repository in the browser. It will prompt for authentication. Use login credentials created in above:
Congratulation’s! You have successfully install and configured Apache SVN on your Ubuntu 18.04 LTS server. Thanks for using this tutorial installing Apache Subversion on Ubuntu 18.04 LTS (Bionic Beaver) system.