Modify the contents of the Server.xml engine under the Conf folder to
The original content is as follows:
...<Enginename= "Catalina"Defaulthost= "localhost"> <RealmClassName= "Org.apache.catalina.realm.UserDatabaseRealm"resourcename= "Userdatabase"/> <Hostname= "localhost"AppBase= "WebApps"Unpackwars= "true"xmlvalidation= "false"Xmlnamespaceaware= "false"> </Host> </Engine>...
Assume
(1) You have only one IP address: 125.125.125.125
(2) then made three websites: Baidu, Google, admin backstage
(3) applied for two domain name www.baidu.com www.google.com www.system.com
(4) Requirements: With different domain names, IP addresses can access different websites
Then you can do it.
The first step: Modify the Conf folder below the Server.xml, the modified content is as follows
...<Enginename= "Catalina"Defaulthost=www.baidu.com><realm ClassName= "Org.apache.catalina.realm.UserDatabaseRealm"resourcename= "Userdatabase"/> <Hostname= "Www.baidu.com"AppBase= "Baidu_apps"Unpackwars= "true"xmlvalidation= "false"Xmlnamespaceaware= "false"/> <Hostname= "www.google.com"AppBase= "Google_apps"Unpackwars= "true"xmlvalidation= "false"Xmlnamespaceaware= "false"/> <Hostname= "www." system. com "AppBase= "System_apps"Unpackwars= "true"xmlvalidation= "false"Xmlnamespaceaware= "false"/> </Engine>...
Step two: Below the Tomcat root directory
Baidu_apps\root to place your Baidu website
Google_apps\root to place your Google site
System_apps\root to place your admin background
Step three: Resolve the domain A record to IP125.125.125.125.
If you want baidu.com to also have access to the app, add a host record and baidu.com resolution A to IP125.125.125.125.
<name= "baidu.com" appBase= "Baidu_apps" unpackwars = "true" xmlvalidation = "false" Xmlnamespaceaware = "false" />
Tomcat one IP binds multiple domain names, different domains access different applications