Subversion (SVN) is a popular version control system widely used for managing source code repositories. In this comprehensive guide, we will walk you through the process of how to install SVN on Rocky Linux. By the end of this tutorial, you’ll have a fully functioning SVN server up and running.
Before we begin, ensure that you have:
- A Rocky Linux system up and running
- Root access or a user with sudo privileges
How to Install SVN on Rocky Linux
Update Your System
First, update your system to the latest packages and security updates:
sudo dnf update -y
Install Apache Web Server on Rocky Linux
SVN requires a web server to function. In this tutorial, we’ll use Apache. Install the Apache web server using the following command:
sudo dnf install httpd -y
After installing Apache, start and enable the service:
sudo systemctl start httpd sudo systemctl enable httpd
Tip: Learn more about setting up an Apache web server on Rocky Linux in our comprehensive guide.
Install Subversion (SVN) on Rocky Linux
Install SVN using the following command:
sudo dnf install subversion -y
Create SVN Repository on Rocky Linux
Create a directory to store your SVN repositories:
sudo mkdir /var/www/svn
Now, create your first SVN repository:
sudo svnadmin create /var/www/svn/myrepo
Change the ownership of the repository to the Apache user:
sudo chown -R apache:apache /var/www/svn/myrepo
Configure Apache for SVN on Rocky Linux
Create a new Apache configuration file for SVN:
sudo nano /etc/httpd/conf.d/svn.conf
Add the following content to the
<Location /svn> DAV svn SVNParentPath /var/www/svn AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/httpd/conf/svn-users Require valid-user </Location>
Save and close the file.
Create SVN Users on Rocky Linux
httpd-tools package to create user authentication files:
sudo dnf install httpd-tools -y
Create the first SVN user using the following command:
sudo htpasswd -cm /etc/httpd/conf/svn-users svnuser1
For additional users, use the same command without the
sudo htpasswd -m /etc/httpd/conf/svn-users svnuser2
Restart Apache and Enable Firewall on Rocky Linux
Restart the Apache service to apply the changes:
sudo systemctl restart httpd
Allow incoming HTTP connections through the firewall:
sudo firewall-cmd --add-service=http --permanent sudo firewall-cmd --reload
Access SVN Repository on Rocky Linux
You can now access the SVN repository using an SVN client or via a web browser at
http://your_server_ip/svn/myrepo. Log in with the SVN user credentials you created earlier.
Congratulations! You’ve successfully installed and configured SVN on your Rocky Linux system. This comprehensive guide has walked you through the entire process, from installing the necessary packages to setting up a repository and managing user permissions. As you can see, installing SVN on Rocky Linux is a straightforward process that enables you to take advantage of this powerful version control system.
For further reading, check out our guides on how to install and configure Fail2Ban on Rocky Linux and set up a bridged network for KVM. Additionally, we have a wide range of tutorials to help you with other aspects of Rocky Linux, such as installing and configuring Zabbix, installing MongoDB, and installing and configuring Lighttpd.
As you continue to explore Rocky Linux, you’ll find it to be a versatile and reliable operating system that can handle a wide range of tasks. From hosting web applications to serving as a base for your own custom software, Rocky Linux has you covered. So, dive in and start exploring all the possibilities that this powerful Linux distribution has to offer.