I got all my websites checked into Subversion (SVN), and usually scp them from my desktop to the webserver. But sometimes I edit the pages directly on the server.
So to keep changes from being lost, I decided to just have a checked out version of the page (svn) on the server as well.. To keep things in sync
But for some reason I don’t want people to snoop in my .svn directory. I googled but did not find any immediate solution, so here it is, a quick fix for anyone who might have the same “problem”.
Hide .svn directory in resin webserver
(also works for cvs or anything else you don’t want resin to give those greedy users)
just add a rewrite rule for the host in the resin configuration file (resin.conf), this prevents the webserver from letting anyone into the directory (or viewing svn/cvs files).
Here is my config file:
<host id="www.trekwar.org" root-directory=".">
<host-alias>trekwar.org</host-alias>
<web-app id="/">
<document-directory>webapps/trekwar.org</document-directory>
</web-app>
<rewrite-dispatch>
<redirect regexp="\.svn" target="index.jsp?msg=keep+away+from+my+svn+directory"/>
</rewrite-dispatch>
</host>

