Bind two domain names to the same IP address

Source: Internet
Author: User
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">

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.