While the solar year ends in December and the U.S. fiscal year ends
in September, I've been used to consider the beginning of "my" new year in September, probably because of the
school and university calendars. As usual when a new year begins, I make to myself some declarations of intent for
things that I want to do, or do better, in the next year.
One of the new year's intents is to strive for simplicity. In my life, but also on my job, in particular for what
concerns technologies to use. The importance of simplicity in software design is well known since a lot of time
and has been somewhat formalized by the Agile Manifesto
as:
Simplicity--the art of maximizing the amount of work not done--is essential.
While I think most of us agree, we are often too lazy in implementing it.
Where to start from? I've started to rethink things in terms of simplicity for my websites (including this one).
In the Java world, what do you usually do to set up a website / webapp? Most frequent answer: Linux + Apache httpd
+ Java + Tomcat + CMS + SQL database. The SQL database usually asks for a good deal of libraries, such as
Hibernate or EclipseLink.
This is definitely too much for a simple website / webapp. That's why I've written a very simple Java-based CMS, named NorthernWind, which only uses the filesystem as a resource repository. No database, no Hibernate and dependencies. And in turn this means that a simpler web container is needed, thus I replaced Tomcat with Jetty (the simpler version, with even no JSP, JNDI and other stuff). And Jetty is configurable enough to be directly used without Apache httpd. To solve the "port dilemma" (running on port 80 without being forced to run the service as root) I've used this simple Linux configuration:
/sbin/iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
that tells the kernel to forward all requests to TCP port 80 to 8080. The whole setup runs on an "Ubuntu Minimal" distro to which I just added the OpenJDK, Jetty and Mercurial (which I use as the content repository for my CMS).