How to Install Subversion on Fedora Server Latest?
Subversion (also known as SVN) is a free and open-source version control system used for managing and tracking changes to projects or files. In this tutorial, we will guide you on how to install Subversion on a Fedora server latest.
Prerequisites
Before you proceed with the installation of Subversion, you must have the following:
- A Fedora server latest installed
- A sudo user account for running commands with administrative privileges
Step 1: Update the Server
The first step is to update the Fedora server packages to the latest version available. Open the terminal and type the following command to update the server packages:
sudo dnf update
Enter the sudo password and wait until the update process completes.
Step 2: Install Subversion
Once the server updates successfully, install the Subversion package using the following command:
sudo dnf install subversion
This command will install Subversion and all its required dependencies.
Step 3: Verify Subversion Installation
To verify that Subversion is installed successfully, run the following command:
svn --version
This command will display the installed Subversion version and other details.
Step 4: Create a Subversion Repository
To create a new Subversion repository, follow these steps:
- Create a new directory where you want to store the repository:
sudo mkdir /opt/svn/repo
- Use the
svnadmincommand to create a new repository:
sudo svnadmin create /opt/svn/repo
- Change the ownership of the
/opt/svn/repodirectory to the Apache user:
sudo chown -R apache:apache /opt/svn/repo
- Update the SELinux file context for the new repository directory:
sudo semanage fcontext -a -t httpd_sys_content_t "/opt/svn/repo(/.*)?"
sudo restorecon -Rv /opt/svn/repo
Step 5: Configure Subversion Access Control
To restrict access to the Subversion repository, create a basic authentication file and configure the Apache server to use it.
- Create a new password file:
sudo htpasswd -c /etc/svn-users myuser
Enter the password for the new user when prompted.
Edit the Subversion configuration file
/etc/httpd/conf.d/subversion.confusing your preferred text editor.
sudo vi /etc/httpd/conf.d/subversion.conf
- Add the following lines to the configuration file, replacing
<REPO_NAME>with the name of your repository:
<Location /svn/<REPO_NAME>>
DAV svn
SVNParentPath /opt/svn
AuthType Basic
AuthName "Subversion Repositories"
AuthUserFile /etc/svn-users
Require valid-user
</Location>
Save and close the configuration file.
Restart the Apache server to apply the changes:
sudo systemctl restart httpd
Step 6: Access the Subversion Repository
To access the Subversion repository from a client machine, you need to use an SVN client program. Run the following command on the client machine:
svn co http://<SERVER_IP>/svn/<REPO_NAME>
Replace <SERVER_IP> with the IP address or hostname of the Fedora server and <REPO_NAME> with the name of the repository.
Enter the SVN user credentials when prompted, and the client machine will download a local copy of the repository.
Congratulations! You have successfully installed Subversion and created a new repository on your Fedora server.