Tomcat Chinese Manual (1)

xiaoxiao2021-03-06  41

JAKARTA-TOMCAT Concise Chinese User Guide Part 1 This document provides basic information about Tomcat. The main contents are as follows: Tomcat binary version installation with the main content of the script related to Tomcat related to server.xml, Tomcat's main configuration file Setting Tomcat to work with the host web server How to apply Tomcat Configuring a real-in-one Web site I hope this document is enough to start using Tomcat. If you can't find someone, please find Tomcat FAQ Find Tomcat Packet Qing Single Tomcat User Mail List This question does not exist, we encourage the questions to add questions to Tomcat FAQ or this document. If you have comments or suggestions for this document, please send it to Tomcat mailing list. Getting StartedTomcat is a servlet container with a JSP environment. Servlet container is a shell that can manage and activate servlet based on user behavior. Roughly can divide the servlet container into several categories: Separate servlet containers have a web server Part of the part of the Java-based web server, such as the servlet container is a part of JavaWebserve. The stand-alone servlet container is the default mode of Tomcat. Most web servers are not based on Java, so we can get the following two Pattern of container. The servlet container servlet container in the process is a web server's plugin and the implementation of the Java container .Web server plugin opens a JVM (Java Virtual Machine) internally, to make Java containers to run internal. If there is a certain The request for servlet is required. The plugin will acquire the control of this request and deliver him (using JNI) to the Java container. Process Content For multi-thread, the server is very suitable and provides a good running speed, but telescopic The sex is insufficient. The Servlet container Servlet container runs outside the web server and the combination of the web server's plugin and the implementation of the Java container .Web server plugin and Java container JVM use IPC mechanisms (usually TCP / IP) Communication. When a request to call the servlet arrives, the plugin will acquire the control of this request and deliver it (using IPC, etc.) to the Java container, the process outer container is not as good as the process instrument However, the process outer container engine is better (scalability, stability, etc.) in many other comparison. Tomcat can be used as a separate container ( Mainly for development and debugging) It can also be used as an additional to existing servers (currently supporting Apache, IIS, and Netscape Server). That is, you must decide how to apply him, such as selecting the second or third mode You also need to install a web server interface. What is the difference between Tomcat and JSERV? Tomcat is JSERV? This is a common misunderstanding. Jserv is compatible with servlet API2.0 compatible with Apache. Tomcat is a completely rewritten And container compatible with Servlet API2.2 and JSP1.1.Tomcat uses some code written for JSERV, especially JSERV's Apache interface, but this is the same thing. How to install Tomcat's binary version? Very simple Just: Download the zip / tar.gz any compressed file, from http://jakarta.apche order.ob/download/binindex.html. Unzip this file to a directory (such as: foo). Will generate a child Directory, named "Tomcat". Convert to "Tomcat" directory Setting up a new environment variable (Tomcat_home) points to the Tomcat of Tomcat, type: "set tomcat_home = foo / tomcat" UNIX platform: such as Bash / SH Environment, type: "Tomcat_home = foo / tomcat;

Export Tomcat_Home "If the TCSH environment, type:" setenv tomcat_home foo / tomcat "Set the environment variable java_home points to your JDK directory, then add the Java interpreter to your PATH environment variable. Ok! Now you can run Tomcat and as an independent Servlet Container (Mode 1) Starts with Close Tomcat Using Scripts in the "bin" directory launch and close Tomcat. Start: uinx: bin / startup.shwin32: bin / startup close: UNIX: bin / shutdown.shwin32: bin / shutdowntomcat directory Structure Hypothesis You have decompressed Tomcat, you have got the following directory structure: Directory Name - Description BIN contains Start / Close script Conf contains different profiles, including server.xml (Tomcat's primary configuration file) and for different Tomcat configurations Web Application Settings Defaults File Web.xmldoc Contains Various Tomcat Document Lib Contains Tomcat JAR Files. UNIX Platform Any files in this directory are added to Tomcat's ClassPath Logs Tomcat placed in Logs Tomcat placed in Logs Tomcat ServletAPI source files. Don't happy, these only some of the air interfaces and abstract class WebAPPs that must be implemented in the servlet container contains web project examples. Some you can create the following directory: Worktomcat automatically generates, place Tomcat Timatics (such as Compiled JSP files). If you delete this directory when you run. Thejsp page will not be able to run. Classes You can create this directory to add some additional categories to classpaths. Anything you add this directory can be Finding itself in Tomcat's class path Tomcat is a Java program, so you can run how to use the command line after setting several environment variables. However, set each environment variable used by Tomcat and the following command line parameters. And error. Therefore, Tomcat development group provides some scripts to make the startup and closing Tomcat easier. Note: These scripts are just a convenient way to start and close Tomcat. You can modify them to customize ClassPath, environment variables such as Path, LD_LIBRARY_PATH,, etc., as long as it produces a correct command line. What is these scripts? The following table lists the most important scripts for the general user. Tomcat main script. Set the appropriate environment variable, including ClassPath, Tomcat_Home and JAV A_HOME and use the appropriate command line parameter Start Tomcat Startup Start Tomcat in the background. The replacement of the Tomcat Start command Shutdown Close Tomcat. The Tomcat Stop command has a replacement method of the user's most important script is Tomcat (Tomcat.bat / Tomcat .sh). Other Tomcat-related scripts as a simple point-oriented Tomcat script (set different command line parameters, etc.). Carefully examine tomcat.bat / tomcat.sh, follows: in UNIX The step of the next step: If it is not specified, it is specified that tomcat_home is not specified, speculating java_home setting class_path contains: 1. $ {Tomcat_home} / classes directory (if present) 2. $ {Tomcat_home} / lib 3. $ {Java_home} /LIB/Tools.jar (This JAR file contains tool javac, we need JAVAC to handle the JSP file. Run the java command with the command line parameters with the setting Java environment variable, tall tomcat.home, and org.apache.tomcat. Startup.tomcat is started. At the same time, the command line parameter is also passed to org.apache.tomcat.Startup.tomcat, such as operation of start / stop / run, etc. This Tomcat process uses the path to Server.xml, such as Server. XML is placed in ETC / Server_1.xml and the user is intended to start apache in the background, type the following command line: bin / tomcat.sh start -f /etc/server_1.xml Steps under Win32:

转载请注明原文地址:https://www.9cbs.com/read-63276.html

New Post(0)