Apache Subversion (SVN) is a popular version control system that allows you to track changes to your files and collaborate with others. In this article, we will show you how to install Apache Subversion on Rocky Linux 8.
- Before you can install Apache Subversion, you need to make sure that your Rocky Linux 8 system is up to date. Run the following command to update the package index:
sudo dnf update
- Once the package index is updated, you can install Apache Subversion by running the following command:
sudo dnf install subversion
- Once the installation is complete, you can verify that Apache Subversion is installed by running the
svn --versioncommand. This should print the version number of Apache Subversion, along with some other information. - To create a new Apache Subversion repository, you can use the
svnadmincommand. For example, to create a repository in the/srv/svndirectory, you can run the following command:
sudo svnadmin create /srv/svn
This will create a new Apache Subversion repository in the /srv/svn directory.
- To start using your Apache Subversion repository, you will need to set up a user and grant them access to the repository. To do this, you can use the
htpasswdcommand to create a user and password file. For example, to create a user named “user1” with the password “password1”, you can run the following command:
sudo htpasswd -c /srv/svn/users user1
This will prompt you to enter the password for the user. Once you have entered the password, the user will be created and added to the password file.
- With the user and password file set up, you need to configure Apache Subversion to use the password file for authentication. To do this, you need to edit the
/srv/svn/conf/svnserve.conffile and add the following lines to the file:
anon-access = none
auth-access = write
password-db = /srv/svn/users
This will configure Apache Subversion to use the password file for authentication and to require authentication for all access to the repository.
- With the configuration changes made, you need to restart the Apache Subversion service to apply the changes. On Rocky Linux 8, you can use the following command to restart the service:
sudo systemctl restart svnserve
- Once the Apache Subversion service is restarted, you can test the connection to the repository by running the following command:
svn list svn://localhost/
This should prompt you for a username and password. Enter the username and password for the user you created earlier to access the repository.
Congratulations! You have successfully installed Apache Subversion on Rocky Linux 8 and set up a repository. You can now start using Apache Subversion to track changes to your files and collaborate with others.