Posts Tagged ‘resin’

hiding svn directory in resin

Thursday, February 12th, 2009

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>

Bye bye tomcat

Tuesday, April 8th, 2008

I’ve been using tomcat for quite a couple of years now..

But when making working on a registration page for a “ferret show“, I got so goddamn fed up with two things:

1) Each time I recompiled some of the background Java stuff (beans + database manager) I had to restart the server after recompiling

2) OFTEN after recompiling, for no frakking reason whatsoever. Tomcat would bitch about being unable to find the postgresql driver, even though it was in the common/lib as well as the webapps lib directory..

The second issue would sometimes take 5-10 minutes of removing the file, moving it back, restarting the server, removing work/tmp dirs, before it suddenly and miraculously worked again.. So I finally had it, and downloaded Resin and had it up and running in a few minutes.. Copied over the webapps, and now everything works nicely, and I never have to restart the webserver.

I’ve had some experience with Resin from my previous workplace, using the java php implementation and the JMS system. And Resin seems to be pretty nice, and switching from Tomcat to Resin only took a few minutes.. Did not tweak the config much and set up SSH, that will have to wait for the weekend :)