Wednesday, September 19, 2007

Lab 1 Postmortem

As you all know, I took a different approach:

1) Java instead of Python
2) Apache Velocity for the Templating Engine
3) Tomcat for my HTTP & Servlet Server

Why Java?
1) My current employer is promoting Java as the language to learn.
2) I hope to qualify for a spot on the TurboTax Online development team. They use Java, JBoss and JavaScript. They are now porting the application layer to Flex.
3) Java has very mature IDEs (Eclipse and NetBeans) which integrate will with Tomcat and help developers write code quickly.
4) My time is limited due to employment and family commitments so I need to hit the ground running. I feel very comfortable with this technology (knock on wood).

Why Velocity?
1) Comes out of the box running
2) Easy to use
3) GREAT tools
4) Very active open source project
5) Slicker than snot

Why Tomcat?
1) Apache can't work with servlets
2) Easy to configure and run
3) Works well with Java, Velocity and Eclipse

Here is what I did:
1) Install Java. I basically followed the instructions on this link:

http://stanton-finley.net/fedora_core_4_installation_notes.html#Java

2) Install a non-Yum version of Tomcat 5.5.2.5. The following link shows the complexity of the directory structure for a Yum installation:

http://www.mksearch.mkdoc.org/documentation/tomcat-on-fc4/

I chose to download and install a custom version in /opt/tomcat5.5. In this way, I can control the locations of the directories and config files.

I then changed the listening port from 8080 to 80 as per the class requirements. This can be done in config/server.xml.

3) Remove HTTPD from chkconfig. Since I am using Tomcat as my HTTP server, I don't need Apache. There are drawbacks to this, but for this class, it should be fine. The command is:

chkconfig --del httpd

4) Create a Tomcat service. In /etc/init.d, I created a startup script called tomcat5.5. Then I set this to be run at startup by "chkconfig --add tomcat5.5" followed by "chkconfig tomcat5.5 on."

5) The last step was to create a Tomcat Project using Eclipse and to modify the Web.xml file for VelocityViewServlet. I won't go into details here since this is not a programming class.

Troubles:
1) It has been a few years since I last used Velocity. It took a while to set it up again.
2) The registration/deregistration with the loadbalancer gave me the most grief. There wasn't enough info to get it working on the first try. It was only by reading all your hints that I was able to get this working.

Conclusion:
All in all, things went smoothly. It's always hard to lay the foundation since that usually requires the steepest learning curve. There were holes in the info, but working with someone else in the class really helped. The lab instructions and notes were a bit scattered and incomplete. This was a plus and a minus: plus in that it forced me to work and minus BECAUSE it forced me to work! ;-)

No comments: