DEV Community

insthync
insthync

Posted on

[Note] Installing SVN Server to Droplets

In this post, I will write about how I set up SVN server to Ubuntu 18.04 (LTS) x64 droplets

Then enter to ssh server by the address with command:

ssh root@{Server address}
Enter fullscreen mode Exit fullscreen mode

Installing Apache and SVN module

Installing Apache

sudo apt-get update
sudo apt-get install apache2
Enter fullscreen mode Exit fullscreen mode

Installing SVN module

sudo apt-get install subversion libapache2-mod-svn
Enter fullscreen mode Exit fullscreen mode

Enable required modules

sudo a2enmod dav dav_svn authz_svn
Enter fullscreen mode Exit fullscreen mode

Restart Apache

sudo service apache2 restart
Enter fullscreen mode Exit fullscreen mode

Create new repository

Create repositories storing directory

sudo mkdir -p /var/lib/svn/
Enter fullscreen mode Exit fullscreen mode

Set repositories storing directory permissions

sudo chown -R www-data:www-data /var/lib/svn
sudo chmod -R 775 /var/lib/svn
Enter fullscreen mode Exit fullscreen mode

Create users into file: /etc/apache2/dav_svn.passwd

sudo touch /etc/apache2/dav_svn.passwd
sudo htpasswd -m /etc/apache2/dav_svn.passwd {Your Username}
Enter fullscreen mode Exit fullscreen mode

Set SVN module config

sudo nano /etc/apache2/mods-enabled/dav_svn.conf
Enter fullscreen mode Exit fullscreen mode

Copy following config content to the file

<Location /svn>

   DAV svn
   SVNParentPath /var/lib/svn

   AuthType Basic
   AuthName "Subversion Repository"
   AuthUserFile /etc/apache2/dav_svn.passwd
   Require valid-user

</Location>
Enter fullscreen mode Exit fullscreen mode

Create new SVN repository into repositories storing directory (/var/lib/svn/)

sudo svnadmin create /var/lib/svn/{Repository name}
Enter fullscreen mode Exit fullscreen mode

Restart Apache

sudo service apache2 restart
Enter fullscreen mode Exit fullscreen mode

Try it by using web-browser, browse: http://{Server address}/svn/{Repository name}

Top comments (0)