From: http://blog.163.com/sunfollower@126/blog/static/114526090200932244449324/
You can deploy a web application using tomcat in the following ways:
1. Copy your war file or your web application folder (including all the content of the Web) to the $ catalina_base/webapps directory.
2. Create an XML fragment file that only contains context content for your web service and put the file in the $ catalina_base/webapps directory. This web application can be stored anywhere on the hard disk. This context snippet provides a convenient way to deploy Web applications. You do not need to edit the server. XML, unless you want to change the default deployment feature, you do not need to restart Tomcat when installing a new Web application.
3. in the same method 2, the context fragment is placed in the catalina_base \ conf \ Catalina \ localhost directory. this method is more effective than method 2. After many experiments, I found that method 2 is not as useful as this method later. the former system cannot be opened multiple times.
4. directly on the server. in XML,
In addition, to allow tomcat to only run the web application specified in CONF/server. XML, you can use the following methods:
Implementation 1:
1) Place the web application to be deployed in a path other than webapps, and specify it in docbase in the context of server. xml.
2) Delete all folders in webapps and all XML files under CONF/Catalina/localhost.
Note: webapps is the appbase attribute value of the host element in server. xml. Implementation 2:
1) modify the attribute of the host element in server. XML to add or modify: deployxml = "false" deployonstartup = "false" autodeploy = "false"
2) meaning:
Deployxml = "false": Do not deploy the corresponding XML Web application under CONF/Catalina/localhost.
Deployonstartup = "false": When Tomcat is started, all web applications under webapps are not deployed.
Autodeploy = "false": prevents Tomcat from deploying web applications under webapps again when scanning for changes.