Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of Server.xml content in Tomcat

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces the example analysis of Server.xml content in Tomcat, which has a certain reference value, and interested friends can refer to it. I hope you will gain a lot after reading this article.

The structure diagram of Tomcat Server

This file describes how to start Tomcat Server

Note: a "Server" itself is not a "Container" (container), so you cannot define subcomponents such as "Valves" or "Loggers" here->

Wait for the shutdown command at port 8005

Shut down the server if you receive the "SHUTDOWN" string

->

Test: telnet localhost 8005 input: SHUTDOWN result: close tomcat

1 > className specifies the class that implements the org.apache.catalina.Server interface. The default value is org.apache.catalina.core.StandardServer 2 > port specifies that Tomcat listens on the shutdown command port. When terminating the server, you must issue the shutdown command on the same machine as the Tomcat server. This attribute is required. 3 > shutdown specifies the string of the shutdown listening port sent to the Tomcat server when it terminates the Tomcat server. This property must be set

Element this element is defined by the org.apache.catalina.Service interface and contains an element and one or more Connector elements that share the same Engine element

Note: a "Service" itself is not a container, so you cannot define subcomponents such as "Valves" or "Loggers" at this level. ->

Service is a collection of Connector

They share a single Engine to handle all requests received by Connector

->

The first handles all web client requests received directly by the Tomcat server. The second handles all Web client requests forwarded by the Apahce server.

1 > className specifies the class that implements the org.apahce.catalina.Service interface. The default is org.apahce.catalina.core.StandardService 2 > name defines the name of the Service

The element is defined by the Connector interface. The element represents the actual interaction with the client program, which is responsible for receiving the customer request and returning the response result to the customer.

The first Connector element defines a HTTP Connector that receives HTTP requests through port 8080, and the second Connector element defines a JD Connector that receives requests forwarded by other servers through port 8009.

Element there can be only one Engine element per Service element. Process customer requests received by all elements in the same element. Defined by the org.apahce.catalina.Engine interface.

You can include child elements like this in an element

< Context>

Element, which is defined by the Context interface. Is the most frequently used element. Every one of them.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report