MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

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

Installation Of Apache HTTP Web Server

How many ways you can install Apache? Installation Types1.Yum Based2.RPM Based3.Source code/ Tar ball Based Apache install on Centos 7 (Yum Base) 1.Check OS version # cat…

Read More

Apache: Comprehensive list of Apache HTTP Server configuration directives

This page lists the Apache HTTP Server 2.4 configuration directives you will see most often in httpd.conf, virtual host files and SSL configs, grouped by function. Below…

Read More

How to install Ansible in Centos 7/RHEL 7?

On CentOS 7 or RHEL 7 you can install Ansible in two ways: with yum from the EPEL repository, which gives you Ansible 2.9, or with pip…

Read More

Major programming languages, the common package tool(s), and the central community package repository.

Most programming languages pair a command-line package tool with a public registry it downloads dependencies from. Examples are cargo with crates.io, pip with PyPI, Maven with Maven…

Read More

Install and Configure Gerrit on CentOS and Ubuntu (MySQL + Apache Reverse Proxy)

A practical, step-by-step guide to installing Gerrit for code review on CentOS/RHEL and Ubuntu/Debian. Includes package command comparisons, setup workflow, Apache proxy configuration, and verification checks.

Read More

Install Apache on Windows 7 (Legacy): MSI Setup, UAC Prompts, and PHP Integration

A practical, legacy-focused guide to installing Apache HTTP Server on Windows 7 for local development. It covers package selection, UAC behavior, verification steps, and basic PHP wiring.

Read More
Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
Puja kushwaha
Puja kushwaha
27 days ago

Simplifying Subversion deployment and administration can save teams time and reduce setup errors. Centralized management is especially helpful when several developers rely on the same repository. Teams should still plan access permissions, backups, and repository monitoring before rolling out changes. Clear upgrade steps and regular recovery tests can also help protect important version history. These practices make repository administration more reliable and easier to maintain over time.

1
0
Would love your thoughts, please comment.x
()
x