Get the App
SLTechnology News&Howtos  ›  Servers  › 

Tomcat

Shulou Source: shulou.com Published: 2022-06-03 07:25:09 09月21日 Update

1. Brief introduction to Tomcat

Tomcat is an open source implementation of Web Container, a lightweight web server, and the first choice for developing and debugging JSP programs.

1.1. Tomcat architecture component Server: an instance of Tomcat. Usually, a JVM can only contain one Tomcat instance; it is a top-level component in Tomcat. A Server contains one or more ServiceService: Service calls Servlet Engine to handle client requests Connectors: it is responsible for connecting client requests to Web applications in the Servlet container, which usually refers to the location where the client sends the request and the port assigned by the server. The default port is usually 8080 of the HTTP protocol. An engine can configure multiple connectors, but these connectors must use different ports. The default connector is HTTP/1.1-based CoyoteEngine: Engine is the Servlet engine component that processes the request, which examines the HTTP header information of the request to identify which host or context the request should be sent to, and returns the corresponding client-side Host: Host component that is similar to the virtual host in Apache, but only supports FQDN-based "virtual host" in Tomcat. And an engine should contain at least one host Context: the Context component is the innermost component, which represents the Web application itself; the most important thing to configure a Context is to specify the root directory of the Web application, so that the Servlet container can send user requests to the correct location. 2. Deploy Tomcat 92.1. Install Tomcat [root@localhost ~] # yum-y install java-1.8.0-openjdk.x86_64 [root@localhost ~] # wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-9/v9.0.24/bin/apache-tomcat-9.0.24.tar.gz[root@localhost ~] # tar xvf apache-tomcat-9.0.24.tar.gz-C / usr/local/ [root@localhost ~] # ln-s / usr/ Local/apache-tomcat-9.0.24/ / usr/local/tomcat [root@localhost ~] # cat > / etc/profile.d/java.sh

Tags: Configuration files directories components information programs applications hosts customers resources private instances clients engines users ports virtual hosts connectors processing Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Apple OPPO Reno macOS Huawei