How to deploy Web Apps in Tomcat

Source: Internet
Author: User

There are several ways to deploy Web apps in Tomcat:

    • Leveraging Tomcat's automated deployment

Copy a web app to Tomcat's WebApps and the system will deploy the app to Tomcat. This is the simplest and most common way.

    • Deploy with the console
    1. Start Tomcat, in the command-Line Execution window, CD D:\Program files\java\apache-tomcat-8.0.23\bin, and then Startup.bat
    2. Browser Login http://localhost:8080
    3. Go to the Manager app console (need to add Username:manager,password in D:\Program files\java\apache-tomcat-8.0.23\conf\tomcat-users.xml : Manager,role:manager-gui)
    4. Go to the Manager console page, and in Deploy, enter the context path, such as/AAA, to enter the war or Directory URL, such as C:\Users\Lihaohong\Desktop\deloyTest
    5. Complete. is essentially using Tomcat's automated deployment
    • To add a custom Web Deployment file

Under the Conf\catalina\localhost directory, create a new name for any XML file-the configuration file that deploys the Web app, and the file's primary file name 祝偶 the virtual path of the Web App.

For example, we add a dd.xml file under Conf\catalina\localhost\, the contents of which are as follows:

<docBase= "G:/publish/codes/01/aa"  debug= "0"  Privileged  = "true"></Context>

The above configuration file docbase specifies the absolute path to the Web app, and starting Tomcat,tomcat again will deploy the Webdemo folder under that path as a web app. The URL address for the app is:

Http://<server_address>:<port>/dd

Where DD in the URL is the main name of the Web deployment file.

    • Modify the Server.xml file Deployment Web App (you need to modify the Server.xml file in the Conf directory, modifying the file may corrupt Tomcat's system files, so it is not recommended)

How to deploy Web Apps in Tomcat

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.