Tomcat Deployment site Remove port number and project name

Source: Internet
Author: User

At the end of a project, it is often mapped directly to an IP address as needed. At this point you need to remove the port and project name, in the time of the visit. The following examples provide a way to implement this.

1. When entering Tomcat_home, create a folder and name it WebDB (here is webdb, which can be modified to other names as needed. )。

2. Go into the WebDB folder and create a folder in which root (where Root is capitalized), and copy the contents of your project back to root. Then enter the Tomcat_home/webapps, Balancer folder back to the WebDB folder.

3. In Tomcat_home/conf/server.xml, find this sentence:

Unpackwars= "true" autodeploy= "true"
Xmlvalidation= "false" Xmlnamespaceaware= "false" >

Then replace the WebApps webdb in the appbase= "WebApps".

Unpackwars= "true" autodeploy= "true"
Xmlvalidation= "false" Xmlnamespaceaware= "false" >


4. In this way, when you visit the project, you can access it by removing the URL of the project name. Here is a catalogue of such a map for your reference.

5. Remove the port number without having to say it in detail. is to open the Tomcat_home/conf/server.xml to find the original port number (such as 8080), after modification to 80, you can access without entering the port number. However, be careful to prevent other programs from taking up port 80.

6. Some friends may say, why not delete the contents of root in the WebApps, and then copy the item back to root, so you can achieve the desired effect. I think so, in fact, there are many ways. All roads lead to Rome. One of the benefits of doing this is that when you use the Tomcat console, you can change the catalog back in a very text way.


This article from Csdn Blog, reproduced please indicate the source: http://blog.csdn.net/liuyf8688/archive/2006/10/16/1337131.aspx

Two

Open Tomcat5.5/conf/server.xml, add <Context> segment to


XML code




<context path= "" docbase= "D:/eforum" reloadable= "true" debug= "0" privileged= "true" >



</Context>

Server.xml for configuration on

<context path= "" docbase= "D:/eforum" reloadable= "true" debug= "0" privileged= "true" >



</Context>

Docbase for the name of the project that you want to display by default, if you do port mapping, you can access your home page in the form of Http://IP.

Three, is mentioned above, the project directly to the root, replace the content of 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.