Subversion Access with svnserve

The svnserve program is a lightweight, standalone server for subversion. To run svnserve on our servers, you need a Standard, Advanced or Corporate package. The daemon must be configured to listen on your assigned v-host IP address.

Creating the repositories

If you have not created any subversion repositories yet, you can create one with svnadmin:

  $ svnadmin create ~/my-repository
Tweaking svnserve.conf

Open up and edit the svnserve.conf file located in the $HOME/my-repo/conf/ directory.

  #
  # Sample $HOME/my-repo/conf/svnserve.conf
  #
  [general]
  
  # Path to the file containing svn users and passwords.
  password-db = $HOME/my-repo/conf/passwd
  
  # Authentication realm of the repository. Two repositories using the
  # same password-db should have the same realm.
  realm = My-test-repository
  
  # Deny all anonymous access
  anon-access = none
  
  # Grant authenticated users read and write privileges
  auth-access = write
Setting up password authentication

Open up and edit the password-db file (ie. $HOME/my-repo/conf/passwd). A sample entry might look like this:

  [users]
  user1 = password1
  user2 = password2
Starting up the server

Run the server by invoking svnserve with the -d switch (daemon mode) and --listen-host 96.47.74.x (substituting 96.47.74.x for your v-host IP address).

  $ svnserve -d --listen-host 96.47.74.x -r $HOME/my-repo

To ensure that your svnserve gets started whenever the server is booted, you must add a @reboot line to your crontab. Use the crontab -e command to bring up your crontab in your favorite text editor and add the following line:

  @reboot svnserve -d --listen-host 96.47.74.x -r $HOME/my-repo
Testing the server

To test the server's functionality, you can create a working copy of your repository using your shell. The checkout command will create a working copy of the repository:

  $ svn co svn://your-domain.com/$HOME/my-repo my-working-dir
  $ cd my-working-dir
  $ echo "foo bar" > test-file
  $ svn add test-file
  $ svn remove test-file
  $ svn commit
Setting connection limits

If needed, you can contact us to request specific limits on the number of concurrent connections or connection rates to your svnserve. It is also possible to restrict svnserve connections to a set of static IP addresses.

Links


Csoft.net
© 2024 CubeSoft Communications
All Rights Reserved.