First contact Tomcat

zhaozj2021-02-16  96

In the afternoon, I will contact Tomcat. I see a lot of applications on the Tomcat. Tomcat must have a strong function. Tomcat is an important subproject in the Jakarta project. It is selected as the most innovative in 2001 by the editor of JavaWorld magazine. Most Innovative Java Product, and it is a SUN officially recommended servlet and JSP container (you can see http://java.sun.com/products/jsp/tomcat/), there is more and more Software companies and developers' love. The latest specifications for servlet and JSP can be implemented in the new version of Tomcat.

** Download, install Tomcat (VER4.0.3) ------------------------------ 1: Windows platform from Tomcat website to download Jakarta -tomcat-4.0.1.exe, you can install Tomcat in accordance with the general Windows program installation steps, which will automatically look for your JDK and JRE.

2: Linux platform Download jakarta-tomcat-4.0.1.tar.gz, unzip it to a directory.

** Configure Tomcat ----------------------------- If the system is Win98, add set java_home = in autoexec.bat = JDK path; use under Linux, put it in / etc / bashrc or / etc / profile: export java_home = / usr / local / jdk

** Run Tomcat -------------------------- 1.win98, enter the bin directory, use Startup.bat to start Tomcat; 2 .Win2000 / xp, start directly> Program> Apache Tomcat 4.0 start;

** Modify Tomcat default port 8080 ---------------------------- In the conf directory, open Server.xml, find

Port = "8080" MINPROCESSORS = "5" maxprocessors = "75"

Enablelookups = "True" redirectport = "8443"

? acceptcount = "10" debug = "0" connectionTIMEOUT = "60000" />

Modify port = 80.

** Establish your own virtual directory ---------------------------- Modify Server.xml, get it before

?

Path is the web's virtual directory, and DocBase is the path on the hard disk. Then we can enter in the browser address bar:?

Http: // localhost: 8080 / myjsp

** Tomcat directory structure ----------------------------- | --BIN ??? Store startup and close Tomcat script | Conf ?? Contains different profiles, server.xml (main configuration files for Tomcat) and web.xml | --Work ?? Store the Class file generated after the JSP compiled | --WebApp stores the application example, later you have to deploy The application also puts this directory | --logs ?? Store log file | --LIB / japser / common ?? These three directory mainly store the JAR files required for Tomcat

** server.xml ---------------------------- Server port specifies a port, this port is responsible for monitoring the shutdown Tomcat request Shutdown specified The port sent by the port service name Specifies how service's name Connector (represents the connection between client and service) port specifies the port number to create, and listens to the process of requesting the request minprocessors server from the client startup during this fracture MINPROCESS server Request thread number MAXPROCESSORS Maximum number of processing requests Enablelookups If true, you can get the actual host name of the remote client by calling request.getRemoteHost (). If false does not perform DNS queries, Yes Back to its IP address redirectport Specifies that the server is processing the HTTP request to receive an SSL transmission request, the reticient port number acceptCount, which can be placed when all the threads that can be used, can be placed in the processing queue. Number, the request will not process the timeout of the timeout (in milliseconds) Engine (in milliseconds) Engine (in milliseconds) Engine (in milliseconds), which specifies the request processor, receives, and processing from the Connector, specifies the default processing request. Host name, at least one of the name attribute values ​​of one of the host elements is the same Context (represents a web application, usually a WAR file, the specific information of WAR, see the servlet specification) DOCBASE application path or WAR file storage The path path indicates the prefix of the URL of this web application, so requested URL is http: // localhost: 8080 / path / *** reloadable This property is very important. If true, Tomcat automatically detects the application / Web-INF / LIB and / Web-INF / CLASES directory changes, automatically load new applications, we can change the application host (representing a virtual host) name specified host name AppBase application without restarting Tomcat Basic directory, that is, the directory where the application is placed, if True, Tomcat will automatically decompress the WAR file, otherwise it is not extracted, running the application directly from the WAR file (indicating log, debugging, and error message) C. Lassname Specifies the class name used by the logger. This class must implement org.apache.catalina.logger interface prefix Specifies the prefix for the log file. Suffix Specifies the suffix timestamp of the log file. If true, the log file name is to join the time, such as the following example: LocalHost_log .2001-10-04.TXT Realm (Database) ClassName specifies the class name used by Realm, this class must implement org.apache.catalina.Realm interface Valve (function and Logger is similar, its prefix As the SUFFIX property interpretation and logger, the classname specifies the class name used by the Valve, and uses org.apache.catalina.valves.accessLogvalve class to record the application's access information Directory specifies that the location of the Log file is stored in Pattern, which is two values. Common mode Record the remote host name or IP address, user name, date, first line requested string, HTTP response code, and the number of bytes sent. Combined mode is more than the value recorded in the Common mode

** Add users to Manager ------------------------- http: // localhost: 8080 / manager adds users to manage, in conf / In Tomcat-User.xml, the addition of specific management has not been contacted.

** Add a point -------------------------- >>> Tomcat in the default main directory is WebPages / root >>> Host AppBase is set to the default site. DocBase in Context is the virtual directory address on the server.

The upper side may not have 10% of the Tomcat function application, the initial contact, and some gains, and will continue to work hard.

?

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

New Post(0)