You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Paul Koning <pk...@equallogic.com> on 2005/09/27 15:55:56 UTC

Repository website content as live website

This is probably simple but I'm getting lost...

One of the parts of my Subversion repository is a subtree that holds
our internal website content.  So of course the latest content is
visible via a path that looks like
	http://snv.ourstuff.com/repos/oursvn/trunk/intranet/index.html

We already have a virtual host setup, so people are used to
	http://ourintranet.com/

to get to that same material.  Right now it's done in CVS, and the
"live" site is actually a copy (working directory), checked out
manually or periodically, so it isn't convenient and "live".

I would like to have http://ourintranet.com/ end up at the repository,
i.e., it's an alias for
http://snv.ourstuff.com/repos/oursvn/trunk/intranet/.  How would I do
that?  Rewrite rules?  Alias?

Apologies if this is too far off topic, but it seems to fit since it's
an obvious use case of Subversion.

   paul



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Repository website content as live website

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Sep 27, 2005, at 19:02, Paul Koning wrote:

>  Ryan> RewriteRule rewrites from URLs to URLs, so that's closer,
>  Ryan> except that when crossing hostname boundaries, as you are, it
>  Ryan> actually has to issue a Location header to redirect the
>  Ryan> client. Someone would type in http://ourintranet.com/,
>  Ryan> mod_rewrite would issue a redirect, and the browser's address
>  Ryan> bar would now show http://snv.ourstuff.com/repos/
>  Ryan> oursvn/trunk/intranet/ which is probably not what you want.
>
> A thought comes to mind.  I assume I can have more one <Location>
> element in the Apache conf, pointing to the *same* repository.   Given
> that, I can put one into the virtual host section for the intranet
> hostname, and use Rewrite to map top level names to that lower level
> URL within the same virtual host.  I would include access controls to
> make this view read-only (not that it really matters I think).

Yes, as long as you've been dilligent in informing Subversion about  
the MIME types of your files, and as long as it's all static content,  
that should work. We have not told Subversion about our files' MIME  
types, and our sites are all PHP-based, so it would not have worked  
for us.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Repository website content as live website

Posted by Paul Koning <pk...@equallogic.com>.
>>>>> "Ryan" == Ryan Schmidt <su...@ryandesign.com> writes:

 Ryan> On Sep 27, 2005, at 17:55, Paul Koning wrote:
 >> One of the parts of my Subversion repository is a subtree that
 >> holds our internal website content.  So of course the latest
 >> content is visible via a path that looks like
 >> http://snv.ourstuff.com/repos/oursvn/trunk/intranet/index.html
 >> 
 >> We already have a virtual host setup, so people are used to
 >> http://ourintranet.com/
 >> 
 >> to get to that same material.  Right now it's done in CVS, and the
 >> "live" site is actually a copy (working directory), checked out
 >> manually or periodically, so it isn't convenient and "live".
 >> 
 >> I would like to have http://ourintranet.com/ end up at the
 >> repository, i.e., it's an alias for
 >> http://snv.ourstuff.com/repos/oursvn/trunk/intranet/.  How would I
 >> do that?  Rewrite rules?  Alias?

 Ryan> RewriteRule rewrites from URLs to URLs, so that's closer,
 Ryan> except that when crossing hostname boundaries, as you are, it
 Ryan> actually has to issue a Location header to redirect the
 Ryan> client. Someone would type in http://ourintranet.com/,
 Ryan> mod_rewrite would issue a redirect, and the browser's address
 Ryan> bar would now show http://snv.ourstuff.com/repos/
 Ryan> oursvn/trunk/intranet/ which is probably not what you want.

Right, I'm trying to make this invisible.

A thought comes to mind.  I assume I can have more one <Location>
element in the Apache conf, pointing to the *same* repository.   Given
that, I can put one into the virtual host section for the intranet
hostname, and use Rewrite to map top level names to that lower level
URL within the same virtual host.  I would include access controls to
make this view read-only (not that it really matters I think).

     paul


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Repository website content as live website

Posted by Ryan Schmidt <su...@ryandesign.com>.
> On Sep 27, 2005, at 17:55, Paul Koning wrote:
>
>> I would like to have http://ourintranet.com/ end up at the  
>> repository,
>> i.e., it's an alias for
>> http://snv.ourstuff.com/repos/oursvn/trunk/intranet/.  How would I do
>> that?  Rewrite rules?  Alias?

I almost forgot: Something we recently tried for this purpose was to  
make use of Subversion's WebDAV abilities. We mounted the repository  
in as a read-only WebDAV mount point on the server, then made  
Apache's DocumentRoot point at that. The performance ended up being  
very bad, crossing into ridiculous for directory listings, so we had  
to shut it off. So, to save you some trouble, I don't recommend  
trying that.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Repository website content as live website

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Sep 27, 2005, at 17:55, Paul Koning wrote:

> One of the parts of my Subversion repository is a subtree that holds
> our internal website content.  So of course the latest content is
> visible via a path that looks like
>     http://snv.ourstuff.com/repos/oursvn/trunk/intranet/index.html
>
> We already have a virtual host setup, so people are used to
>     http://ourintranet.com/
>
> to get to that same material.  Right now it's done in CVS, and the
> "live" site is actually a copy (working directory), checked out
> manually or periodically, so it isn't convenient and "live".
>
> I would like to have http://ourintranet.com/ end up at the repository,
> i.e., it's an alias for
> http://snv.ourstuff.com/repos/oursvn/trunk/intranet/.  How would I do
> that?  Rewrite rules?  Alias?

Apache's Alias directive aliases a path in web space to a path in  
filesystem space. That won't work, since the HTML files you're  
wanting to map in aren't in the filesystem; they're in the repository.

RewriteRule rewrites from URLs to URLs, so that's closer, except that  
when crossing hostname boundaries, as you are, it actually has to  
issue a Location header to redirect the client. Someone would type in  
http://ourintranet.com/, mod_rewrite would issue a redirect, and the  
browser's address bar would now show http://snv.ourstuff.com/repos/ 
oursvn/trunk/intranet/ which is probably not what you want.

If that is what you want, Apache's Redirect command is a simpler  
alternative to mod_rewrite.

What you probably want though is to continue to use a working copy of  
trunk/intranet and have ourintranet.com's DocumentRoot pointing at  
that. This would further enable you to use PHP, Perl, Ruby, Python or  
other dynamic content in your site, which you would not be able to do  
otherwise. You can write a post-commit hook that updates this working  
copy every time someone commits, thereby ensuring that it's always up- 
to-date.

This is a FAQ:

http://subversion.tigris.org/faq.html#website-auto-update



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org