Академический Документы
Профессиональный Документы
Культура Документы
Tomcat
“up and running.”
Welcome to this Quick Start presentation for Apache Tomcat. This presentation is for IT professionals who are
new to Apache Tomcat and who wish to learn how to get Tomcat “up and running” in the simplest manner, and as
quickly, as possible.
A commonly asked question is “What is Apace Tomcat”?
The simple answer is Tomcat is a high performance web server and a servlet and JSP container (usually referred to
as a “web container” in JEE terminology). As a web server, Tomcat has been shown to be faster than the Apache
httpd web server by a significant margin. After this tutorial, you will understand that the Tomcat project provides
much more than a simple container for JEE web components.
To provide a comprehensive answer to the question, “What is Apache Tomcat?”, it’s helpful to know about the
Apache Software Foundation and its many open-source projects. Tomcat is one of these projects.
The Apache Software Foundation provides support for the Apache community of open-source software projects.
The Apache Projects are characterized by a collaborative, consensus based development process, an open and
pragmatic software license, and a desire to create high quality software that leads the way in its field.
Apache Tomcat is an open source software implementation of the Java Servlet and Java Server Pages
specifications. The Java Servlet and JavaServer Pages specifications are developed under the Java Community
Process.
Tomcat is developed in an open and participatory environment and released under the Apache Software Licenses.
Tomcat is intended to be a collaboration of the best-of-breed developers from around the world. All developers
are invited to participate in this open-source project. Tomcat is used by numerous, diverse industries and
organizations with large-scale, mission-critical web applications. A sample of these users and their stories is
listed on the wiki page located at http://wiki.apache.org/tomcat/PoweredBy .
Because Windows must be made aware of the location of the JSE installation, you need to
potentially create and definitely set two system environment variables, JAVA_HOME and
PATH. JAVA_HOME is set to the name of the JSE installation directory and PATH is updated
with the location of the bin directory found in the JSE installation directory.
Before running “java –version” , the student can confirm that the environment
variables have been set correctly by typing “set” at the command prompt.
“set” will return a screen of all environment variables with values. Scroll through the
output to make sure PATH and JAVA_HOME are set as intended.
.
10/24/2009 02:15 PM <DIR> ..
10/21/2009 03:26 PM <DIR> bin
10/22/2009 11:10 AM <DIR> conf
10/21/2009 03:26 PM <DIR> lib
10/21/2009 03:26 PM 37,950 LICENSE
10/22/2009 11:10 AM <DIR> logs
10/21/2009 03:26 PM 556 NOTICE
10/21/2009 03:26 PM 7,317 RELEASE-NOTES
10/21/2009 03:26 PM 6,368 RUNNING.txt
10/21/2009 03:26 PM <DIR> temp
10/22/2009 12:11 PM <DIR> webapps
10/22/2009 11:10 AM <DIR> work
The DOS window will appear and show the execution of the Tomcat startup.bat file.
If the student looks at the contents of the startup.bat file, it will be noted that the
majority of what is happening is coming from the c:\apache-tomcat-
6.0.20\bin\catalina.bat file being invoked from startup.bat. It is beneficial to
understand the contents of catalina.bat.
If a Java exception of any type appears in the screen output, the last line beginning
with “Server Startup in xxxx ms” does not appear or the Tomcat default home page is
not displayed, most likely there is something wrong with the Tomcat installation.
Consult the “Documentation” and “Problems?” links on the Tomcat download page,
http://tomcat.apache.org/download-60.cgi.
The “Administration” category provides links to the Server Status page, which as the name
implies, provides detailed information about the current Tomcat server, and links to the
Manager web application. The Manager web application allows the user to start, stop,
deploy and un-deploy web applications running on the Tomcat server
Among the links under “Documentation”, the “Tomcat Documentation” link provides access
to the top-level entry point of the documentation bundle for the Tomcat Servlet/JSP
container. Tomcat 6.0.x implements the Servlet 2.5 and JavaServer Pages 2.1 specifications
and includes many additional features that make it a useful platform for developing and
deploying web applications and web services.
The “Tomcat Onliine” category provides links such as the “Bug Database” that can be used to
report bugs and a link called “Open Bugs” which provides a complete list of the software
issues identified as bugs. Those bugs are given unique IDs and the status of the work to
resolve the bug is shown on this list as well.
With the “Miscellaneous” category links, the student can access many more sample Servlet
and JSP applications as well as the Servlet and JSP specifications themselves located on the
Sun web site.
<role rolename="manager"/>
<user username="tomcat" password="s3cret" roles="manager"/>
If the “Core” .zip file was used for installation, prior to doing the steps outlined in this
slide, one would use the Windows sc command with the create option to create a
service entry in the registry and the service database for Tomcat.
Updating the “Apache Tomcat” service with a startup type of “Automatic” and
pressing the Start button to start the service if it has not been started.
Once the Tomcat executable has been identified as a service, (either through the use of the
sc command or from the Windows Service Installer modifying the registry and the service
data base), the service must be configured to be started with the start up of the Windows
Operating system. This can be done with the Administrative Tools.
On the Control Panel, choose “Administrative Tools”. On the Administrative Tools window,
select the “Services” option. You will be presented with a list of the registered Windows
services. Go down the alphabetically-ordered list and chose the name you have given the
Tomcat server. The Windows Service Installer uses the name “Apache Tomcat”. Click on the
name of your Tomcat server and the Tomcat Properties window appears. This window will
allow you to update the Tomcat service registry entry with a startup type of “Automatic”.
Press the Start button to start the service if it has not been started.
Whether Tomcat was installed from the “Core” zip file or from the “Windows Service
Installer”, the steps to change the startup type to “automatic” and to start the service after
installation are the same.
Note that the Windows Services Control Panel provides the ability to start and stop Tomcat
and to modify Tomcat’s start up type (such as manual, automatic, automatic delayed and
disabled) once Tomcat is identified as a service. Using the Windows Services Control Panel in
this way is often viewed as rudimentary “management capabilities” of the Tomcat server.
This should not to be confused with the management of the web applications running on
Tomcat. This level of management is provided by the Tomcat Manager.