Tomcat Virtual Host build Web site

Source: Internet
Author: User
Tags documentation html page tomcat tomcat server

Tomcat configuration completes the virtual host, you can build a Web site in a virtual host to create a Web site

First, in the D drive, create a newhost directory, copy the good Chapter02 application to the Newhost directory, and then change the contents of the welcome.html page to "This is Newhost file in welcome.html directory"

Configuring the Server.xml file

In the Server.xml file, add an element that
The Name property is set to: Itcast
The AppBase property is set to: D:\newhost
Specific code

 

Configure virtual host and IP

In the Hosts file of the Windows system, configure the mappings between the virtual host and the IP address
Specific code
127.0.0.1 Itcast

Note

Don't add the # number in front, #号表示注释
If you add the # number, you will not be able to access the Itcast virtual host to restart the Tomcat server

In the address bar of the browser, enter the address
Http://itcast:8080/chapter02/welcome.html
Show results

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.