How To Install Apache SVN on Linux Mint 19 / Linux Mint 18
Subversion, widely known as SVN, is open source version control system used for storing the historical changes of source file and documents and manages it over a period of time.
This post helps you to setup SVN on Linux Mint 19 / Linux Mint 18.
Install WebServer
Update the repository index.
sudo apt-get update
Here we will install Apache server as a web server for the SVN repository.
sudo apt-get install -y apache2 apache2-utils
Verify the Apache web server by visiting
![Install Apache SVN on Linux Mint 19 - Apache Test Page](https://www.itzgeek.com/wp-content/uploads/2018/08/Install-Apache-SVN-on-Linux-Mint-19-Apache-Test-Page-1024x702.jpg)
Install Apache Subversion
Once the Apache is installed, issue the following command to install subversion.
sudo apt-get install -y subversion subversion-tools libapache2-mod-svn
Configure Apache Subversion
Once the installation is done, you can start to create repositories as per the requirements. In my case, I am creating /svn as the base and will create the repository in it.
sudo mkdir /svn
Create the repository called “testrepo”.
sudo svnadmin create /svn/testrepo
Change the permission of the repository in such a way that Apache can read and write.
sudo chown -R www-data:www-data /svn/testrepo/
Configure virtual host in Apache.
sudo nano /etc/apache2/mods-enabled/dav_svn.conf
Place the following content.
<Location /svn> DAV svn SVNParentPath /svn AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/apache2/dav_svn.passwd Require valid-user </Location>
Create a password file for the user. Replace raj with your username.
sudo htpasswd -cm /etc/apache2/dav_svn.passwd raj
Restart the apache server.
sudo service apache2 restart
Access the SVN using the browser, URL will be
You will be asked to enter the username and password.
![Install Apache SVN on Linux Mint 19 - Apacahe SVN Authentication](https://www.itzgeek.com/wp-content/uploads/2018/08/Install-Apache-SVN-on-Linux-Mint-19-Apacahe-SVN-Authentication-1024x702.jpg)
Upon successful login, contents will be listed as below.
![Install Apache SVN on Linux Mint 19 - Apache SVN Revision 0](https://www.itzgeek.com/wp-content/uploads/2018/08/Install-Apache-SVN-on-Linux-Mint-19-Apache-SVN-Revision-0.jpg)
Check out the files contained within the repository to the testing directory, create a directory called svncheckout.
mkdir svncheckout svn checkout https://192.168.1.10/svn/testrepo --username raj svncheckout/
The output will be like below.
![Install Apache SVN on Linux Mint 19 - SVN Checkout](https://www.itzgeek.com/wp-content/uploads/2018/08/Install-Apache-SVN-on-Linux-Mint-19-SVN-Checkout-1024x471.jpg)
You can create some test files in the checkout directory.
cd svncheckout/ touch checkout1.txt touch checkout2.txt
Add the files for committing.
svn add checkout1.txt checkout2.txt
Output:
A checkout1.txt A checkout2.txt
Commit the added files.
svn commit -m 'First Revision'
Output:
Adding checkout1.txt Adding checkout2.txt Transmitting file data ..done Committing transaction... Committed revision 1.
Committed files can be viewed in the browser.
![Install Apache SVN on Linux Mint 19 - Apache SVN Revision 1](https://www.itzgeek.com/wp-content/uploads/2018/08/Install-Apache-SVN-on-Linux-Mint-19-Apache-SVN-Revision-1.jpg)
That All. You can also use SVN clients such as TortoiseSVN for windows and RapidSVN for Linux.