Find us on facebook

Jul 3, 2015

Setup SVN server on ubuntu 14.04

Start the installation .
Step 1 : Update the repositories.
sudo apt-get update

Step 2 : Install SVN and apache webserver (To access SVN through http ) .
sudo apt-get install subversion apache2 libapache2-svn apache2-utils

Step 3 » Create a directory and create a new repository in that directory ( testrepo is the repository name ).
sudo mkdir -p /svn/repos/
sudo svnadmin create /svn/repos/testrepo

Step 4 » Change ownership for the repository.
sudo chown -R www-data:www-data /svn/repos/testrepo

Step 5 » Create a file testrepo.conf in /etc/apache2/sites-available/ and add the below lines for creating apache virtual host.
<Location /svn>
  DAV svn
  SVNParentPath /svn/repos/
  AuthType Basic
  AuthName "Test Repo"
  AuthUserFile /etc/svnpasswd
  Require valid-user
</Location>
SVNParentPath /svn/repos/ : Parent Directory without repository name.
AuthUserFile /etc/svnpasswd : File need to be created ( Step 8) for user details.

Step 6 »Enable the Site ( testrepo in the below command should match the file name created in the previous step )
sudo a2ensite testrepo

Step 7 » Restart or reload apache service.
sudo service apache2 reload

Step 8 » Create user for accessing repository and add the user details to /etc/svnpasswd file.
Use this command to create first user.
sudo htpasswd -cm /etc/svnpasswd user1

Use the same command without c option to create additional users.
sudo htpasswd -m /etc/svnpasswd user2

Step 9 » Access http://yourip/svn/testrepo in your browser ( Eg http://10.0.1.15/svn/testrepo ) and you can see the page like below after successful authentication.

No comments:

Post a Comment