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

Re: web_dav/Apache/Subversion

From: Edmund Horner <edmund_at_chrysophylax.cjb.net>
Date: 2003-12-12 02:36:31 CET

John Peacock wrote:

> It would be sweet if I could simply commit a change to the repository
> and have the file immediately available to the [test] web server. This
> is slightly different from enabling repository browsing within Apache.
> I'd like Apache to just serve up the files directly out of Subversion,
> as if this were an ordinary filesystem.

I think the best way to do this is write a little script (in
PHP/Python/Perl/Apache module/whatever) that takes the request and maps
it onto a repository resource.

Otherwise you might have difficulty getting index.html to be used for
directories, and so on.

PHP example (/htdocs/repos.php)

     /* This script is totally experimental: I typed it directly
        into this e-mail message without testing.
        You need somehow to get this to run for every request, e.g.:
        ErrorDocument 404 /repos.php

     //TODO: some other checking of arguments?
     //TODO: if a directory doesn't contain index.html, you'll get a
     // 404 error.

     /* name is the URI requested. */
     $name = $_SERVER['REQUEST_URI'];

     /* if a directory is asked for, append 'index.html' (if a directory
        with the trailing slash is asked for, mod_dav_svn should give a
        response redirecting to the directory with a slash appended. */
     if (ereg('/^, $name))
         $name = $name . 'index.html';

     /* internally redirect to mod_dav_svn. */
     virtual ('/repos' . $name);

     //TODO: return value?

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Dec 12 02:37:18 2003

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

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