Re: SVN files content Type
From: Ryan Schmidt <subversion-2011a_at_ryandesign.com>
Date: Mon, 16 May 2011 01:44:18 -0500
On May 16, 2011, at 00:42, D, Dinoj wrote:
> Hi Daniel/Ryan
That's correct.
> Here my requirement
There's no way to configure Subversion to do that.
As I already suggested, consider having a server-side post-commit hook that updates a server-side working copy of a relevant part of your repository, and point your apache at that working copy. Then, when users want to access this site, instruct users to use that other URL, not the repository URL.
As a concrete example:
Consider you have an HTML page in a project in a repository accessible here:
http://www.example.com/svn/project1/trunk/folder/index.html
You haven't been using svn:mime-type, so users who view this URL in a web browser will see the source of the document, instead of the page rendered as HTML which is what you want.
Imagine your repository is on the server at /var/svn, and that you have a document root at /var/www used for everything at http://www.example.com/ other than the /svn directory, like this:
<VirtualHost *:80>
So, check out a working copy of this project's trunk somewhere inside the document root:
mkdir -p /var/www/test
Now you can access that same HTML file from above at:
http://www.example.com/test/project1/folder/index.html
And now it will use the MIME types from the Apache configuration.
Now, you install a post-commit hook script in the repository which basically does:
svn up /var/www/test/*
This way, every time anyone commits anything to the repository, the test directories will be updated as well.
Updating "*" will be slow, so you can optimize this further if you like to just update the thing that was just committed.
|
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.