Powered By Blogger

Mar 5, 2015

Setup svn server on ubuntu

This post describes about setting up the svn server on ubuntu.
  • Install Subversion
$ sudo apt-get install subversion libapache2-svn apache2

  • Configure Subversion
Create a directory for where you want to keep your subversion repositories:
$ sudo mkdir /subversion
$ sudo chown -R www-data:www-data /subversion/

  • Open the subversion config file dav_svn.conf (/etc/apache2/mods-available) and add the lines at the end as shown below. Comment or delete all the other lines in the config file:
#</Location>
<Location /subversion>
DAV svn
SVNParentPath /subversion
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
</Location>
  • Now create a SVN user using the following command. Here I create a new SVN user called sohani with password msc12345:

$ sudo htpasswd -cm /etc/apache2/dav_svn.passwd sohani
New password: 
Re-type new password: 
Adding password for user sohani

Use -cm parameter for the first time only, you can create another user with only -m parameter.
  • Create Subversion repository called sohani.repo under /subversion directory:

$ cd /subversion/
$ sudo svnadmin create sohani.repo
Restart Apache service:

$ /etc/apache2 sudo service apache2 reload
  • Open the browser and navigate to http://ip-address/subversion/sohani.repo. Enter the SVN username and password which you have created in the earlier step. In my case, username is sohani and password is msc12345.


No comments:

Post a Comment