1. For your home PC, all
you need in your filesystem is an image of the same
tomcat filesystem tree we are using on UNIX.
This is provided in $cs636/tomcat.zip. Of course you don't have to
use your assigned port numbers at home. Just use the default port 8080, plus
8005 for shutdown. Note that we do NOT want to install tomcat as a
service. We want to use it as a user-level program, so it's easy to bring
up and down. I have my tomcat installed at c:\tomcat-6.0, for easier
access from the command line. You can copy or rename the whole thing to a
different location if you decide later you don't like the first spot.
2 You don't need to set CATALINA_HOME as an environment variable for tomcat
itself, but we will need it for our build.xml, so set it up. I'm assuming you
already have JAVA_HOME set up as an environment variable. For example, I have
CATALINA_HOME defined as C:\tomcat-6.0. Also define TOMCAT_URL as
http://localhost:8080. Add %CATALINA_HOME%\bin to your Path to allow
command-line startup and shutdown.bat of tomcat. (shutdown
itself is a system program, so use shutdown.bat) Since the HTTP tool wget.exe
is also in this bin, it will now be available to you. Also
tcpmon.jar, another tool.
3. Optional. If you prefer icons to commands for starting up and stopping
tomcat outside eclipse, make two shortcuts as follows: This assumes
tomcat is installed at c:\tomcat-6.0. You can change it as necessary.
Shortcut "start tomcat":
Target: c:\tomcat-6.0\bin\startup.bat
Start in: c:\tomcat-6.0
For a nice icon, browse to your top-level tomcat directory and find tomcat.ico
Shortcut: "stop tomcat": same Shortcut Properties as
"start tomcat" except replace start with stop in the Target:
Target: c:\tomcat-6.0\bin\shutdown.bat
4. In a new DOS box, check your environment variables with "set" and
"path" in a new command window..
5. Quick test of tomcat: watch the startup output. You may see a pop up
from the Windows firewall, but this should not prevent tomcat from working when
accessed from the same machine (this is all we need), so don't be stopped by
it. Start up a browser and try URL http://localhost:8080
Hopefully you'll see the familiar tomcat home page. If
nothing is there, you can see what ports are in use, including listening ports,
by "netstat -a". If you installed JEE
in a privileged account (System Admin privileges) you may have Sun's app server
running on 8080 as a service. Shut it off as a service.
Eclipse and tomcat: Simplified and enhanced from eclipse (Indigo
version) docs
Help>Contents>Web Tools Platform User
Guide>Developing Web service applications>
Web
Services overview> Workspace and tools> Configuring your workspace>
Creating an Apache Tomcat server and Web Project (see if you can find it!)
Once you have installed the tomcat server outside eclipse, create a Tomcat server in the eclipse workbench by doing the following:
To build a dynamic Web project (what we need for pa2 and any other project using servlets) that points to the Tomcat server that you have created:
To start tomcat from eclipse, first be sure to stop it
outside eclipse if needed, then right-click the server in the Servers window
and choose Start. Or use the green start icon at the top of the Servers window.
You can start it in debug mode similarly, and set breakpoints in your servlet code.