Kitty Tomcat is actually very cute.
At the end of 2003, I changed the company, also changed the Webapp,tomcat appeared in front of Me (formerly using WebLogic), I am a bit dazed, free things really can use good? worry about ing ... (In fact, spent too long on Mars) went out to inquire, originally this cat from the-jakarta project, the 2001 Most innovative Java products (Most innovative Java product), Also has the Java boss Sun's strength (the official recommended servlet and the JSP container), later depended on it to eat. Don't say flat, get up first:
1, installation
The latest version of Tomcat is 5.0.29 (http://jakarta.apache.org/site/binindex.cgi)
If it can automatically find your JDK or set JAVA_HOME=C:/JDK under Windows
In Linux you need to unpack first, then set Java_home
Export JAVA_HOME=/USR/LOCAL/JDK
2, RUN
After Setup, you can run the Tomcat server, enter Tomcat's Bin directory, and start Tomcat under Windows with startup. Linux with startup.sh, the corresponding turn off Tomcat command for shutdown and shutdown.sh.
After starting the service in the browser input: 8080/To test
3, directory structure
Bin: Store startup and shutdown Tomcat scripts.
Conf: Contains different profiles, Server.xml (Tomcat's primary configuration file).
Work: Store the JSP generated class file after compiling.
Webapp: Store The Application sample, and the application you want to deploy in the future will also be placed in this directory.
Logs: Storing log files
Comm./server/shared: The Lib folder under these three folders puts the jar file.
1. Configure Server.xml Files
There's nothing to say, look at Tomcat's documentation more useful, here are some of the main things.
Element name |
Property |
Explain |
Server |
Port |
Specifies a port that listens for the request to shut down Tomcat |
Shutdown |
Specifies the command string to send to the port |
Service |
Name |
Specify the name of the service |
Connector (indicates the connection between client and service) |
Port |
Specifies the port number to be created on the server side and listens for requests from the client on this fracture surface |
Minprocessors |
Number of threads created at server startup to process requests |
Maxprocessors |
Maximum number of threads that can be created for processing requests |
Enablelookups |
If true, a DNS query can be made by calling Request.getremotehost () to obtain the actual hostname of the remote client and, if False, not a DNS query, but rather a return of its IP address |
Redirectport |
Specifies a port number that is redirected after an SSL transfer request is received by the server while processing an HTTP request |
Acceptcount |
Specifies the number of requests that can be placed in the processing queue when all available processing requests are used, and requests that exceed this number will not be processed |
ConnectionTimeout |
Specify the number of times to timeout (in milliseconds) |
Engine (represents a request processor in a specified service, receiving and processing requests from connector) |
Defaulthost |
Specifies the host name of the default processing request, which is at least the same as the Name property value of one of the host elements |
Context (representing a Web application, usually a war file, and specific information about war see servlet specification) |
DocBase |
Path to the application or the path that the war file holds |
Path |
A prefix representing the URL of this Web application, so that the requested URL is: 8080/path/**** |
Reloadable |
This property is very important, and if true, Tomcat automatically detects changes to the/web-inf/lib and/web-inf/classes directories of the application, automatically loads new applications, and we can change the application without having to restart Tomcat |
Host (represents a virtual host) |
Name |
Specify host Name |
AppBase |
Application base directory, which is the directory where the application is stored |
Unpackwars |
If true, Tomcat automatically extracts the war file, otherwise does not understand the pressure, and runs the application directly from the war file |
Logger (for logging, debugging, and error messages) |
ClassName |
Specifies the class name used by Logger, which must implement the Org.apache.catalina.Logger interface |
Prefix |
Specifies the prefix of the log file |
Suffix |
Specify the suffix of log file |
Timestamp |
If true, time is added to the log file name, as in the following example: Localhost_log.2001-10-04.txt |
Realm (a database that holds user names, passwords, and role) |
ClassName |
Specifies the class name used by realm, which must implement the Org.apache.catalina.Realm interface |
Valve (features similar to logger, whose prefix and suffix properties are interpreted in the same way as in logger) |
ClassName |
Specifies the class name used by valve, such as the use of the Org.apache.catalina.valves.AccessLogValve class to record access information for the application |
Directory |
Specify where log files are stored |
Pattern |
There are two values, common the remote host name or IP address, username, date, the first line of the requested string, the HTTP response code, the number of bytes sent. Combined is more than the common way to record |