Apache Tomcat is probably the best J2EE server to use for learning and as a testbed. It is small, fast, robust and most importantly easy to manage. I have used Tomcat since the 3.0 days and thought I would share a few things as a set of How-Tos/Tutorials/Notes.
Tomcat has now matured and moved out of the Jakarta umbrella. It has it’s own project web site at http://tomcat.apache.org. At this writing the last milestone release of the Tomcat 5.5.x series is 5.5.16. We will use this version as our base for this discussion.
Downloading & Installation:
The first thing to do is to download Tomcat. Tomcat binaries come in a number of packaging flavors The Windows Installer package is the most convenient You will find the download page links on the Tomcat home page. You will also need the 1.5 JDK from Sun.
To install Tomcat, execute the downloaded file. I suggest you pick the Full option in the Choose Components installer screen. This will dump everything, including examples and sample web applications.
Figure 1. Tomcat Installation – Choose Components
The installer will now prompt you for the disk location. I suggest you select something simpler than the default (C:\Program Files\Apache Software Foundation\Tomcat 5.5). D:\Tomcat5.5 will do just fine and will be easier to handle latter when we write ANT scripts to manage Tomcat and deploy web apps into it.
Figure 2. Tomcat Installation – Choose Install Location
On the next screen you need to provide some configuration information. Note that these are important. You should make a note of what you enter here. However, do note that all of these can be changed later by modifying the Tomcat configuration files.
Figure 3. Tomcat Installation – Configuration
The last step before the installation starts is to specify the JDK Tomcat will use. NOTE: It is very important that you specify a JDK installation and NOT a JRE installation in this step. Tomcat will not work with a JRE. It needs access to the compilation and other tools that are available only in the JDK. Most probably the installer will pick your JRE installation. Remember to change it to your JDK installation. Also note that you will need JDK 1.5.
Figure 4. Tomcat Installation – JVM Selection
Now you are ready to complete the installation. Click the Install button to start.
During the installation, the Tomcat Windows Service will be installed. We will come back to that in a little while. After the installation you will get the following top level forder structure.
Figure 5. Tomcat 5.5 Folder Structure.
This structure looks similar to the Tomcat 4.x structure but there are many differences deeper down. A lot of things have been simplified.
Note that you will have to keep stopping and restarting your Tomcat server many times during the day. This means the Tomcat Windows Service is more of a pain than help. I suggest you change the service setting to Manual from the default Automatic Startup Type.
Figure 6. Tomcat Windows Service Properties
Tomcat 5.5 has another neat feature. A Tray server monitor program!
Figure 7. Tomcat Monitor Tray Icon
Figure 8. Tomcat Monitor Popup Menu
You can control the Tomcat service from the Configure menu item. This brings up the Apache Tomcat Propertes Screen in which you can control a whole host of stuff like the service startup type, Log level & folder, the JVM, classpath & Java command line options, startup & shutdown settings.
Figure 9. Tomcat Configuration Screen
As you can see, changing the startup type to Manual actually helps us. We have this nifty little server monitor program that runs in the tray. As a result starting & stopping the server is a snap!
Running for the First Time:
Now it is time to fire up Tomcat for the first time. Use the Tomcat Monitor to start the server instance. Then use your favorite browser (Firefox of course!) and point it to http://localhost:9000/.Change the port to whatever you spcified above. You should see the page in the screen shot below:
Figure 10. Tomcat Default Page
Congratulations! You now have a working Tomcat 5.5 installation!
Play around with the various examples etc. We will cover Tomcat Server Configuration, Administration and Management next.
NEXT : Tomcat Configuration (Server.xml, Contexts & Logging)
Very helpful guide, thanks рџ™‚
Comment by JonnyR — January 12, 2007 @ 12:43 am
thank for sharing..
i have learn a lot of from here…
Comment by weeyang — October 25, 2007 @ 12:44 pm
Thanks a lot for such a simple tutorial.OR may be you made it look simple.
рџ™‚
Comment by Anirudha — February 20, 2008 @ 9:46 pm
Thanks a lot for such a simple tutorial.OR may be you made it look simple.
Comment by Mallimdon — May 20, 2008 @ 11:26 am
This site came up in a google search and the first thing i saw was ‘tomcat is the best j2ee server’.
It’s not a j2ee server, it’s a servlet/jsp container
Comment by me — July 10, 2008 @ 4:41 am
very much use full please add more and more /…thanks
Comment by kalyan — August 10, 2008 @ 12:08 am
Wow!! u r d man – U made it look so simple
Thanks a ton рџ™‚
Comment by Raghu — August 26, 2008 @ 4:46 am
Hey thanks a lot man . U really made it easy .
Comment by Ron — September 14, 2008 @ 12:44 pm
This information was very useful. Made the install simple.
Thanks.
Comment by Nigel — November 4, 2008 @ 4:36 pm
hi,
i have a requirement to install apache as service in manual startup type mode.
can u please tell me how to do this while installing apache as service manually?
Comment by freak — November 18, 2008 @ 12:44 pm
it is really very useful.
thanks
Comment by Gouri prasasd — December 1, 2008 @ 6:06 pm
винницкое порно секси лия радио next секс беременность ранние сроки фото секс дивы янины в санкт-петербурге порно каналы tv
Comment by elexx-lh — February 5, 2009 @ 3:30 am
Thank u very very very much sir…
Comment by PRASUN — April 9, 2009 @ 5:50 pm
thanks a lot
it very heplful
Comment by joshi — July 21, 2009 @ 8:19 pm
Where can I find the next part “Tomcat Configuration (Server.xml, Contexts & Logging)”.
This is very useful, thanks a lot!
Comment by Jeroen-Pieter — February 18, 2010 @ 6:02 pm
thanks sir
Comment by amine — December 5, 2010 @ 8:15 pm
thank u very very much sir.
It is very help ful to me and i can say it is the best way to install tomcat server
Comment by mohan — May 14, 2011 @ 5:31 pm
Iklan baris
HOW-TO : Installing Apache Tomcat 5.5 | \”The Entity Bean is on vacation.\”
Trackback by Iklan baris — October 6, 2015 @ 10:29 am