4

Firstly thank you to everyone who responded to my earlier question - https://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.

6

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

1
  • 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
3

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.

2

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.

2
$ 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.

1
  • But no server, as far as I know... – bortzmeyer Sep 14 '09 at 8:23
0

The latest version is available as port and pre-built package.

To install the package,

sudo pkg install subversion

And make sure to read and follow the text with details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy