This assume you have already installed Subversion.
It is very common to interact with Subversion over HTTP. To do this, use apt-get or yum to install HTTPD web server and the Subversion module.
apt-get install httpd mod_dav_svn
yum install httpd mod_dav_svn
Edit the /etc/httpd/conf.modules.d/10-subversion.conf file, and add the following markup.
Alias /svn /var/www/svn
<Location /svn>
DAV svn
SVNParentPath /var/www/svn/
AuthType Basic
AuthName "Subversion repositories"
AuthUserFile /etc/svn-auth-users
Require valid-user
</Location>
Since /var/www/svn was set as the Subversion parent directory, create the /var/www/svn directory.
mkdir /var/www/svn
If firewalld is enabled, issue the following commands to allow HTTP and HTTPS in the firewall.
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload
The ps command can be used to determine if your system is using init or systemd. If PID 1 is init, then you will use the service command. If PID 1 is systemd, then you will use the systemctl command.
If your system is using systemd, use the systemctl command to restart and enable httpd.
systemctl enable httpd
systemctl restart httpd
systemctl status httpd
If your system is using init, use the chkconfig and service commands to restart and enable httpd.
chkconfig httpd on
service httpd restart
service httpd status
You can now go to http://example.com/svn/repo and you will be prompted to provide a username and password. Since we've not yet setup any users that have access to the respository, you will get Unauthorized. You will need to create a username and password that can be used to authenticate into the Subversion repository.
Did you find this article helpful?
If so, consider buying me a coffee over at