Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Subversion With Apache Web Server: Tips

DZone's Guide to

Subversion With Apache Web Server: Tips

Want to learn how to connect the repositories you've made? Read on to learn how to use Apache Subversion to connect your repositories using simple SSH commands.

· Web Dev Zone ·
Free Resource

Bugsnag monitors application stability, so you can make data-driven decisions on whether you should be building new features, or fixing bugs. Learn more.

Apache Subversion is an open-source version control system and distributed as free software under the Apache License. It is often abbreviated as SVN. Subversion offers many ways to connect to your repositories. One of the popular ways to connect to subversion repositories is through the Apache web server.

There are plenty of resources out there for setting up subversion with the Apache web server for different operating systems.

In this article, let’s explore how to create a user, a repository, and how to control user permissions for the repositories. SSH commands will be used in this article for the explanation.

Creating Repository:

To create a new repository, use the following SSH command:

cd /path/to/repos && mkdir dummy-repository && svnadmin create./dummy-repository

Here, dummy-repository is the repository name. This command will create a new directory called dummy-repository under the repos folder.

Creating a New User:

In order to create a new user, enter the following SSH command:

htpasswd -s /path/to/.svn-auth-file john.doe

Once you have the above command, you will be asked to enter a password. Enter a password and you will be prompted to re-enter the password. After you have entered the password twice, the username john.doe will be added to .svn-auth-file.

Access Control:

Edit the /path/to/.svn-access-control file using a text editor and add the following (the name svn-access-control may vary depending on your setup):

[dummy-repository:/]

john.doe = rw

This configuration includes read-write access to dummy-repository and sub-folders such as the trunk, branch, and tags. The access can be controlled at a granular level. For example, you want to give only read access to a specific branch under dummy-repository. In that case, we can add something like this:

[dummy-repository:/branches/dummy-branch]

john.doe = r

By default, nobody will have any access to SVN repositories. You may want to provide at least read permissions to all the SVN users at the root of the repository. This can be done by using the asterisk (*), which means all users. Add the following configuration in your .svn-access-control file:

[/]

* = r

If you wish to explore further on the server setup and configuration, refer Subversion with Apache web server.

Monitor application stability with Bugsnag to decide if your engineering team should be building new features on your roadmap or fixing bugs to stabilize your application.Try it free.

Topics:
web dev ,apache web server ,repositories

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}