Configure Tomcat multi-domain access

Source: Internet
Author: User
Tags website domain names

C: \ windows \ system32 \ drivers \ etc
Hosts file under
Changed:
127.0.0.1 localhost

127.0.0.1Www.greenmood.net

127.0.0.1 www.cms4j.cn

Tomcat server. xml file

Add
<Host name ="Www.greenmood.net"Appbase =" greenmood"
Unpackwars = "true" autodeploy = "true">

<Valve classname = "org. Apache. Catalina. Valves. accesslogvalve" directory = "logs"
Prefix = "greenmood_access_log." suffix = ". txt"
Pattern = "% H % L % u % T & quot; % R & quot; % S % B"/>


</Host>
Autodeploy = "true" automatic deployment --- "detects updates to Tomcat files, that is, directly modify the deployed files.

Hosts is a system file without an extension. It can be opened using notepad and other tools. Its function is to associate some common website domain names with their corresponding IP addresses to a "Database ", when a user enters a URL in the browser to log on to, the system will first automatically find the corresponding IP address from the hosts file. Once found, the system will immediately open the corresponding webpage. If not found, the system then submits the website address to the DNS domain name resolution server for IP Address Resolution.

Access address -------------> www.greenmood.net: 8080

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.