Methods for deploying web applications using Tomcat

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.