I am trying to setup a testing server for web development. I have never done this before nor have I ever used svn before.

When I go to http://linux-server/ from any computer on my network it takes me to the /var/www path my linux machine.

I am using svn to backup everything inside /var/www

currently my svn repository is located at /usr/local/svn/svn_repo

if I run:

$ svn list -v -R file:///usr/local/svn/svn_repo

it outputs:

 11 root                  Jun 17 17:03 ./
  1 root                  May 25 14:05 branches/
  1 root                  May 25 14:05 tags/
 11 root                  Jun 17 17:03 trunk/
 11 root                  Jun 17 17:03 trunk/www/
 11 root             2525 Jun 17 17:03 trunk/www/index.php
  4 root                  May 25 16:48 trunk/www/test/
  4 root              105 May 25 16:48 trunk/www/test/index.php

Where trunk/www/ is the same as /var/www on the system.

But I want to be able to access my repository from another machine on the network. Something like http://linux-server/svn

Maybe I am thinking about this wrong but it seems to me like in order to do that, I would need to move the repository to /var/www/svn/ directory. But then wouldn't the repository be backing up itself? or is it OK as long as I never call:

svn add /var/www/svn

I am a little confused.

  • 1
    Putting variable data anywhere under /usr is a bad habit. Better not get used to it. Just my 2 (Euro-)cents... Jun 28, 2010 at 21:19

2 Answers 2


No, you're right that you shouldn't have the repository inside its own working copy. What you can do is use an Alias directive (if you're using Apache) to map the directory /usr/local/svn/svn_repo to the URL path /svn.

Alias /svn/ /usr/local/svn/svn_repo/

This way when you direct your browser to http://linux-server/svn, Apache will show you the contents of /usr/local/svn/svn_repo, but that directory won't actually be inside /var/www. You will also need to enable Apache to serve files from that directory, so put this in your Apache configuration file:

<Directory /usr/local/svn/svn_repo>
    Order allow,deny
    Allow from all
    Options +Indexes

Note that you should also configure Apache with WebDAV so that you can access the repository over HTTP (otherwise Apache will show you the raw contents of the repository files, which won't be particularly easy on the eyes).

  • thank you. Yes I am using apache2. How do I setup the Alias? I tried calling that from a cmd prompt but did not work
    – JD Isaacks
    Jun 28, 2010 at 20:21
  • OK I added the line above to my /etc/apache2/httpd.conf file (which was completely empty before hand). Now if I go to http://linux-server/svn/ I get page not found, is this because I don't have webDAV or is something else wrong?
    – JD Isaacks
    Jun 28, 2010 at 20:26
  • @John: No, even without webDAV, you should be seeing something, not a "page not found" error. Make sure you restart (or reload) Apache after you change its configuration file. If that doesn't help, make sure the directory /usr/local/svn/svn_repo exists and that there are files in it. Also, see my edit to my answer.
    – David Z
    Jun 28, 2010 at 20:53
  • Yes I had to restart apache. Also since I am on ubuntu I had to put the code you posted inside apache2.conf instead of httpd.conf Thanks.
    – JD Isaacks
    Jun 29, 2010 at 13:14

Stuffing the svn repo in /usr/local/svn sounds fine.

Then you need to configure your web server to access those files, as described here: http://svnbook.red-bean.com/en/1.0/ch06s04.html

However, if you've really never used svn before, don't start now. Shoot for Git instead. It might take slightly longer to master, but it's better in every way. After 6 months with Git, I cringe at the thought of working with Subversion again.

  • Thanks for the info. I have actually never used any version control before, nor do I have access to anyone who can "show me the ropes". Up until not too long ago I wasn't even aware of it, so I am trying to just get something up and running. I am having a hard enough time with svn as it is, so don't really want to ditch it for something even harder to learn. Not that I wouldn't be interested in learning Git.
    – JD Isaacks
    Jun 28, 2010 at 20:31
  • @John: I don't think git is that much harder. It has a lot more fancy features than SVN, but if you're using it for just basic version control, it's not that bad. There are also alternatives you might consider (Mercurial, Bazaar, etc.) which are similar to git but generally considered to be a little simpler; they might be a good way to get used to the idea of distributed version control. I'd second the recommendation to check those out - if not now, at some point in the future.
    – David Z
    Jun 28, 2010 at 20:53
  • After using SVN for so long, I switched over to git and liked it much better. I still have a long way to go, but this document helps greatly: Getting Started with Git by Matthew McCullough. Google for it and you will find it.
    – Hai Vu
    Jun 28, 2010 at 20:59
  • 1
    As David says, git isn't that much harder, but has a lot of possibilities if you want to get advanced. As your local working directory in git is a full-fleshed repository in it's own (which is a huge boon compared to svn), you'll need 2-3 additional commands to synchronize with a remote repository, but you make that up again by not wasting time on certain svn idiosyncrasies.
    – eevar
    Jun 28, 2010 at 21:19
  • 1
    I googled some quick links for you, there might be better resources out there, but these were the first i came across: The official git manual: kernel.org/pub/software/scm/git/docs/user-manual.html And gitcasts: gitcasts.com
    – eevar
    Jun 28, 2010 at 21:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .