How to install subversion on ubuntu

Step 1: Subversion can be installed as follows:
sudo apt-get install subversion
Step 2: Now create directory that will hold our repository e.g. /var/lib/svn ,you can use change this directory, if you like.
mkdir -p /var/lib/svn

Step 3: Lets create a repository for project called TestProject inside the /var/lib/svn directory – this can be done as follows:
svnadmin create /var/lib/svn/TestProject

Step 4: Now lets access svn using http protocol
apt-get install apache2 libapache2-svn

Step 5: Configure the Apache2 SVN module (Use gedit/ vi/ nano editor, whichever available).
gedit /etc/apache2/mods-available/dav_svn.conf

Step 6: Add following set of lines inside dav_svn.conf at the end.


DAV svn
SVNParentPath /var/lib/svn
AuthType Basic
AuthName “Subversion Repository”
AuthUserFile /etc/apache2/dav_svn.passwd Require valid-user

Step 7: Restart Apache using following command.
/etc/init.d/apache2 restart

Step 8: Now change owner and group of svn directory as a apache user.
chown -R www-data:www-data /var/lib/svn

Step 9: Now create the password file that holds all users that will have access to SVN (e.g. sunilRajput is user name).
-c option is optional, dont use if password file already exists.

htpasswd -c /etc/apache2/dav_svn.passwd sunilRajput

Step 10: Now you can access web svn directory using http://localhost/svn/TestProject

Share this nice post:

Leave a Reply

Your email address will not be published. Required fields are marked *