Some questions about the "Apache-tomcat-5.5.15/conf/catalina/localhost Configuration virtual directory". (There's more than one way to configure a Web project, a virtual directory is one) __web

Source: Internet
Author: User
Tags tomcat tomcat server

When I was working on a Web project recently, it was always the same as the tomcat5.5 directory

/conf/catalina/localhost the configuration file about the project in this deal.

What is he specifically about?


To get information from the Internet, organize as follows:


(3) Set up ABC directory under C:/tomcat 5.5/webapps/, in/conf/catalina/localhost

The following files are created Sxzlc.xml,sxzlc.xml file contents:

<?xml version= "1.0" encoding= "UTF-8"?>


<context Path = "/SXZLC" docBase = "C:/workspace/abc/webapps"
Workdir = "/workspace/abc/work" reloadable= "true" >

</Context>

Path represents the name of the virtual directory,

DOCBASE specifies the local directory.

(There is a specific description below)

So we've come up with a problem.


That's


How to deploy a Web project:


(This is the method I have been using before) 1. Copy this Web application (a folder or a war file) to Appbbase, without having to write the context of the Web app anywhere, accessed by the name of the folder (or the name of the war file).
2. Put this web app anywhere except the AppBase folder and write an XML file of any name (or suggest you write an application with the same name), put it in the installation directory/server/conf/catalina/your host, in the XML file To define the access path for this app, path and physical path docbase, accessed at the path defined by path.
(The 3rd is from the Internet, no practice)
3. Under the host node in the Tomcat Server.xml file, add:

Context path= "/wpoliceseeker" docbase= "C:/wpoliceseeker/webcontent"/>

about the properties of the context:


Backgroundprocessordelay This value represents the delay, in seconds, of calling the Backgroundprocess method on the context and its child containers (including all wrappers). If the delay value is not negative, the child container is not called,

This means that the child container uses its own processing thread. If the value is positive, a new thread is created. After waiting for a specified time, the thread calls the Backgroundprocess method on the host and its child containers. Context using the background

Processing session expires, monitoring class changes are used for re-loading. If not specified, the default value of this property is-1, which indicates that the context relies on the background processing of the host to which it belongs.


The Java class name implemented by the className . The class must implement the Org.apache.catalina.Context interface. If not specified, the standard implementation is used (defined below).
Cookies are set to ture if they wish to use cookies to pass session identifier (client support cookies are required). Otherwise false, this case can only rely on the URL rewriting pass session identifier.


Crosscontext If you want to call Servletcontext.getcontext () within your app to return the request dispatcher of other Web application running on that virtual host, Set to True. In a security-critical environment

, set to False so that getcontext () always returns NULL. The default value is False.


docBase The document base directory for the Web app, also known as context Root, or the path to the war file. You can use an absolute path, or you can use the AppBase path relative to the host that the context belongs to.


override set to True if you want to overwrite the corresponding setting in Defaultcontext with the settings in the context element. The settings in Defaultcontext are used by default.

Privileged is set to true to allow the context to use container servlets, such as the manager servlet.

The context path of the path web App. Catalina compares the start of each URL to the context path and selects the appropriate Web app to process the request. The context path under a specific host must be unique. If the context path

is an empty string (""), this context is the default Web application of the owning host to handle requests that do not match any of the context path.


reloadable If you want Catalina to monitor/web-inf/classes/and/web-inf/lib The following classes are changed, automatically reload the WEB application when changes occur, set to true. This feature is very well developed during the development phase.

, but it also greatly increases the cost of the server. Therefore, it is not recommended to use it after publishing. However, you can use the Manager app to trigger overloads of the app when necessary.

The name of the wrapperclass Org.apache.catalina.Wrapper implementation class for the servlets of the context management. If not specified, the standard default value is used.

Standard implementations


The standard implementation of the Context is Org.apache.catalina.core.StandardContext.

It also supports the following additional properties:


Property Description
Debug the verbosity of debugging information that is associated with this engine with the logger record. The larger the number, the more detailed the output. If not specified, the default is 0.


Swallowoutput If this value is true, the output of System.out and System.err is redirected to the logger of the Web App. If not specified, the default value is False

Usenaming set to True if you want Catalina to enable a Jndi InitialContext object for the Web App. The initialialcontext conforms to the agreement of the Java EE platform and the default value is true.


Workdir The path to the temporary directory provided by the Context for the temporary read/write of the servlet. With the Javax.servlet.context.tempdir property, the servlet can access the directory. If not specified, use the

$CATALINA _home/work next to a suitable directory.


Nested Components
The following elements can be nested within a context element, but can only be nested once per element.


Loader -Configures the class loader that the Web app uses to load Servlets and JavaBean. Under normal circumstances, using the default classloader is sufficient;


L ogger -Configures the logger to receive and process all log messages, including all messages logged by the ServletContext.log () function;


MAnager -configure Session Manager to create, destroy, and maintain HTTP sessions. Under normal circumstances, using the default Session manager configuration is sufficient;


Realm -Configure realm, the realm's user database and related roles are used only in this particular Web application. If not specified, the Web app uses the realm of the host or engine it belongs to.


Resources-configured to access the static resources associated with this web app. Under normal circumstances, using the default resource manager is sufficient.


Proprietary features

Access log
Under normal circumstances, running the Web server generates an access log. The access log outputs one line of information for each request in a standard format. The Catalina includes an optional valve implementation that generates logs in a standard format and can be used with any custom

The format.

By nesting a valve element in the engine, Host, or context, Catalina creates access for all requests processed by the container


The above attribute information is referenced from the website of Teacher Xinxin Sun: (Programmer's House Forum)

Http://www.sunxin.org/forum/thread/23206.html



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.