Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Firstly thank you to everyone who responded to my earlier question - http://stackoverflow.com/questions/1393827/setting-up-svn-web-based-services-vs-your-own-svn-server

As much as I would prefer to use a web based solution, the svn server is to be implemented in the office.

We are currently running FreeBSD on our server, I am currently looking for information on setting up a SVN repository on the server with the command prompt.

I have used terminal commands on Ubuntu in the past so I have some idea but I am nowhere near a expert. I have come across a handful of tutorials however they seem quite different and seem to skip a few bits. Im really looking for a step by step guide on setting up a repository and its users. Ideally a beginners guide so I know exactly whats happening.

I would really appreciate any hints or pointers in the right direction.

Thank you for your time.

share|improve this question

migrated from stackoverflow.com Sep 11 '09 at 2:31

This question came from our site for professional and enthusiast programmers.

4 Answers 4

I advise you at first try to use svnserve daemon which comes with subversion. It uses its own protocol over TCP, so for all operations with repository you'll be using a svn:// URL scheme, for example:

% svn checkout svn://localhost/myproject

So, after installing devel/subversion port:

# cd /usr/ports/devel/subversion
# make WITHOUT_BDB=1 WITH_SVNSERVE_WRAPPER=1 WITH_REPOSITORY_CREATION=1 install clean

you will get a fresh empty repository in /home/svn/repos. The Port also will create svn user and svn group (check for both of them in /etc/passwd and /etc/group files to be sure).

Then, add this lines to yous /etc/rc.conf:

svnserve_enable="YES"
svnserve_flags="-d --listen-port=3690 --listen-host 127.0.0.1"
svnserve_data="/home/svn/repos"
svnserve_user="svn"
svnserve_group="svn"

Change 127.0.0.1 to another IP, accessible from other machines, if you need that. Start daemon with the command:

# /usr/local/etc/rc.d/svnserve start

If no errors occurred, check running daemon:

# /usr/local/etc/rc.d/svnserve status
svnserve is running as pid 65968.

or

# sockstat | grep svn
svn      svnserve   65968 3  tcp4   127.0.0.1:3690        *:*

OK. Now you'll need to create a per-user authentication for svnserve. This is done by editing /home/svn/repos/conf/passwd file, for example:

[users]
bob = password
joe = another_password
alex = yet_another_password

Then, make sure that in /home/svn/repos/conf/svnserve.conf file exists this lines:

[general]
anon-access = none
auth-access = write
password-db = passwd

That's it. Now you can import your sources into this repository. For more information please read http://svnbook.red-bean.com/en/1.5/svn.serverconfig.svnserve.html

share|improve this answer
    
just a note, im not sure why, but the installer for me used the user 'www' and group 'www' –  Christopher Chase Nov 16 '10 at 1:26

Version Control with Subversion is the source I usually turn to for Subversion information. Chapters 5 and 6 look like they might get you in the right direction.

share|improve this answer

I recommend accessing the repository with HTTP, which will simplify many things for the clients (specially if they are behind a firewall). I like going the Apache way.

share|improve this answer
$ su -
$ cd /usr/ports/devel/subversion
$ make install clean

Answer the questions asked during installation, and you should get a working subversion installation.

If you don't get the dialog asking for configuration options type

$ make config

To allow enabling the apache module, svnserve and a few other options.

share|improve this answer
    
But no server, as far as I know... –  bortzmeyer Sep 14 '09 at 8:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.