Setup Subversion (SVN) Repositories on Debian/Ubuntu

  • Last Created On Dec 09, 2024
  • 9
0 0

Install required packages

We are going run SVN under xinetd for low resource usages.

apt-get install xinetd subversion

Create svn user

adduser --system --home /var/svn --disabled-password --disabled-login --group svn

Create your first repository

svnadmin create /var/svn/repositories

Run following commands to insert settings into /var/svn/repositories/conf/svnserve.conf

cat >/var/svn/repositories/conf/svnserve.conf <<EOF
[general]
anon-access = none
auth-access = write
password-db = passwd
authz-db    = authz

[sasl]
EOF

Edit /var/svn/repositories/conf/passwd to add user and password.

Insert:

[users]
YOUR_USERNAME = YOUR_PASSWORD

Edit /var/svn/repositories/conf/authz to modify user permission.

Example:

[/]
YOUR_USERNAME = rw

[/example.com]
YOUR_USERNAME = rw
other = r</pre>

Note: r = read only; rw = read & write

Run following commands to create a xinetd configuration file for Subversion at /etc/xinetd.d/svnserve

cat >/etc/xinetd.d/svnserve <<EOF
service svn
{
        port        = 3690
        socket_type = stream
        protocol    = tcp
        wait        = no
        user        = svn
        server      = /usr/bin/svnserve
        server_args = -i -r /var/svn/repositories
}
EOF

Restart xinetd, and you are done.

/etc/init.d/xinetd restart

Final Check

Make sure Subversion is running using following command:

netstat -ant | grep ':3690'

You should see something like this if Subversion is running:

tcp        0      0 0.0.0.0:3690            0.0.0.0:*               LISTEN

Remember to open port 3690 if you have firewall installed.

You can now access your Subversion repository using svn://YOUR_HOST/ from any SVN client.

Views: 9

Recent Articles

  • How to Install JAX with ROCm Acceleratio...
    96
  • Deploy a PyTorch Workspace on a Vultr Cl...
    71
  • Managing Backup Storage
    83
  • Automating FTP Backups in Windows Server
    71
  • Automating FTP Backups in Linux
    75

Popular Articles

  • Our General Terms & Conditions
    2635
  • Our Privacy Policy
    2479
  • Our Cookies Policy
    275
  • Our Terms of Use
    153
  • How to Install JAX with ROCm Acceleratio...
    96