How do I set the local domain name to what you need?

Source: Internet
Author: User

such as http://localhost:8080/myweb/index.jsp into www.melody.com

1. Add key-value pairs 127.0.0.1 www.melody.com in the Hosts file

2. Locate Server.xml in the Conf directory of Tomcat and add it under the

name: Set the virtual host name as localhost, please fill in the specific domain name in actual case

appBase: The directory where the application is stored

Context Path : Virtual directory, such as "/web", we access address www.melody.com/web as "/", Access address is www.melody.com

docBase:directory for Web applications

The host node also has 2 properties one for Autodeploy,unpackwars

unpackwars: If True,tomcat will automatically extract the war file

Autodeploy: If True, automatic deployment, Tomcat automatically detects file changes under the AppBase directory and automatically applies to the running WEB application.

<= "www.melody.com"=">       <   = "/" = "D:\myweb"/> </Host    >

3. Modify the Web. XML in the project to set the first page (to set the index.jsp as the main page)

< welcome-file-list >         < Welcome-file >index.jsp</welcome-file></welcome-file-list  >

How do I set the local domain name to what you need?

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.