Setup SVN Server on ubuntu 14.04

Setup SVN server on ubuntu 14.04


Let’s start the installation .

Step 1 » Issue the below command to update the repositories.
    sudo apt-get update
Step 2 » After updating repositories , Issue the below command to install SVN and apache webserver (To access SVN through http ) .
    sudo apt-get install subversion apache2 libapache2-svn apache2-utils
Step 3 » Now create a directory and create a new repository in that directory ( Here i’m using testrepo as repository name ).
    sudo mkdir -p /svn/repos/
    sudo svnadmin create /svn/repos/testrepo
Step 4 » Now 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.
    sudo gksu gedit
copy and paste this code:
---------------------------------------------------
<Location /svn>
  DAV svn
  SVNParentPath /svn/repos/
  AuthType Basic
  AuthName "Test Repo"
  AuthUserFile /etc/svnpasswd
  Require valid-user
</Location>
---------------------------------------------------
and save it to /etc/apache2/sites-available/ folder

here:
SVNParentPath /svn/repos/ : Parent Directory without repository name.
AuthUserFile /etc/svnpasswd : File need to be created ( Step 8) for user details.

Step 6 » Issue the below command to enable the Site ( testrepo in the below command should match the file name created in the previous step )
    sudo a2ensite testrepo
Step 7 » Now restart or reload apache service.
    sudo service apache2 reload
Step 8 » Issue the command to 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 » Now you can 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.

Reference:- http://www.krizna.com/ubuntu/setup-svn-server-on-ubuntu-14-04/

Other important link
1. http://bookofzeus.com/articles/subversion/create-a-svn-repository-with-ubuntu-and-subversion/
SHARE

Ibrar Ansari

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment