Tomcat Deployment Web Application

Source: Internet
Author: User


A summary of how Tomcat deploys web apps is summarized in the following four common ways:

1, "Replace the root directory"

The simplest way to webapps the directory under the root folder is your file, and then enter the localhost:8080/home name. suffix

If the home page is index.html, you can not add "/home name. suffix".


2. "Deploy with Console"

Access the Http://localhost:8080 and login via Tomcat Manager to access the deployment interface.


3. "Automatic deployment with Tomcat"

Copy the application to Tomcat's WebApps path, and the Tomcat will load automatically when it starts.


4. "Modify Server.xml File Deployment"

Open Tomcat's configuration file in Conf/server.xml with UE or EditPlus, and find the following:

.....
</Host>
.....

Add the following between host:

<context path= "/mywebapps" reloadable= "true" docbase= "D:/mywebapps" workdir= "D:mywebappsemp"/>

Path: Represents the route of the access, as in the above example, access to the application is: Http://localhost:8080/Mywebapps

Reloadable: Indicates that the class pack can be loaded automatically at run time under the classes and Lib folders

Docbase: Represents the address of the application, note the direction of the slash ""

Workdir: Represents the drop address of the cache file


5. "Add custom Web Deployment files (recommended, no need to restart Tomcat)"

Under the Tomcat installation directory Confcatalinalocalhost, there are three apps from Tomcat, feel free to copy one of the XML files, and then modify Docbase to point to your own application.

and rename the path, see the third method for each parameter. Or you can create a new XML file yourself (Note that this file name will be used as the path in the context, regardless of how the path in the file is set or not),

Copy the following and modify the appropriate path.

<context path= "/test" docbase= "f:/j2ee/yazd_war_3_0" debug= "0" privileged= "true" reloadable= "true" >

</Context>

Once the deployment is complete, you can access it by http://localhost:8080/your path name.

Tomcat Deployment Web Application

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.