Virtual host built by IIS Web

Time:2019-11-11

Virtual host built by IIS Web

Virtual directory: it can store the files of a website in different directories of the same computer and other computers.

Benefits of using virtual directories:

1. Store the data on different disks or computers, which is convenient for development and maintenance.

2. When the data is moved to another physical location, it will not affect the logical structure of the web site.

Client access format:

Http: / / pqdn / virtual directory name

Http: / / IP address / virtual directory name

Experimental environment:

Windows 2008 (install IIS service)

Test environment: win10

Experiment purpose: using different methods to build virtual host website

1. The same IP, different ports

2. The same port of different IP

3. Different host name, same IP and port

Experimental steps:

One, the same IP, different ports

1.1 create two new sites and set the IP address to the same IP, but the ports are different

  

  

1.2 testing on the client

Note that when the service set up by the server uses other ports (such as port 8080 in this example), you need to set rules in the firewall to release or close the firewall

This example is to create a new rule in the firewall that allows port 8080 to enter

  

Test the two built sites on the client

  

  

II. The same port is not available for IP

1. Add multiple IPS to the server

  

  

2. The binding IP of the two websites is different, but the binding port is the same

  

  

3. Test separately on the client side, and you can visit the built site

III. different host names, same IP and port

1. Set the host names of the two sites respectively. The IP and port are the same

  

  

2. In the client test, you need to add two records to the hosts file of the client or install DNS service on the server, and then set DNS on the client

Path to hosts file: C: \ windows \ system32 \ drivers \ etc \ hosts

  

3. Test: visit the two sites set up in the server through the domain name, and you can visit