Virtual Host: Multiple Web sites running on the same server
Implementation: Based on the IP address, based on the port number (default 80, modify any of the above 1024); host-based name (HOST,DNS)
The host method needs to be modified on the c/windows/system32/drivers/etc.
Experimental content: Build a Web server in server2016, and then create 2 pages, respectively, mainly for the city and happy home. The Web site is then run through three ways, such as IP address, port number, and host name.
First build the Web server on the server2016, in the Server Manager -- add roles and features --then check the Web server (IIS)in the server role , and then start the installation.
Click Start -Windows Tools Management -Internet information Services (IIS)
Add a site and rename it. Next go to the physical path of each website, modify the content of each website (physical path can be viewed by clicking the site right-click, Manage website -- Advanced Settings )
After we run the website through the IP address, first set the virtual machine two network card IP address and host communication, and then bind the site in IIS Manager (right click Site Edit binding )
Then we can enter the URL on the host to test.
Test results, the site can operate normally.
The second type, based on the port number. This method and the first one only need an IP address, in the edit binding with a unified IP address, the port number changes can be different.
Test results on the host.
The site will run as usual.
The third type, based on the host name. Requires two URL IP, the same port number, the machine name is not the same.
Then on the host c/windows/system32/drivers/etc,hosts file inside the last add IP address and host name, to drag out to modify.
Final Test results
The site can run as usual and the experiment succeeds.
Note: Sometimes the first kinds of errors, mainly focus on the physical path to put the default text, some URLs on the host can not be tested or the reason for the firewall, so try to turn off the firewall test.
server2016 Web server & three virtual host Labs