Default access path for "Go" tomcat

Source: Internet
Author: User

Put in the application of the external network, the user is directly input domain name access, I believe no one behind also add a tail, and Tomcat's default directory is root, so we need to change its default directory.

Changing the default directory for Tomcat is simple, just need to modify the Server.xml.

Specifically, with the content tag between <Host></Host>, you can understand that each content represents an app.

The specific properties of the content are:

<context path = "" debug= "0" docBase = "/OPT/APACHE-TOMCAT/WEBAPPS/WSBM" reloadable= "true" privileged= "true" >
</Context>

The key in this is the Docbase and path properties, and Docbase sets the directory accessed by path. The value of docBase can be either an absolute path or a relative path relative to the value of "AppBase" (AppBase is a property of the host tag), and the value of the Path property must be an empty string, and he sets the access path. An empty string means no path (that is, the default path for Tomcat), and if you set it to "/AAA", then your Access path will be preceded by the domain name "AAA"

Another thing to note: The Name property of the host tag, which is the hostname, of course, you can understand that the access name is the domain name or IP address, the default value is localhost, must be changed to your domain name or access to the IP address, or you use non-localhost access is useless.

For example, your name is localhost, and you enter http://www.xxx.com in the address bar is not accessible to your app's still Tomcat home page. You must set it to www.xxx.com to access your app.

Default access path for "Go" 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.