Tomcat configures multiple domain names for multiple applications

An example to illustrate the problem:
1. Copy two webapps and name them hosta and hostb respectively



2. Modify the host in server.xml in the conf folder. (path cannot be empty)
As shown below:


Because there is no DNS resolution, change the local hosts file to simulate a DNS resolution server
That is to modify the hosts under C:\Windows\System32\drivers\etc.
Open aaa.com:8080 in the browser to open the application under hosta
Open bbb.com:8080 in the browser to open the application under hostb
Modify as follows:




Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327053956&siteId=291194637