Tomcat set port number and default WebApp

Source: Internet
Author: User

Tomcat download, unzip after the WebApps directory comes with several webapp:

* Docs Documentation: This is a static page set that you can read without starting Tomcat

* Examples of examples

* Hostmanager Host Manager

* Manager Application Manager

* Root directory: This app can access the above four apps, the app is the default app, this app is very simple, only some resource files and a JSP page.

After you install Tomcat, start Startup.bat in the bin directory. In the browser address bar input localhost:8080, carefully read the homepage, this page is very important, all-encompassing, you can enter the document, you can go to the configuration ...

With the document, do not need Baidu, do not need to download documents from the official website Doc-full.zip, carefully read, all the questions here can find the answer.

I. Modify, add a port number

The default port number for the Tomcat default port is 80 for the 8080,http service. After entering the IP or domain name in the browser address bar, if you do not enter a port number, the default is 80 port.

Modify the Conf/server.xml file under the Tomcat directory, the service tag can have multiple connector, and then add a 80 port connection to it.

<connector port= "8080" protocol= "http/1.1"               connectiontimeout= "20000"               redirectport= "8443"/> < Connector port= "protocol=" http/1.1 "               connectiontimeout=" 20000 "               redirectport=" 8443 "/>

Two. Set the default app

To add a context tag and set docbase, note that the path delimiter in Java always follows the '/' to be correct.

 

In fact, the approach described above is an unwise one, and the best policy is to change the name of WebApp directly to Root,tomcat default root directory is the default WebApp

Tomcat set port number and default WebApp

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.