Tomcat-Publishing Web Apps

Source: Internet
Author: User
Tags file url

The URL to access the Admin Web App is http://localhost:8080/manager/html.

User name and password settings: Open the Tomcat-users.xml file in the Conf subdirectory of the Tomcat installation directory, as follows:

<?xml version= ' 1.0 ' encoding= ' utf-8 '?>

<tomcat-users>

</tomcat-users>

Users can be added between <tomcat-users> and </tomcat-users> by adding a user below:

<role rolename= "manager"/> //Add a role

<user username= "Tomcat" password= "Tomcat" roles= "manager"/> //Add a user

All Web Apps in Tomcat are listed in the Applications table, and in the Commands column of the table there are some central management commands for each Web app:

Start to start the web App

Stop for stopping web apps

Reload for overloading Web applications

Undeploy for undoing web apps

The text box after the "Expire Sessions" button is used to fill in the session timeout for this web app, which defaults to 30 minutes and then clicks the "Expire Sessions" button to take effect.

There are three ways to publish a Tomcat app:

Method One:

1. Enter the Web application management interface

2, "context path (optional)" is the context path after publishing the Web App.

The "XML configuration file URL" is the full path to the Web application's profile. xml file, typically in the Web-inf directory of your web App

The war or Directory URL is the root directory where the Web app is located or the packaged war file.

Method Two:

Open "Conf/server.xml" with the editor and add the following before "</Host>":

<context path= "/wuhaixu" //Configure the name of the virtual directory

Docbase= "E:/programfiles/myeclipse2014/filedowmload/webroot" //virtual directory pointing to the actual directory

debug= "0" >

</Context>

Method Three:

Create a new XML file with the same name as the Web app, such as "Wuhaixu.xml", under the "Conf/catalina/localhost" subdirectory of the Tomcat installation directory.

<context path= "/wuhaixu" docbase= "e:/programfiles/myeclipse2014/filedowmload/webroot" debug= "0" >

</Context>

Tip: If you don't have a "conf/catalina/localhost" subdirectory, build one yourself.

Why put the Wuhaixu.xml file in the "Conf/catalina/localhost" subdirectory of the Tomcat installation directory? Open Server.xml can find such a text: <engine name= "Catalina" defaulthost= "localhost" >, which means that Tomcat by default, the name of the Web engine is taken as Catalina, The host is set to localhost by default.


Tomcat-Publishing Web Apps

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.