Skip to content
December 30, 2009 / sanjaydalal4u

Setup Subversion Server on Ubuntu

Step: 1 Installing the Subversion package

#apt-get install subversion

Step:2  Configure Subversion Directory

#mkdir –p  /home/svn/repository

Step 3 Configure Subversion group

#groupadd svn

#chgrp svn /home/svn/repository

#chmod g+rw /home/svn/repository

(you need to make sure that all new files and directories created in the repos directory (in other words, anything committed to the repositories) will also be owned by the group)

#chmod g+s /home/svn/repository

#usermod –a –G svn user1 (Assign users to svn group)

#usermod –a –G svn user2 (Assign users to svn group)

Step 4: Creating a New repository

#svnadmin create /home/svn/repository/test

Step 5: Checkout Repository

#svn checkout file:///home/svn/repository/test

Output: Checked out revision 0

Step 6: Add new files to Empty repository

#cd test

# echo ‘Hello, World!’ > hello.txt

#svn add hello.txt

Output : A         hello.txt

Step 7 : Commit files

#svn commit -m “Added a ‘hello world’ text file.”

Output :

Adding         hello.txt

Transmitting file data .

Committed revision 1.

Accessing SVN repository

Step 1:  Configure Users for Access SVN repository.

#vi /home/svn/repository/conf/authz

(Add below entry)

[/]

User1 = rw

[/test]

User1 = rw

User2 = rw

(save file)

#vi /home/svn/repository/conf/passwd

(Add below entry)

User1=password1

User2=password2

(save file)

Step 2: Configure files for authentication

# rm –rf /home/svn/repository/test/conf/authz

# rm –rf /home/svn/repository/test/conf/passwd

#vi /home/svn/repository/conf/svnserve.conf

[general]

anon-access = none

password-db = /home/svn/repository/conf/passwd

realm = Team

Step 3: Start repository

#svnserve -d –foreground -r /home/svn/ repository

Step 4 : Test the Repository

#svn checkout svn://ipaddress/test –username user1

Step 5: Initialize the Script at Startup


#wget http://odyniec.net/articles/ubuntu-subversion-server/svnserve

#move svnserve /etc/init.d/

# chmod +x /etc/init.d/subserve

#update-rc.d svnserve defaults

Advertisement

5 Comments

Leave a Comment
  1. tangguh / Oct 20 2010 4:05 am

    now launch ubuntu maverick. do have any tutorial for that ? i hope so , thanks

  2. sudarshan / Mar 29 2011 6:30 am

    Hi Sanjay,

    Nice and great step to step guide here.
    Like reading.
    Thanks.

  3. antony / Jul 22 2011 6:04 am

    cool blog dear….loved the articles…well done..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.