Home > Code, Linux > Setup a Subversion Server in 4 Minutes

Setup a Subversion Server in 4 Minutes

You are going to need to type fast but I think you can do it in 4 minutes. :) These are my notes on what worked for me on my Fedora core 6 with svn lib already installed by the package manager:

1. Create a Repository

svnadmin create /svnrepos

2. Create a SVN User

vi /svnrepos/conf/svnserve.conf

In that file add these three lines:

anon-access = none
auth-access = write
password-db = passwd

Create a password file:

vi /svnrepos/conf/passwd

In that file add a line for your user:

# add users in the format : user = password
tony = mypassword

3. Import Your Project

(assuming you’ve put your project files in /projects/myrailsproject)

svn import /projects/myrailsproject file:///svnrepos/myrailsproject

4. Start the SVN Server as Daemon

svnserve -d

Done! You should now have a svn server running with one project named myrailsproject.

Try checking it out of the repository:

svn co svn://192.168.0.2/svnrepos/myyrailsproject

Since we set anon-access to none you should be prompted for username and password which you created in the file /svnrepos/conf/passwd.

Categories: Code, Linux Tags:
  1. March 3rd, 2007 at 00:04 | #1

    Very simple yet effective tutorial. Thanks for sharing.

  2. Ubersoldat
    March 3rd, 2007 at 09:11 | #2

    That’s It??? Well, I think I can do it faster than 4 minutes, let’s try… …

    jejeje… see? It was faster, installation included (with Ubuntu)

    Total Time: 2:30 now, I don’t know if this works :)

  3. Florin
    March 12th, 2007 at 06:17 | #3

    problem with import?

    “svn: error while loading shared libraries: /usr/local/lib/libsvn_ra_dav-1.so.0: cannot restore segment prot after reloc: Permission denied”

    any ideea ? PLS PLS HELP me achebv@gmail.com

  4. April 11th, 2007 at 12:14 | #4

    I don’t think you actually install a Subversion Ever!.
    Don’t try to tell you can do it in 4 minutes.
    Bull!

  5. May 8th, 2007 at 17:18 | #5

    Maybe 3, but never 4! Don’t think so!

  6. suhanya
    August 28th, 2007 at 02:01 | #6

    simply superb…….
    but i’ve a doubt…..
    how to connect a client from server?

  7. jrgreen
    October 11th, 2007 at 14:07 | #7

    This worked smoothly for me except for the fact that I did not have $SVN_EDITOR set to anything so I could not import my projects. Once I set this (export SVN_EDITOR=vi), everything worked beautifully. An alternative to setting SVN_EDITOR is to use the -m “message to record describing this action” option.

    Note also that I had to , open port 3690 to access my SVN server from other machines.

    Thanks for putting this together!

  8. anonimac
    November 30th, 2007 at 05:48 | #8

    This worked for me. I can normally access the repository from Eclipse. I skipped step 3. Saved a lot of time. Great post.

  9. Yan
    December 11th, 2007 at 14:17 | #9

    Thank you! Very useful

  10. notorious
    February 11th, 2008 at 23:16 | #10

    thanks man.. it really is helpful.. very simple yet very understandable.. keep it up..

  11. February 19th, 2008 at 20:30 | #11

    Excellent! Thanks for that simple tutorial. I did need to ‘export SVN_EDITOR=vi’ as mentioned by another poster, which allows you to edit the svn check-in comment.

    Thanks! It worked great, out of the box in Leopard, which comes with an svn install.

  12. Bakhadyr Baimuratov
    March 20th, 2008 at 00:59 | #12

    Than you! I just set up my svn server and using it with eclipse. Works great!!!

  13. required
    April 23rd, 2008 at 18:19 | #13

    nice, definitly faster than others tuts i saw.
    *I did need to ‘export SVN_EDITOR=vi’*, you can use the “-m” flag

  14. K
    April 30th, 2008 at 19:15 | #14

    Excellent tutorial! =)
    thank you so very much. the other ones are longer, and I cant follow those on a short time-frame. I know the installing part is missing. but for example, in CentOS 5 that I have, just import rpm key, then do a “yum install subversion” is all you need to install the (binary) package. Yes, you will need to hit Y when prompted and yes you do need root or equil access to install as usual.

    Thank you for Jon W for the additions. and others for saying skip step 3. works for me.

  15. rytis
    May 15th, 2008 at 04:50 | #15

    a very nice tutorial, but it didn’t work for me. to get to my machine I first have to $ ssh -L 22369:IPADDRESS:3690 -lblah -N -f, and then
    $ svn –username blahblah co svn://localhost:22369/myrailsproject .. and received no response. sshd xinetd are running on IPADDESS. From inside IPADDRESS, $ svn co svn:/localhost/myrailsproject works fine. Any suggestions why the computer isn’t listening to the request? Thanks

  16. Chris
    May 23rd, 2008 at 21:21 | #16

    Florin,

    Make sure you did “sudo svnserve -d”. Subversion needs to run as root. If it runs as your local user, it probably won’t have permission to most things, and you’ll get “permission denied” errors.

  17. boclodoa
    July 22nd, 2008 at 12:29 | #17

    Thanks, great post, I succeded with ubuntu 8.04.

    I noticed you have an extra “y” in the last code line

    svn co svn://192.168.0.2/svnrepos/myyrailsproject

  18. shy
    July 28th, 2008 at 01:25 | #18

    hi can you help me with setting up SVN server over my subdomain? i search for articles regarding those but the links they gave me are not updated..

  19. pradeep
    August 29th, 2008 at 17:38 | #19

    really a easy way to do. It helped me a lot thanks

  20. October 7th, 2008 at 03:54 | #20

    Really nice tutorials to setting SVN server, I face problem of svn editor setting solved with export SVN_EDITOR=vi’* and

    error:- svn: /var/svn/krepos/conf/svnserve.conf:12: Option expected

    I had re-commented three parameters. and working fine.

  21. wira
    October 23rd, 2008 at 01:08 | #21

    simple, compact and great articel…
    :) thanks

  22. f1codz
    November 15th, 2008 at 00:32 | #22

    thanks found useful

  23. captain
    November 26th, 2008 at 14:51 | #23

    This doesn’t work for me. I built out svn 1.5.4 from source. I do this and I get “svn: No repository found in ’svn://localhost/repositories/myproject”

    I also get this error if I install from .deb packages or through apt-get. I’ve also looked through the subversion book, I don’t see what I’m missing.

  24. makzan
    December 9th, 2008 at 09:48 | #24

    I also get the “svn: No repository found in ’svn://…..’” too
    I am doing on Mac OS 10.5 with svnadmin etc installed.
    the svnserve is already running too.

    Moreover, This is a very good tutorial! thanks

  25. December 14th, 2008 at 02:43 | #25

    Hi,

    I have created the svn repository. I want to access this svn repository from another pc using network.Could you please tell me how can I do this.

    Thanks,
    Harish

  26. fizeen
    January 5th, 2009 at 02:15 | #26

    When i tried with the third step its giving me a error message
    svn import /script/ file:///svnrepos/script
    svn: Could not use external editor to fetch log message; consider setting the $SVN_EDITOR environment variable or using the –message (-m) or –file (-F) options
    svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set, and no ‘editor-cmd’ run-time configuration option was found
    Please help me

  27. Karen
    February 17th, 2009 at 14:34 | #27

    Excelent! Saved me a lot of work. Thanks!

  28. yogini
    May 14th, 2009 at 01:42 | #28

    how do i import files from a single svn dump file? can anyone help? I hv a svn dump file of size 41 Mb approx.

  29. Irving
    July 10th, 2009 at 04:09 | #29

    For fizeen, you have misunderstood the comments above. If SVN_EDITOR, VISUAL or EDITOR are NOT set (which is your situation), you need to set one of these environment variables. For example,

    export EDITOR=vi

    Many distributions have EDITOR set already, so others did not need to set it.

    Then, do the import.

  30. Chris
    June 13th, 2010 at 19:33 | #30

    Short, but not very practical. Running “svnserve -d” isn’t how you properly start a daemon. You need to configure it to run at boot time.

  1. June 25th, 2008 at 22:38 | #1