In this tutorial, we will show you how to install Apache Subversion on CentOS 8. For those of you who didn’t know, The Apache Subversion (SVN) is a free and open-source version control system used to manage and track changes in files and directories. Any time you change, add or delete a file or folder that you manage with Subversion, you commit these changes to your Subversion repository, which creates a new revision in your repository reflecting these changes. You can always go back, look at and get the contents of previous revisions. SVN supports several protocols for network access: SVN, SVN+SSH, HTTP, HTTPS. If you are behind a firewall, HTTP-based Subversion is advantageous since SVN traffic will go through the firewall without any additional firewall ruleset.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘
sudo‘ to the commands to get root privileges. I will show you through the step-by-step installation of the Apache Subversion on a CentOS 8.
Install Apache Subversion on CentOS 8
Step 1. First, let’s start by ensuring your system is up-to-date.
sudo dnf update sudo dnf install epel-release
Step 2. Installing Apache Subversion on CentOS 8.
Now we run the following commands to install Apache SVN on the CentOS system:
sudo dnf install subversion mod_dav_svn
Step 3. Configure Apache Subversion.
The subversion module package creates an Apache configuration file, we just need to make the necessary changes to it:
sudo nano /etc/httpd/conf.d/subversion.conf
Add the following line:
<Location /svn> DAV svn SVNParentPath /var/www/svn AuthType Basic AuthName "Apache SVN Repositories" AuthUserFile /etc/svn/svn-auth Require valid-user </Location>
Next, create SVN directories:
sudo mkdir /var/www/svn /etc/svn/
Step 4. Create Repository and Users for Authentication.
First, create your first SVN repository:
cd /var/www/svn sudo svnadmin create myrepo
Next, set the permissions:
sudo chown -R apache.apache myrepo
Then, create an SVN HTTP access authentication file:
sudo touch /etc/svn/svn-auth
Add first SVN user:
$ sudo htpasswd -cm /etc/svn/svn-auth idroot New password: <Enter-your-password> Re-type new password: <Confirm-your-password> Adding password for user idroot
After that, give proper permissions to the password file:
sudo chown root:apache /etc/svn/svn-auth sudo chmod 640 /etc/svn/svn-auth
Step 5. Configure Firewall.
Now we open the HTTP port on the firewall:
sudo firewall-cmd --add-service=http --permanent sudo firewall-cmd --reload
Step 6. Accessing Repository in Browser.
Apache Subversion will be available on HTTP port 80 by default. Open your favorite browser and navigate to
http://your-server-ip/svn/project/ and will prompt for authentication. Use login credentials created in Step 4. If you are using a firewall, please open port 80 to enable access to the control panel.
Congratulations! You have successfully installed Apache SVN. Thanks for using this tutorial for installing the Apache Subversion on your CentOS 8 system. For additional help or useful information, we recommend you check the official Apache website.