project A DOS® Server In a Virtual Machine

An SVN Install Over Apache On Debian, Ubuntu

When we speak of a software development process made by a team, we've got to find a workaround for being able to have access to a shared resource. For example, we use FTP. FTP is handy, but who'll show what's happened to the resource? What was changed? That is why people use version control systems (VCS).
Apache Subversion (often abbreviated "SVN") is one of them. In my opinion, it is the best despite someone's standpoint towards CVS, Git and Bazaar.
Let's dwell on Subversion.
Here we go.
To install and to configure Subversion is being our task for now.

Decision: Subversion + Apache + Debian/Ubuntu

For a start, ensure that Apache was installed. Herein, I'm not going to tell how to do it. We need Apache since Subversion is its module.
First, install Subversion as follows,

sudo apt-get install subversion libapache2-svn

Next, we should choose a directory where our repository will be. It may be random, but I do not recommend you to specify it as /dev/null. =)
Also, let's create our first project.

sudo svnadmin create /opt/svn/repos/myproject

Replace the /opt/svn/repos's access rights with www-data, so Apache could have access to this directory.

sudo chown -R www-data: /opt/svn/repos

After that, we should change the /etc/apache2/mods-available/dav_svn.conf file as follows,

<Location /svn>
DAV svn
SVNParentPath /opt/svn/repos/
AuthType Basic
AuthName "My Repository"
AuthUserFile /opt/svn/passwd
Require valid-user

Create the administrator (put down anything you want instead of "admin"):

sudo htpasswd -c /opt/svn/passwd admin

Now, you may generate your friends' accounts (practically, it's the same but without the -c):

sudo htpasswd /opt/svn/passwd user

Activate the modules then:

sudo a2enmod dav dav_fs dav_svn

Restart Apache at the end of this:

sudo /etc/init.d/apache2 force-reload


Try to access the SVN by typing http://localhost/svn/myproject on your SVN server. Your host and port may vary. They depend on the server's settings.

This article was translated in English by Artem V. Efremov. The original Russian source was written by © Alex Snet and is available from on the Internet.
Me, I don't encroach on the author's copyright.

See also: