Posts Tagged ‘Tomcat’

Using Stripes Action Beans as Welcome Pages

Monday, May 18th, 2009

So I wanted to use an action bean as my welcome page, I could have an index.html do a meta refresh to my Welcome.action but that’s a bit rubbish. So anyway, I had to map the StripesDispatcher directly to a url and include that url in my welcome file list, here is a snippet from my web.xml

<servlet-mapping>
        <servlet-name>StripesDispatcher</servlet-name>
        <url-pattern>/Index.action</url-pattern>
</servlet-mapping>
<welcome-file-list>
         <welcome-file>Index.action</welcome-file>
 </welcome-file-list>

Hope that’s useful to someone ! :)

Java Web Applications and Tomcat on low memory servers

Monday, May 4th, 2009

I was helping out a family member develop a easy to manage gallery and e-commerce site.  To keep costs down and as a bit of a challenge we opted to go for a server with only 128 meg of ram (only £9 a month with a 5 meg sync line). On this we would need to deploy a jvm, tomcat, mysql database, mail server and the usual list of system applications (ssh and so on). If you add on the requirements for some chunky JAI image resizing code things were going to be tight.

The normal setup (debian) would be apache 2 serving on port 80 connected (mod_jk) to tomcat running on the Sun JVM. We would have open ssh  for remote access, mysql as the database and postfix as the mail server.  This doesnt work out of the box, the server was using swap space straight away. Java doesnt work out of swap space.

The first thing to go was the apache webserver, I just told tomcat to listen on port 80. Next we needed to tune the out of the box settings for mysql server, these two lines will save you a reasonable about of ram:

skip-bdb
skip-innodb

(more…)