next up previous contents
Next: The http:// access schema Up: Creating and accessing a Previous: FSFS or BDB   Contents

The svn:// and svn+ssh:// access schemes

The most easiest way to start Subversion as a standalone server is the command

# svnserve -d

The option -d stands for ''daemon mode'' and the processes will accepts and serve request on port 3690. The port and the network interface on which Subversion listens to can be changed with -listen-port and -listen-host options.

We can access our example repository located in /tmp/svnrepo on the server machine via svn:// scheme:

$ svn co svn://localhost/tmp/svnrepo/helloworld

We can also start svnserve with -r to a root for the repositories. All path names in the URLs will be resolved relative to this root and will not allowed outside it. For example, we can start Subversion with

# svnserve -d -r /tmp

Then we checkout the project using the following URL:

$ svn co svn://localhost/svnrepo/helloworld

Subversion can be used also with inetd. The command svnserve accepts -i option which causes the program to use stdin and stdout descriptors, as appropriate for inetd daemon. When a client connects to the Subversion service, inetd starts an svnserve process to handle the request.

svn stream tcp nowait root /usr/local/bin/svnserve
   svnserve -i

or

svn stream tcp nowait root /usr/local/bin/svnserve
   svnserve -i -r /tmp

Both examples consist of just one line in /etc/inetd.conf. However, this configurations are not security justified, because the spawned svnserve processes are owned by root and should not be used.

It is also possible to communicate with a Subversion repository over an SSH tunnel. This is very simple and does not require a running svnserve daemon on the repository machine. The user simply specify the access scheme as svn+ssh://

$ svn co svn+ssh://localhost/tmp/svnrepo/helloworld

The Subversion client starts an ssh connection to the repository machine and tries to authenticate the user. The authentication is done on SSH level, no Subversion mechanisms for authentication are used here. After the user is authenticated by SSH, an svnserve process is started on the remote machine in tunnel mode with -t option. The spawned process is owned by the authenticated user and svnserve uses that user as an author of the changes.

Subversion has more configurations options for inetd mode and tunnel mode and they are described in details at
http://svnbook.red-bean.com/nightly/en/svn.serverconfig.svnserve.html.


next up previous contents
Next: The http:// access schema Up: Creating and accessing a Previous: FSFS or BDB   Contents
Ivan Ivanov 2008-04-21