In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the example analysis of server.xml configuration in Tomcat, which has certain reference value. Interested friends can refer to it. I hope that after reading this article, you will gain a lot. Let Xiaobian take you to understand it together.
Server
In tomcat's world, one server represents the entire container. Tomcat provides an implementation of the default org.apache.catalina interface. Users rarely modify this default implementation
Service
A Service is a middleware that exists inside a Server and binds one or more Connectors to a specific Engine. The default implementation is sufficient. is an implementation of the org.apache.catalina.Service interface. A Service is a collection of one or more Connectors that share a container.
Engine
An Engine represents the pipeline of request processing for a particular Service. Because a Service can have multiple Connectors, the Engine receives and processes all requests from these Connectors. And send the result back to the appropriate connector and send it to the client. The org.apache.catalina.Interface Engine interface can be implemented to provide custom Engines, although this is not generally required.
Host
A Host associates a domain name with tomcat. An Engine can contain multiple hosts, and a Host also supports network aliases (such as yourcompany.com or abc.yourcompany.com). Users rarely implement an org.apache.catalina.Interface Host interface because org.apache.catalina.core.StandardHost, the default implementation, already provides rich extensions.
Connector
A Connector handles communication with clients. Tomcat has multiple connectors. These connectors all implement the Connector interface. Creating a custom connector is very complicated.
AJP is a protocol customized for communication between Tomcat and HTTP servers, providing high communication speed and efficiency. In configuring Tomcat to integrate with HTTP servers, the reader need not worry about the details of the AJP protocol.
Tomcat's main function is to provide Servlet/JSP containers, although it can also be used as a stand-alone Java Web server, it is not as fast as other professional HTTP servers, such as IIS and Apache servers, in terms of processing static resources (such as HTML files or image files) and providing Web server management functions.
In practice, Tomcat is often integrated with other HTTP servers. For HTTP servers that do not support Servlet/JSP, you can run Servlet/JSP components through Tomcat servers.
When Tomcat is integrated with other HTTP servers, the Tomcat server usually works as an out-of-process Servlet container, and the Tomcat server communicates with other HTTP servers through specialized plug-ins.
Tomcat and HTTP server integration principle: Tomcat server through the Connector component and client program to establish a connection, Connector component is responsible for receiving customer requests, and Tomcat server response results sent to the customer. By default, Tomcat has two connectors configured in server.xml:
The first connector listens on port 8080 and is responsible for establishing HTTP connections. This connector is used when accessing Tomcat server Web applications through a browser.
The second connector listens on port 8009 and is responsible for establishing connections to other HTTP servers. This connector is needed when integrating Tomcat with other HTTP servers.
Tomcat provides a special JK plug-in to take care of communication between Tomcat and HTTP servers. JK plug-ins should be placed on the other party's HTTP server.
Tomcat provides different JK plug-in implementation modules for different HTTP servers
Integration with Apache HTTP Server on Windows: mod_jk_2.0.46.dll
Integration with Apache HTTP Server under Linux (RedHet): mod_jk.so-ap2.0.46-rh72.. 46-rh72
Integration with IIS Server: isapi_redirect.dll
AJP is a protocol customized for communication between Tomcat and HTTP servers, providing high communication speed and efficiency.
Knowledge of AJP can be found in Baidu.
If both Tomcat servers are running on the same machine, you should modify all three port numbers for at least one of the Tomcat servers.
Context
A Context represents a web application. A Host can contain multiple contexts. Each one has a different access address.
You can implement the Context interface to create your own Contexts. This is rarely used because StandardContext already provides a wealth of additional functionality.
Thank you for reading this article carefully. I hope that Xiaobian's "Sample Analysis of Server.xml Configuration in Tomcat" will be helpful to everyone. At the same time, I hope that everyone will support it a lot and pay attention to the industry information channel. More relevant knowledge is waiting for you to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.