Using Personal Tomcat in DoC

A Little Tomcat History

For several years, we attempted to build and maintain shared Tomcat servers, which many users could use to develop JSP and servlet webapps in parallel. However, they were always unreliable, and we have concluded that Tomcat's fundamental design is not suited to the teaching environment, where many users rapidly create contexts, update web content, break things etc.

We have recently decommissioned the last remaining shared Tomcat web server (www-jsp.doc.ic.ac.uk), and we will not be replacing it.

Personal Tomcat at DoC

Instead, therefore, we have provided (and strongly recommend) something we call Personal Tomcat: every summer, we download the latest binary version of Apache Tomcat (currently version 7.0.29 as of Oct 2012), package it and install it on every DoC linux lab machine. However, we do not arrange for Tomcat to have any configuration, and we certainly don't arrange for it to start automatically. That's something you need to do - hence, it's a private and personal Tomcat system for you to experiment with.

mktomcat8 ~/example-context

      tomcat8 start

      http://localhost:59999/index.jsp

      tomcat stop

How to do I find out what's Wrong?

When things don't work with Personal Tomcat, as with all versions of Tomcat, you'll see an incomprehensable Java stacktrace as the web page result. Tomcat also writes useful debugging information into various files in the logs subdirectory - Tomcat logs are famed for their beauty and helpfulness [sarcasm], but they're all you've got!

As the Tomcat configuration is under your control, another debugging approach Tomcat experts may be able to use is to modify the config to make Tomcat start in some kind of debugging mode.

Note: we have recently noticed that choosing a contact directory name containing spaces causes the tomcat8 script to fail to start. Filenames with spaces in them are just wrong in any universe, so just don't do it!

Recap: How to Setup a Personal Tomcat Context Directory

To recap, here's the procedure to create a new Context directory called my-context for us to work in:

More Detailed JSP and Servlet Examples

For some more information on JSP and Servlets, see the following documents:

Authenticated access to JSP and Servlets

guides/java/servlets/personaltomcat (last edited 2014-08-05 06:30:13 by ldk)