http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/5be16a28/attic/servers/apache-tomcat-6.0.29/webapps/docs/architecture/startup.html ---------------------------------------------------------------------- diff --git a/attic/servers/apache-tomcat-6.0.29/webapps/docs/architecture/startup.html b/attic/servers/apache-tomcat-6.0.29/webapps/docs/architecture/startup.html new file mode 100644 index 0000000..8b85230 --- /dev/null +++ b/attic/servers/apache-tomcat-6.0.29/webapps/docs/architecture/startup.html @@ -0,0 +1,44 @@ +Apache Tomcat Architecture - Startup

+      The Apache Tomcat Servlet/JSP Container
+

Apache Tomcat 6.0

Apache Logo

Links

Contents

Apache Tomcat Architecture

Startup

Server Startup
+ +

+This page describes how the Tomcat server starts up. There are several +different ways to start tomcat, including: +

    +
  • From the command line.
  • +
  • From a Java program as an embedded server.
  • +
  • Automatically as a Windows service.
  • +
+

+ +
description
+

+A text description of the startup procedure is available +here. +

+
+ +
diagram
+

+A UML sequence diagram of the startup procedure is available +here. +

+
+ +
comments
+

+The startup process can be customized in many ways, both +by modifying Tomcat code and by implementing your own +LifecycleListeners which are then registered in the server.xml +configuration file. +

+ +
+ +

+ Copyright © 1999-2010, Apache Software Foundation +
\ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/5be16a28/attic/servers/apache-tomcat-6.0.29/webapps/docs/architecture/startup/serverStartup.pdf ---------------------------------------------------------------------- diff --git a/attic/servers/apache-tomcat-6.0.29/webapps/docs/architecture/startup/serverStartup.pdf b/attic/servers/apache-tomcat-6.0.29/webapps/docs/architecture/startup/serverStartup.pdf new file mode 100644 index 0000000..34aa598 Binary files /dev/null and b/attic/servers/apache-tomcat-6.0.29/webapps/docs/architecture/startup/serverStartup.pdf differ http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/5be16a28/attic/servers/apache-tomcat-6.0.29/webapps/docs/architecture/startup/serverStartup.txt ---------------------------------------------------------------------- diff --git a/attic/servers/apache-tomcat-6.0.29/webapps/docs/architecture/startup/serverStartup.txt b/attic/servers/apache-tomcat-6.0.29/webapps/docs/architecture/startup/serverStartup.txt new file mode 100644 index 0000000..b40dbd4 --- /dev/null +++ b/attic/servers/apache-tomcat-6.0.29/webapps/docs/architecture/startup/serverStartup.txt @@ -0,0 +1,138 @@ + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +Tomcat 5 Startup Sequence + +Sequence 1. Start from Command Line +Class: org.apache.catalina.startup.Bootstrap +What it does: + a) Set up classloaders + commonLoader (common)-> System Loader + sharedLoader (shared)-> commonLoader -> System Loader + catalinaLoader(server) -> commonLoader -> System Loader + b) Load startup class (reflection) + org.apache.catalina.startup.Catalina + setParentClassloader -> sharedLoader + Thread.contextClassloader -> catalinaLoader + c) Bootstrap.daemon.init() complete + +Sequence 2. Process command line argument (start, startd, stop, stopd) +Class: org.apache.catalina.startup.Bootstrap (assume command->start) +What it does: + a) Catalina.setAwait(true); + b) Catalina.load() + b1) initDirs() -> set properties like + catalina.home + catalina.base == catalina.home (most cases) + b2) initNaming + setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, + org.apache.naming.java.javaURLContextFactory ->default) + b3) createStartDigester() + Configures a digester for the main server.xml elements like + org.apache.catalina.core.StandardServer (can change of course :) + org.apache.catalina.deploy.NamingResources + Stores naming resources in the J2EE JNDI tree + org.apache.catalina.LifecycleListener + implements events for start/stop of major components + org.apache.catalina.core.StandardService + The single entry for a set of connectors, + so that a container can listen to multiple connectors + ie, single entry + org.apache.coyote.tomcat5.CoyoteConnector + Connectors to listen for incoming requests only + It also adds the following rulesets to the digester + NamingRuleSet + EngineRuleSet + HostRuleSet + ContextRuleSet + b4) Load the server.xml and parse it using the digester + Parsing the server.xml using the digester is an automatic + XML-object mapping tool, that will create the objects defined in server.xml + Startup of the actual container has not started yet. + b5) Assigns System.out and System.err to the SystemLogHandler class + b6) Calls initialize on all components, this makes each object register itself with the + JMX agent. + During the process call the Connectors also initialize the adapters. + The adapters are the components that do the request pre-processing. + Typical adapters are HTTP1.1 (default if no protocol is specified, + org.apache.coyote.http11.Http11Protocol) + AJP1.3 for mod_jk etc. + + c) Catalina.start() + c1) Starts the NamingContext and binds all JNDI references into it + c2) Starts the services under which are: + StandardService -> starts Engine (ContainerBase ->Logger,Loader,Realm,Cluster etc) + c3) StandardHost (started by the service) + Configures a ErrorReportValvem to do proper HTML output for different HTTP + errors codes + Starts the Valves in the pipeline (at least the ErrorReportValve) + Configures the StandardHostValve, + this valves ties the Webapp Class loader to the thread context + it also finds the session for the request + and invokes the context pipeline + Starts the HostConfig component + This component deploys all the webapps + (webapps & conf/Catalina/localhost/*.xml) + Webapps are installed using the deployer (StandardHostDeployer) + The deployer will create a Digester for your context, this digester + will then invoke ContextConfig.start() + The ContextConfig.start() will process the default web.xml (conf/web.xml) + and then process the applications web.xml (WEB-INF/web.xml) + + c4) During the lifetime of the container (StandardEngine) there is a background thread that + keeps checking if the context has changed. If a context changes (timestamp of war file, + context xml file, web.xml) then a reload is issued (stop/remove/deploy/start) + + d) Tomcat receives a request on an HTTP port + d1) The request is received by a separate thread which is waiting in the PoolTcpEndPoint + class. It is waiting for a request in a regular ServerSocket.accept() method. + When a request is received, this thread wakes up. + d2) The PoolTcpEndPoint assigns the a TcpConnection to handle the request. + It also supplies a JMX object name to the catalina container (not used I believe) + d3) The processor to handle the request in this case is Coyote Http11Processor, + and the process method is invoked. + This same processor is also continuing to check the input stream of the socket + until the keep alive point is reached or the connection is disconnected. + d4) The HTTP request is parsed using an internal buffer class (Coyote Http11 Internal Buffer) + The buffer class parses the request line, the headers, etc and store the result in a + Coyote request (not an HTTP request) This request contains all the HTTP info, such + as servername, port, scheme, etc. + d5) The processor contains a reference to an Adapter, in this case it is the + Coyote Tomcat 5 Adapter. Once the request has been parsed, the Http11 processor + invokes service() on the adapter. In the service method, the Request contains a + CoyoteRequest and CoyoteRespons (null for the first time) + The CoyoteRequest(Response) implements HttpRequest(Response) and HttpServletRequest(Response) + The adapter parses and associates everything with the request, cookies, the context through a + Mapper, etc + d6) When the parsing is finished, the CoyoteAdapter invokes its container (StandardEngine) + and invokes the invoke(request,response) method. + This initiates the HTTP request into the Catalina container starting at the engine level + d7) The StandardEngine.invoke() simply invokes the container pipeline.invoke() + d8) By default the engine only has one valve the StandardEngineValve, this valve simply + invokes the invoke() method on the Host pipeline (StandardHost.getPipeLine()) + d9) the StandardHost has two valves by default, the StandardHostValve and the ErrorReportValve + d10) The standard host valve associates the correct class loader with the current thread + It also retrieves the Manager and the session associated with the request (if there is one) + If there is a session access() is called to keep the session alive + d11) After that the StandardHostValve invokes the pipeline on the context associated + with the request. + d12) The first valve that gets invoked by the Context pipeline is the FormAuthenticator + valve. Then the StandardContextValve gets invoke. + The StandardContextValve invokes any context listeners associated with the context. + Next it invokes the pipeline on the Wrapper component (StandardWrapperValve) + d13) During the invocation of the StandardWrapperValve, the JSP wrapper (Jasper) gets invoked + This results in the actual compilation of the JSP. + And then invokes the actual servlet. + e) Invocation of the servlet class http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/5be16a28/attic/servers/apache-tomcat-6.0.29/webapps/docs/balancer-howto.html ---------------------------------------------------------------------- diff --git a/attic/servers/apache-tomcat-6.0.29/webapps/docs/balancer-howto.html b/attic/servers/apache-tomcat-6.0.29/webapps/docs/balancer-howto.html new file mode 100644 index 0000000..85bf358 --- /dev/null +++ b/attic/servers/apache-tomcat-6.0.29/webapps/docs/balancer-howto.html @@ -0,0 +1,21 @@ +Apache Tomcat 6.0 - Load Balancer HOW-TO

+      The Apache Tomcat Servlet/JSP Container
+

Apache Tomcat 6.0

Apache Logo

Links

User Guide

Reference

Apache Tomcat Development

Apache Tomcat 6.0

Load Balancer HOW-TO

Table of Contents
+ +
Using the JK 1.2.x native connector
+ +Please refer to the JK 1.2.x documentation. + +
Using Apache HTTP Server 2.x with mod_proxy
+ +Please refer to the mod_proxy documentation for Apache HTTP Server 2.2. This supports either +HTTP or AJP load balancing. This new version of mod_proxy is also usable with +Apache HTTP Server 2.0, but mod_proxy will have to be compiled separately using the code +from Apache HTTP Server 2.2. + +

+ Copyright © 1999-2010, Apache Software Foundation +
\ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/5be16a28/attic/servers/apache-tomcat-6.0.29/webapps/docs/building.html ---------------------------------------------------------------------- diff --git a/attic/servers/apache-tomcat-6.0.29/webapps/docs/building.html b/attic/servers/apache-tomcat-6.0.29/webapps/docs/building.html new file mode 100644 index 0000000..df930df --- /dev/null +++ b/attic/servers/apache-tomcat-6.0.29/webapps/docs/building.html @@ -0,0 +1,189 @@ +Apache Tomcat 6.0 - Building Tomcat

+      The Apache Tomcat Servlet/JSP Container
+

Apache Tomcat 6.0

Apache Logo

Links

User Guide

Reference

Apache Tomcat Development

Apache Tomcat 6.0

Building Tomcat

Table of Contents
+ +
Introduction
+ +

+Building Apache Tomcat from SVN is very easy, and is the first step to contributing to +Tomcat. The following is a step by step TODO list. +

+ +
Download a Java Development Kit (JDK) release (version 1.5.x or later)
+ +

+The Sun JDK can be downloaded here. +

+ +

+IMPORTANT: Set an environment variable JAVA_HOME to the pathname of the +directory into which you installed the JDK release. +

+ +
Install Apache Ant 1.6.5 or later
+ +

+Download a binary distribution of Ant 1.6.5 or later from +here. +

+ +

+Unpack the binary distribution into a convenient location so that the +Ant release resides in its own directory (conventionally named +"apache-ant-1.6.x"). For the purposes of the remainder of this document, +the symbolic name "${ant.home}" is used to refer to the full pathname of + the release directory. +

+ +

+Create an ANT_HOME environment variable to point the directory ${ant.home}, +and modify the PATH environment variable to include directory +"${ant.home}/bin" in its list. This makes the "ant" command line script +available, which will be used to actually perform the build. +

+ +
Checkout or obtain the source code for Tomcat 6.0
+ +

+ Tomcat SVN repository URL: + http://svn.apache.org/repos/asf/tomcat/tc6.0.x/ +

+ +

+ Download a source package from: + http://tomcat.apache.org/download-60.cgi +

+ +

+ Checkout the source using SVN, selecting the desired version or + branch (current development source is at + http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/), or + unpack the source package. The location where the source has been + placed will be referred as ${tomcat.source}. +

+ +
Building Tomcat
+ +

+Use the following commands: +
+ cd ${tomcat.source}
+ ant download
+ ant
+
+

+ +

+NOTE: Users accessing the Internet through a proxy must use a properties + file to indicate to Ant the proxy configuration. Read below. +

+ +

+WARNING: Running this command will download binaries to the + /usr/share/java directory. + Make sure this is appropriate to do so on your computer. On Windows, + this usually corresponds to the C:\usr\share\java directory, + unless Cygwin is used. Read below to customize the directory used + to download the binaries. +

+ +

+The build can be controlled by creating a ${tomcat.source}/build.properties + file, and adding the following content to it: +
+ # ----- Proxy setup -----
+ # Uncomment if using a proxy server.
+ #proxy.host=proxy.domain
+ #proxy.port=8080
+ #proxy.use=on
+
+ # ----- Default Base Path for Dependent Packages -----
+ # Replace this path with the directory path where
+ # dependencies binaries should be downloaded.
+ base.path=/usr/share/java
+
+

+ +
Building with Eclipse
+ +

+Important: +This is not a supported means of building Tomcat; this information is +provided without warranty :-). +The only supported means of building Tomcat is with the "ant build" +described above. +However, some developers like to work on Java code with a Java IDE, +and the following steps have been used by some developers. +

+ +

+Note that you must complete all the above steps to fetch +the repositories and build some JAR files the first time. +After you have completed the above steps, you can set up a +series of Eclipse 4 projects. +Note that this will not let you build everything under Eclipse; +the build process requires use of Ant for the many stages that aren't +simple Java compilations. +However, it will allow you to view and edit the Java code, +get warnings, reformat code, perform refactorings, run Tomcat +under the IDE, and so on. +

+ +

+Use Windows->Preferences and then Java->Build Path->Classpath +Variables to add two new Classpath variables: +

+ +

+ + + +
TOMCAT_LIBS_BASEthe base path where the binary dependencies have been downloaded
ANT_HOMEthe base path of Ant 1.6.2 or later
+

+ +

+Use File->Import and chose "Existing Projects into Workspace". +From there import the root directory where you have checked out tomcat. +

+ +

+Eclipse .project and .classpath files are provided in to root directory of tomcat repository +should allow Eclipse to find all source trees and jars, and +hopefully compile without problems. Note that these +files assume you are using Eclipse with a 5.0 or later JDK; also, the +connectors module must be built with a compiler compliance level of 5.0. +

+ +

+To run Tomcat without a special IDE plug-in, you can simply use Run->Run... +enter "org.apache.catalina.startup.Catalina" as the main class, +"start" as program arguments, and +"-Dcatalina.home=..." (with the name of your build directory) +as VM arguments. +

+ +

+Note also that due to the way the Tomcat source is assembled +from several SVN projects, you may not be able to use the Eclipse +SVN client to update (nor to commit, if you are a committer). +Use the external SVN client of your choice, then use the +Eclipse PackageExplorer or Navigator "Refresh" context menu item +to tell Eclipse that you've updated the files. +

+ +
Building with other IDEs
+

+The same caveats apply as for Eclipse, above. +

+ +

+The same general idea should work in most IDEs; it has been reported +to work in Idea, for example. +

+ +

+ Copyright © 1999-2010, Apache Software Foundation +
\ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/5be16a28/attic/servers/apache-tomcat-6.0.29/webapps/docs/cgi-howto.html ---------------------------------------------------------------------- diff --git a/attic/servers/apache-tomcat-6.0.29/webapps/docs/cgi-howto.html b/attic/servers/apache-tomcat-6.0.29/webapps/docs/cgi-howto.html new file mode 100644 index 0000000..21ab9d8 --- /dev/null +++ b/attic/servers/apache-tomcat-6.0.29/webapps/docs/cgi-howto.html @@ -0,0 +1,66 @@ +Apache Tomcat 6.0 - CGI How To

+      The Apache Tomcat Servlet/JSP Container
+

Apache Tomcat 6.0

Apache Logo

Links

User Guide

Reference

Apache Tomcat Development

Apache Tomcat 6.0

CGI How To

Table of Contents
+ +
Introduction
+ +

The CGI (Common Gateway Interface) defines a way for a web server to +interact with external content-generating programs, which are often +referred to as CGI programs or CGI scripts. +

+ +

Within Tomcat, CGI support can be added when you are using Tomcat as your +HTTP server and require CGI support. Typically this is done +during development when you don't want to run a web server like +Apache httpd. +Tomcat's CGI support is largely compatible with Apache httpd's, +but there are some limitations (e.g., only one cgi-bin directory). +

+ +

CGI support is implemented using the servlet class +org.apache.catalina.servlets.CGIServlet. Traditionally, +this servlet is mapped to the URL pattern "/cgi-bin/*".

+ +

By default CGI support is disabled in Tomcat.

+
Installation
+ +

CAUTION - CGI scripts are used to execute programs +external to the Tomcat JVM. If you are using the Java SecurityManager this +will bypass your security policy configuration in catalina.policy.

+ +

Remove the XML comments from around the CGI servlet and servlet-mapping +configuration in $CATALINA_BASE/conf/web.xml.

+ +

Only Contexts which are marked as privileged may use the CGI servlet (see the +privileged property of the Context element).

+ +
Configuration
+ +

There are several servlet init parameters which can be used to +configure the behaviour of the CGI servlet. +

    +
  • cgiPathPrefix - The CGI search path will start at +the web application root directory + File.separator + this prefix. +The default cgiPathPrefix is WEB-INF/cgi
  • +
  • debug - Debugging detail level for messages logged +by this servlet. Default 0.
  • +
  • executable - The of the executable to be used to +run the script. Default is perl.
  • +
  • parameterEncoding - Name of the parameter encoding +to be used with the GCI servlet. Default is +System.getProperty("file.encoding","UTF-8").
  • +
  • passShellEnvironment - Should the shell environment +variables (if any) be passed to the CGI script? Default is +false.
  • +
  • stderrTimeout - The time (in milliseconds) to wait for +the reading of stderr to complete before terminating the CGI process. Default +is 2000.
  • +
+

+ +

+ Copyright © 1999-2010, Apache Software Foundation +
\ No newline at end of file