Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

Install Subversion (SVN) on Linux: Package Install, Source Build, Apache Setup, and Authentication

Installing Subversion (SVN) on Linux is easiest when you treat it as three tasks: install binaries, create a repository, and publish it over HTTP with authentication. This guide is for engineers who want a reliable server setup and a quick way to verify that users can import and check out code.

Originally published on 2010-06-27; fully revised and updated.

Subversion on Linux installation process

Choose an installation approach first

The original post built SVN from source (version 1.6.9). That still teaches the mechanics, but most teams should start with distro packages for maintainability and security updates.

ApproachBest forProsTrade-offs
Package manager (apt/dnf/yum/zypper)Most production serversFast install, easier updates, integrated service filesVersion tied to distro repos
Build from source tarballsLegacy compatibility or custom buildsFull control over compile options and versionMore dependencies, harder patching/upgrades

SVN server setup workflow

flowchart TD
    A[Select install method] --> B[Install Subversion binaries]
    B --> C[Create repository with svnadmin]
    C --> D[Configure Apache mod_dav_svn]
    D --> E[Create auth and access files]
    E --> F[Restart Apache]
    F --> G[Import initial project]
    G --> H[Checkout from client]

Install Subversion binaries

Option A: Install from distro packages (recommended)

# Debian/Ubuntu
sudo apt update
sudo apt install -y subversion apache2 libapache2-mod-svn apache2-utils
sudo a2enmod dav dav_svn authz_svn
sudo systemctl restart apache2

# RHEL/CentOS/Rocky/Alma
sudo dnf install -y subversion httpd mod_dav_svn
sudo systemctl enable --now httpdCode language: PHP (php)

Option B: Build from source (legacy style from the original article)

The original instructions used Subversion 1.6.9 tarballs and dependency tarballs. Use this only when you specifically need source compilation.

mkdir -p /usr/local/softwares/svn
cd /usr/local/softwares/svn

# Historical URLs from the original post
wget http://subversion.tigris.org/downloads/subversion-1.6.9.tar.gz
wget http://subversion.tigris.org/downloads/subversion_deps-1.6.9.tar.gz

tar -xvzf subversion-1.6.9.tar.gz
tar -xvzf subversion_deps-1.6.9.tar.gz

cd subversion-1.6.9
./autogen.sh
./configure --with-berkeley-db=/usr/local/softwares/svn/db-4.6.21
make
sudo make installCode language: PHP (php)

Create a repository and import initial content

sudo mkdir -p /srv/svn
sudo svnadmin create /srv/svn/repos

# Set ownership to your web server user:
# Debian/Ubuntu usually uses www-data
# RHEL-family usually uses apache
WEB_USER=www-data
sudo chown -R "$WEB_USER":"$WEB_USER" /srv/svn/repos

# Initial import from a local project folder
svn import -m "Initial import" /path/to/project file:///srv/svn/reposCode language: PHP (php)

Publish the repository through Apache with authentication

To serve SVN over HTTP(S), configure mod_dav_svn, then add user authentication and path authorization.

# Example: /etc/httpd/conf.d/subversion.conf (RHEL)
# or /etc/apache2/mods-available/dav_svn.conf (Debian)
<Location /svn/repos>
    DAV svn
    SVNPath /srv/svn/repos

    AuthType Basic
    AuthName "Subversion repository"
    AuthUserFile /etc/svn-auth-file
    AuthzSVNAccessFile /etc/svn-access-file
    Require valid-user
</Location>Code language: PHP (php)
# Create first SVN user
sudo htpasswd -cm /etc/svn-auth-file test

# Authorization rules (read/write to all authenticated users)
printf "[/]\\n* = rw\\n" | sudo tee /etc/svn-access-file > /dev/null

# Restart Apache
sudo systemctl restart apache2   # Debian/Ubuntu
sudo systemctl restart httpd     # RHEL familyCode language: PHP (php)

Verify access from CLI and clients

# List repository contents over HTTP
svn list http://localhost/svn/repos --username test

# Checkout a working copy
svn checkout http://localhost/svn/repos /path/to/checkout --username testCode language: PHP (php)

The original article also mentioned SmartSVN. Any modern SVN-compatible client can use the same repository URL once Apache authentication is working.

Common pitfalls and best practices

  • Prefer distro packages unless you have a strict reason to compile from source.
  • Confirm module and service names for your distro (apache2 vs httpd, module package names, config paths).
  • Use a dedicated repository path (for example, /srv/svn) rather than build directories.
  • Apply least privilege in svn-access-file instead of granting global write to everyone.
  • If browser access fails, check Apache logs, SELinux context, and firewall rules.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

How to Configure HTTP/HTTPS Proxy on Linux and Windows (CLI, GUI, Registry, and APT)

Set up proxy access correctly on Windows and Linux for command-line tools, package managers, and system-level use. This guide covers quick commands, persistent configuration, and common troubleshooting steps.

Read More

Linux pmap Command Guide: Inspect Process Memory Maps with Practical Examples

Learn how to use the Linux pmap command to inspect per-process memory mappings, compare output modes, and troubleshoot high memory usage quickly. This updated guide includes workflow steps, command examples, and interpretation tips.

Read More

iostat Command Guide for Linux: 20 Practical Examples for CPU and Disk I/O Troubleshooting

Learn how to use iostat to monitor CPU and storage performance on Linux systems. This revised guide covers installation, 20 practical commands, metric interpretation, and a troubleshooting workflow.

Read More

xargs in Linux: Practical Commands, Safe Patterns, and Pipeline Workflows

This guide explains how to use xargs effectively in Linux/Unix shells, from basic stdin handling to safe file operations and parallel execution. You’ll learn practical command patterns, portability caveats, and safer alternatives.

Read More

Linux mount and umount Commands: Practical Examples, /etc/fstab, and Safe Unmounting

Learn how to mount and unmount filesystems reliably on Linux, from one-off commands to persistent /etc/fstab entries. This guide covers common filesystem types, command comparisons, and safe troubleshooting steps.

Read More

How to Use gsh to Run Linux Commands Across Multiple Servers

gsh (Group Shell) lets you execute one command across many Linux hosts from a single terminal. This guide explains host grouping with /etc/ghosts, core options, and practical command patterns.

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x