“The Apache Subversion, abbreviated as SVN, is an open-source version control system released by Apache and is used by developers for tracking code changes across projects. Besides, SVN documents and organizes the project changes, and it can work across the network, especially since it supports different protocols, such as HTTPS, HTTP, and SVN.
Today’s guide covers how to install SVN on Ubuntu systems in a step-by-step manner.”
Understanding Apache Subversion
The SVN is a great tool for developers working on the same codebase as it helps track changes. Therefore, it works as a version control system and works well to version control different directories and files.
The SVN comprises two components. The first is the server which stores the repository for the subversion. At the same time, the other is the client, which is the application used in organizing updates contained in the subversion server.
Installing Apache Subversion
The Apache Subversion can be installed from the command line, but first, you must have Apache installed. The steps below will guide you throughout.
1. Install Apache2
You probably have Apache installed already. If not, update your system and then use the command below to install Apache. If not, update your system and then use the commands below to install Apache.
$ sudo apt-get install apache2
To check the Apache status, use the following command.
If Apache is not running, you need to start it.
Apache is not enabled at boot up. However, if you wish to enable it every time you boot up your system, the command below does the magic.
Also, you can confirm that Apache is up and running by typing your local host IP address on the browser. It should return the Apache welcome page, like in the image below.
2. Install Apache Subversion
Run the command below to install Apache Subversion and all its necessary dependencies.
When prompted, like in the image below, choose the default selected option, Internet Site
Also, you will need to enter the system mail name.
Once installed, run the commands below to enable the Apache modules required to run SVN.
$ sudo a2enmod dav_svn
Then, restart Apache2
3. Apache Subversion Configuration
The configuration file for SVN needs to be edited to configure Apache with SVN.
Open it with an editor of choice and uncomment the lines below.
SVNParentPath /var/www/svn
AuthType Basic
AuthName “Subversion Repository”
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
Once you’ve made the changes, save and close the file.
The next thing is to create repositories. Start by creating a directory for the SVN. In this case, we will use the /opt directory.
Create a repository for it, and you can name it as you wish. In our case, we will name it “linuxhint.”
Also, you must change the file permissions and ownership for the SVN directory and repository using the commands below.
To change the ownership for the SVN repository:
To change the permissions:
4. Create SVN Users
The first user we will create is the admin, and to create the user, we need a password file stored in the /etc directory.
Replace the username appropriately.
If you need more users, for instance, to create a new user admin2, the command will be:
The configuration is complete. Restart Apache, then proceed to test Apache Subversion.
Open your browser and use the URL syntax below for testing.
In our case, it will be:
Bingo! You’ve successfully installed and used Apache Subversion on Ubuntu.
Conclusion
This guide covered installing Apache Subversion, starting with installing Apache2 to the installation and configuration of SVN. Hopefully, your installation was successful, and you can extend the tutorial to configure and manage your projects. All the best!