• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Monday, May 12, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System CentOS

How to Setup an Apache Subversion (SVN) Server on CentOS 7

How VPS by How VPS
October 1, 2019
in CentOS
0
0
SHARES
8
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Prerequisites
  2. Step 1: Update the system
  3. Step 2: Install Apache
  4. Step 3: Install SVN and the mod_dav_svn module
  5. Step 4: Configure SVN
    1. 1) Modify the SVN configuration file
    2. 2) Create an SVN repo
    3. 3) Setup SVN user accounts
    4. 4) Setup permissions for users
  6. Step 5: Start Apache and modify firewall rules
  7. Want to contribute?


Apache Subversion (SVN) is a widely used version control solution which helps in storing files of various versions, like source code and documents.

In this article, I will show you how to use Apache Subversion and Apache to build an SVN server on a Vultr CentOS 7 server instance.

Prerequisites

  • VM running CentOS 7 (minimal install preferred, but not required).
  • A sudo user for login. Another Vultr article describes the details about how to setup a sudo user.

Step 1: Update the system

sudo yum update
sudo shutdown -r now

After the reboot, log into the system again using the same sudo user.

Step 2: Install Apache

Install Apache using YUM:

sudo yum install httpd

Remove Apache’s default welcome page:

sudo sed -i 's/^/#&/g' /etc/httpd/conf.d/welcome.conf

Prevent Apache from displaying files in the “/var/www/html” directory:

sudo sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/httpd/conf/httpd.conf

Step 3: Install SVN and the mod_dav_svn module

To make SVN work with Apache, you need to install an Apache module “moddavsvn” in addition to SVN:

sudo yum install subversion mod_dav_svn

Step 4: Configure SVN

1) Modify the SVN configuration file

sudo vi /etc/httpd/conf.modules.d/10-subversion.conf

The file should read:

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so
LoadModule dontdothat_module  modules/mod_dontdothat.so

Append the following segment:

<Location /svn>
DAV svn
SVNParentPath /svn
AuthName "SVN Repos"
AuthType Basic
AuthUserFile /etc/svn/svn-auth
AuthzSVNAccessFile /svn/authz
Require valid-user
</Location>

Save and quit:

:wq!

Note: In this configuration, we specified an HTTP access authentication file “/etc/svn/svn-auth” and a user permission control file “/svn/authz”. Both of them will be created later.

2) Create an SVN repo

sudo mkdir /svn
cd /svn
sudo svnadmin create repo1
sudo chown -R apache:apache repo1

3) Setup SVN user accounts

Use the following commands to create an HTTP access authentication file “/svn/svn-auth” and an SVN user account “user001”:

sudo mkdir /etc/svn
sudo htpasswd -cm /etc/svn/svn-auth user001
sudo chown root:apache /etc/svn/svn-auth
sudo chmod 640 /etc/svn/svn-auth

If you want to create more SVN user accounts, refer to the following commands:

sudo htpasswd -m /etc/svn/svn-auth user002
sudo htpasswd -m /etc/svn/svn-auth user003

Warning: Do not use the “-c” flag from now on, or you will rebuild the authentication file and erase all the user accounts you setup earlier.

4) Setup permissions for users

sudo cp /svn/repo1/conf/authz /svn/authz
sudo vi /svn/authz

Assume that:

  • User “user001” is the administrator.
  • User “user002” is a qualified user who owns read and write permissions to the SVN repo “repo1”.
  • User “user003” is a trainee who can only read the contents of SVN repo “repo1”.

Then you can modify the settings within as below:

[groups]
admin=user001
repo1_user=user002
repo1_trainee=user003

[/]
@admin=rw

[repo1:/]
@repo1_user=rw
@repo1_trainee=r

Save and quit:

:wq!

Step 5: Start Apache and modify firewall rules

Start Apache:

sudo systemctl start httpd.service
sudo systemctl enable httpd.service

Open the HTTP service port:

sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --reload

Finally, use the following path to access the SVN repo “repo1” on your server from an SVN client:

http://<your-server-ip>/svn/repo1/

That concludes our tutorial. Thank you for reading.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

How to Deploy a .NET Core Web Application on CentOS 7

Next Post

Installing docker-compose on CoreOS

Next Post

Installing docker-compose on CoreOS

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet