If I understand your question correctly, you want to create a single authorization-enable repository, check it out to multiple locations, and work with it from any of those locations. This is pretty straightforward, and you should have no issues once you get your setup completed.
I think the following recommendations would ensure that you can do what you want, assuming that I am interpreting your question correctly.
1) Your Apache Location
configuration should be as follows:
<Location /svn>
DAV svn
SVNPath /opt/svn
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
</Location>
This will allow you to access your multiple check-out points without conflict with your repository. Like anything else on your web server, the URLs cannot conflict, so you shouldn't make the repository root the same as the web server root (/
).
Also, I changed your SVNPath
value - this is supposed to be the directory where your repositories live, not the path to one of the repositories itself.
2) Create the appropriate structures. Your svnadmin create
is correct. However, to ensure flexibility in future development, you need to create the trunk
, branches
, and tags
directories under a project directory using svn --parents mkdir
. Your resulting repository (accessed at the URL http://server/svn/project.com/
) should have something like the following structure:
projectName
branches
tags
trunk
The trunk
is where you do all your work. The branches
tree is for forking or parallel development, and the tags
tree is for static snapshots of your code. You really only need trunk
, as that's the one you'll be checking out in your example.
3) Only Subversion modifies the /opt/svn/project.com
tree to add/modify content. Because of that, you can only commit on a checkout, not the way you indicated.
If you have a file system with your intended content, you can either:
Check out the trunk and add your content under that:
svn co http://server/svn/project.com/projectName/trunk/ /var/www/test1.project.com
cp /var/www/project.com/foo /var/www/test1.project.com
svn add /var/www/test1.project.com/foo
svn ci /var/www/test1.project.com
Or import into the repository:
svn import /var/www/project.com http://server/svn/project.com/projectName/trunk
4) To get multiple working copies, just check out the trunk
(or an appropriate subdirectory) to each of your specified locations. Then any modifications committed in one checkout can be retrieved as you indicated using svn up
.