[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Make part of repository visible via Apache?

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-12-05 01:19:39 CET

On Dec 4, 2007, at 13:03, John Aldridge wrote:

> We run Apache as a web server for internal company material. One of
> the things it serves is a URL
>
> http://www/Documents
>
> which is currently an ordinary folder in the Apache DocumentRoot
> folder whose contents (mostly html files) are populated by checking
> out the "trunk/Documents" subtree of our repository.
>
> This has two disadvantages:
>
> a) Anyone who updates a document needs to remember to do an "svn
> update" in order to make the updated document visible, and

Write a post-commit hook which automatically runs "svn update" on
this directory after every commit.

> b) It's a waste of disk (& backup tape) space.

Disk space is cheap.

Don't back up this directory.

> I wondered whether mod_dav_svn could be used to solve both of these
> problems by having Apache serve a direct view onto the repository,
> so I loaded the mod_dav and mod_dav_svn modules and added
>
> <Location /Documents>
> DAV svn
> SVNPath d:/svn-repos
> </Location>
>
> to the Apache config file. This worked, kind of, but has a number
> of problems which make it less than ideal
>
> a) I can't find a way of making the URL http://www/Documents show
> the contents of just "/trunk/Documents", rather than the repository
> root folder. This will break any existing links on other pages. The
> nearest I have to a solution is to serve the entire repository as /
> svn and add a
>
> Redirect /Documents http://www/svn/trunk/Documents
>
> directive. This isn't ideal, though, as I'd rather preserve the
> myth that these documents really do live in /Documents.

Only an entire repository can be served. You can't serve just a subset.

> b) I have no wish to allow write access to the repository via
> Apache (that's done by a service running svnserve). Is there a
> simple way of configuring mod_dav_svn to be readonly, short of
> configuring authentication and access control options.

Not sure. Well, you could write a start-commit hook which simply
denies all commits. But you'd presumably have to engineer it so that
it only does this if it's apache trying to do the commit, since you'd
still want commits from svnserve. Not sure how to detect which
process is doing the committing.

> c) $Revision$ and $Date$ keywords are not expanded in the displayed
> documents. Not a critical deficiency, but a pity.

Correct. Keyword expansion only happens in the client. mod_dav_svn is
a server, not a client, so it does not expand keywords.

> I'd welcome any hints for solving these problems, or suggestions
> for a better way to solve the underlying problem.

Go with the way you have it now, serving a working copy.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Dec 5 01:20:07 2007

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.