The basic use of tomcat

Tomcat
1. Compatible correspondence:
Here Insert Picture Description
2.tomcat each folder:
bin folder:
bin folder to put the following is an executable file, in which: bat / exe file is an executable script file under windows. Linux / Unix under the executable script file sh file.
bootstrap.jar can be seen from the file name of this package is a jar jar bootstrap package, the entrance of tomcat.
catalina.bat this script is more important. The script completed many of the basic operations, such as starting Close and so on, catalina.bat involved.
Perform a variety of documents, a variety of roles.
conf (configurator) folder:
put the configuration file:
catalina.policy Tomcat policy file
catalina.properties catalina configuration file
context.xml tomcat environment configuration utility can also be configured in server.xml
logging.properties log configuration file
server. xml very important configuration, port, so you need to configure the thread pool here.
Here Insert Picture Description
lib folder
lib folder below put the jar package, the repository file tomcat provided. tomcat needed for the operation.
Log folder
log in folders tomcat log files
in the Temp folder
temp folder for temporary files
webapps folder
Tomcat webapps folder is a directory of web publishing project, the default storage of the documents, examples, host configuration and other documents.
work folder
class file storage jsp compilation.
3. deployment in Java:
1. Static deployment:
Tomcat The Tomcat Webapps directory is the default application directory when the server starts, it loads all applications in this directory. We can divide our projects directly copied to this directory, or labeled as a war on the package directory. Loads all items under this item directly at startup. Not recommended, the server starts slow, static.
2. Specify (I like it) in server.xml
in Tomcat configuration file, a Web application is a specific Context, you can deploy a web application through the New Context in server.xml. Open server.xml file, a built-in Context Host tag, as follows:
in the tomcat conf directory in the server.xml, add a node:
<Context path = "crm" (access path name) docBase = "D: \ workspace \ myjavaweb \ webApp" ( project path) Debug = "0" Privileged = "to true">

Here Insert Picture Description
3. configure a tomcat server in eclipse and then add items into it, start the service on the line.
4. Deployment maven:
using tomcat-maven plug, then add the following code in the pom.xml and modified accordingly:

Here Insert Picture Description
Summary: Static deployment We generally do not use. Maven way suitable for direct deployment on the server. Way Server.xml and services for our local server debugging. When deployed to linux, we generally use hot deployment of tomcat.

Guess you like

Origin blog.csdn.net/qq_41703795/article/details/93306921