Tomcat and UNIX
The goal of this tutorial is not to give you an authoritative guide to all things related to Tomcat but rather to get you up and running with a great base foundation of knowledge regarding your stand-alone development or test server environment. When you have such a foundation, you can expand it into a full-blown enterprise environment, if you so desire.
Why should you use Tomcat instead of one of the alternatives, such as JBoss, Geronimo, or WebSphere Application Server Express?
Tomcat version 6 by itself is a lightweight solution. It does not come with all the Java Platform, Enterprise Edition (Java EE) features and additional packages found in JBoss, Geronimo, and IBM WebSphere® Application Server Express, but it also doesn't require much memory and runs fast even on smaller servers. Plus, it is available at no cost.
Tomcat is a JavaServer™ Pages (JSP)/servlet container that supports only basic Java application server features. It lacks the scalability and Java EE version 5 compliance, which is why it is only rarely used in production environments.
If you're looking to use your new server in an enterprise environment, the more obvious UNIX flavors are AIX and Solaris. In fact, Solaris has the highest percentage of enterprise market share. Other UNIX choices include FreeBSD and Mac OS X.
It is possible to run the examples in this tutorial on a Windows computer. The Apache community did the courteous thing after years of catering only to UNIX by developing for the Windows platform. However, depending on which statistics you're checking, Apache Web Server and subsequent products are used in more than 90% of Web server architectural solutions. Without getting into too much detail, UNIX offers the stability, security, and simplicity of a pure multi-user operating system that Windows Server® operating system just haven't matched.
That said, if you decide to use Windows, there are a few differences in Tomcat setup between UNIX and Windows that you should note before moving on:
- Extracting the initial installation files on a UNIX server will
gtar. A Windows Server machine typically uses WinZip or a similar utility.
- PATH setup is more overt on a UNIX server. Windows still uses pathing, but much of that is behind the scenes or automatic when installing software.
- Permissions considerations are more important in the UNIX setup and configuration. The great security strength of UNIX servers is also the single biggest cause for problems: permissions problems. When initially installing software, you need proper permissions to write that software into the base operating system's file systems—/var, /tmp, and so on. Furthermore, always be aware of permissions considerations when connecting various internal and external software components to your UNIX server. Always take IDs, groups, and proper access into consideration.
- In Windows, installation is graphical user interface (GUI) based, while UNIX traditionally uses the command-line interface (CLI). This is changing somewhat with the Gnome and other graphical environments, including the increasingly popular Mac OS X version 10.5 Leopard. However, purists will always swear by the CLI. Besides, it's the best way to learn.
- Windows uses .bat files for automated batch processes and .exe files for executables. UNIX uses .sh or .ksh extension files by default for executable scripts, and so on. The .sh or .ksh format depends on which shell you're using.
With numerous fixes included in every release, tweaks, new features, or new ways perform old tasks, it's sometimes difficult to decide which software version to go with. In Tomcat, you're faced with the same problem. I recommend looking at the details in Table 1 to match up your administrative server to the J2EE specification for which the application you're deploying was coded.
Table 1. JSP specs in relation to Tomcat versions
|JSP specification||Tomcat version|
Another not-so-technical way of deciding between software versions is to stick to using the latest stable version of the software you want to work with. Usually, you get all the latest security fixes and functionality.