Top Level Elements - <Server> is the root element of the entire configuration
file, while <Service> represents a group of Connectors that is associated
with an Engine.
Connectors - Represent the interface
between external clients sending requests to (and receiving responses from)
a particular Service.
Containers - Represent components whose function is to process incoming
requests, and create the corresponding responses. An Engine handles all
requests for a Service, a Host handles all requests for a particular virtual
host, and a Context handles all requests for a specific web application.
Nested Components - Represent elements that can be nested inside the element
for a Container. Some elements can be nested inside any Container, while
others can only be nested inside a Context.
The connectors allowing direct connections are in the binary of Tomcat. They are jar files.
The connectors used with a Web Server are made of 2 components. One written in Java and the other written in C. The Java part is made of jar files are inclosed in the Tomcat binaries. See the Web Server Connectors table. Current mod_jk2 and mod_webapp are the two apache modules that are used for communicating with the CoyoteConnector and WarpConnector respectively on tomcat (run as servlet). mod_jk2 supports in-process JVM and load balancing.
<!-- Tomcat Examples Context -->
<Context path="/examples" docBase="examples" debug="0"
reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_examples_log." suffix=".txt"
timestamp="true"/>
<Ejb name="ejb/EmplRecord" type="Entity"
export PATH JAVA_HOME
*.html, *.jsp, etc. - The HTML and JSP pages, along with other files that must be visible to the client browser (such as JavaScript, stylesheet files, and images) for your application. In larger applications you may choose to divide these files into a subdirectory hierarchy, but for smaller apps, it is generally much simpler to maintain only a single directory for these files.
/WEB-INF/web.xml - The Web Application Deployment Descriptor for your application.
This is an XML file describing the servlets and other components that make
up your application, along with any initialization parameters and container-managed
security constraints that you want the server to enforce for you.
/WEB-INF/classes/ - This directory contains any Java class files (and associated
resources) required for your application, including both servlet and non-servlet
classes, that are not combined into JAR files. If your classes are organized
into Java packages, you must reflect this in the directory hierarchy under
/WEB-INF/classes/. For example, a Java class named com.mycompany.mypackage.MyServlet
would need to be stored in a file named /WEB-INF/classes/com/mycompany/mypackage/MyServlet.class.
/WEB-INF/lib/ - This directory contains JAR files that contain Java class
files (and associated resources) required for your application, such as
third party class libraries or JDBC drivers.
When you install an application into Tomcat (or any other 2.2/2.3-compatible server), the classes in the WEB-INF/classes/ directory, as well as all classes in JAR files found in the WEB-INF/lib/ directory, are made visible to other classes within your particular web application.
Tomcat 4 also supports mechanisms to install library JAR files (or unpacked classes) once, and make them visible to all installed web applications (without having to be included inside the web application itself.
there are two locations that are commonly used within a Tomcat 4 installation for shared code:
$CATALINA_HOME/common/lib - JAR files placed here are visible both to web applications and internal Tomcat code. This is a good place to put JDBC drivers that are required for both your application and internal Tomcat use (such as for a JDBCRealm).
$CATALINA_HOME/shared/lib - JAR files placed here are visible to all web
applications, but not to internal Tomcat code. This is the right place for
shared libraries that are specific to your application.
Out of the box, a standard Tomcat 4 installation includes a variety of pre-installed
shared library files, including:
The JavaMail 1.2 (and associated JavaBeans Activation Framework) APIs, so you can write mail-enabled web applications.
The JDBC 2.0 Optional Package APIs, which define things like javax.sql.DataSource.
The Servlet 2.3 and JSP 1.2 APIs that are fundamental to writing servlets
and JavaServer Pages.
An XML Parser compliant with the JAXP (version 1.1) APIs, so your application
can perform DOM-based or SAX-based processing of XML documents.
Deploy a new web application, on a specified context path, from the uploaded
contents of a WAR file.
Install a new web application, which can be anywhere on the server's disks.
List the currently deployed web applications, as well as the sessions that
are currently active for those web apps.
Reload an existing web application, to reflect changes in the contents of
/WEB-INF/classes or /WEB-INF/lib.
List the available global JNDI resources, for use in deployment tools that
are preparing <ResourceLink> elements nested in a <Context>
deployment description.
List the available security roles defined in the user database.
Remove an installed web application.
Start a stopped application (thus making it available again).
Stop an existing application (so that it becomes unavailable), but do not
undeploy it.
Undeploy a deployed web application and delete its document base directory.
JAVA_HOME=/users/server/students/cs526/public_html/java/j2sdk1.4.1_01
CVSROOT=/users/server/students/cs526/CVS
prepare:
[mkdir] Created dir: /.automount/cs/root/usr2/students/cs526/public_html/tomcat/jakarta-tomcat-4.1.12/webapps/tomcat-docs/appdev/cs526hw5/build
[mkdir] Created dir: /.automount/cs/root/usr2/students/cs526/public_html/tomcat/jakarta-tomcat-4.1.12/webapps/tomcat-docs/appdev/cs526hw5/build/WEB-INF
[mkdir] Created dir: /.automount/cs/root/usr2/students/cs526/public_html/tomcat/jakarta-tomcat-4.1.12/webapps/tomcat-docs/appdev/cs526hw5/build/WEB-INF/classes
[copy] Copying 4 files to /.automount/cs/root/usr2/students/cs526/public_html/tomcat/jakarta-tomcat-4.1.12/webapps/tomcat-docs/appdev/cs526hw5/build
[mkdir] Created dir: /.automount/cs/root/usr2/students/cs526/public_html/tomcat/jakarta-tomcat-4.1.12/webapps/tomcat-docs/appdev/cs526hw5/build/WEB-INF/lib
compile:
[javac] Compiling 2 source files to /.automount/cs/root/usr2/students/cs526/public_html/tomcat/jakarta-tomcat-4.1.12/webapps/tomcat-docs/appdev/cs526hw5/build/WEB-INF/classes
BUILD SUCCESSFUL
Total time: 7 seconds
[cs526@sanluis cs526hw5]$ ant install
Buildfile: build.xml
prepare:
compile:
install:
[install] OK - Installed application at context path /cs526hw5
BUILD SUCCESSFUL
Total time: 5 seconds
[cs526@sanluis cs526hw5]$
prepare:
compile:
reload:
[reload] OK - Reloaded application at context path /cs526hw5
BUILD SUCCESSFUL
Total time: 4 seconds