Document directory
- 1 Overview
- 2 prerequisites
- 3. Procedure
Technorati tags: IP, domain name
Bind two domain names to the same IP address
1 Overview
Assume that two domain names www.test1.com and www.test2.com have been applied for at the ISP, and the public IP bound to the server is 192.168.1.100.
Test1 is an application of Apache on the local machine. The access URL is http: // 192.168.1.100/test1.
Test1 is an application of Apache on the local machine. The access URL is http: // 192.168.1.100/test2.
Now, you must enter www.test1.com in your browser to access the home page of http: // 192.168.1.100/test1. Enter www.test2.com to access the home page of http: // 192.168.1.100/Test2.
2 prerequisites
1) only one Apache server can be running.
2) under the Apache webapps directory, two application directories are test1 and test2.
3. Step 3.1 Add a ing in server. xml
Find the following code
Unpackwars = "true" autodeploy = "true"
Xmlvalidation = "false" xmlnamespaceaware = "false">
Add
In this way, you can enter www.test1.com to reach http: // 192.168.1.100/test1.
3.2 add virtual host in server. xml
Add a new host node. The Code is as follows:
Unpackwars = "true" autodeploy = "true"
Xmlvalidation = "false" xmlnamespaceaware = "false">
In this way, you can enter www.test2.com to reach http: // 192.168.1.100/test2.
In fact, it can be solved without 3.1. Simply adding two virtual machines can also be solved, as long as the following code is added.
Unpackwars = "true" autodeploy = "true"
Xmlvalidation = "false" xmlnamespaceaware = "false">