How to do it...

  1. Open Server Manager in Windows Server 2016. Click on the Tools menu and open IIS Manager.
  2. Expand the IIS server from the Connections panel. We get the listed Application Pools and Sites folder.
  3. Expand the Sites menu in the left-hand side panel under the computer name and click on Default Web Site. You can find it using this figure:
  1. Go to the Actions panel at the top-right and click on Bindings under Edit Site. You will get the default Site Bindings option:
  1. Here, you can see the only default information available, which has Type as http, Port number 80, and IP address * (asterisk), which means one IP address will be assigned automatically for each site. One server can have multiple IP addresses; for example, one IP is used for shared hosting, and we can also set up a different dedicated IP for individual sites for better bandwidth and performance.
  2. Click on the Edit button, and you will get the Edit Site Binding option, as highlighted in this figure:
  1. You know that we have selected the Default Web Site binding property. Hence, we are configuring the Default Web Site to be accessed through the hostname or IP.
  2. Enter the IP address; we are going to enter IP address 172.16.15.60. This IP address used in our demo case, but in your case it can be different. Before you start typing the IP address, make sure that it is your IP address, but you can keep the same example domain name. Enter the new hostname or domain name. We entered the host name v2mysite.com.
  3. Leave the default Port 80. Click on OK.

 

 

  1. Go to the Site menu of IIS Server Manager, which is available in the left side panel and select the Default Web Site. Rename it as v2mysite.com by either right-clicking on the get context pop-up menu to select Rename or under the Actions pane by clicking on Basic Settings to get the same option to rename it. Renaming the website is only for identifying the website.
  1. Now we are going to add v4mysite.com. Inside the Connections pane, click on the Sites menu, go to the Actions panel, and click on Add Websites.... You will get the Add Websites... window:
  2. We add the Site name v4mysite.com and select the Application pool 2and3.5AppPool.
  3. Leave the default directory as wwwroot. We add the IP address same as the server IP.
  1. Leave the port number as the default port number, which is 80. The hostname is v4mysite.com. Start Website immediately is the default option, checked. Click on the OK button.
  2. We will follow the same steps for adding more websites; we will create one more website with the name mysite.com.
  3. Now we have three websites created with three different names with the same IP address:
  1. Let's move to configure a few more steps to access these websites through the domain name.
  2. Go to the C: drive, open the Windows folder, and search for System32. Inside the System32 folder, open the drivers folder.
  1. There is an etc folder inside the drivers folder:
  1. Open the hosts file in Notepad. Make sure that Notepad opens with administrator privileges by right-clicking on the Notepad icon and clicking on Run as Administrator; it will only allow you to save the changes. Now we have to make the web site hostname entry:
  1. As shown in the previous figure, we made three website entries, which are mysite.com, v2mysite.com, v4mysite.com. All the site IPs are the same, 172.16.15.60. In your case, the IP address should be different.
  2. Save the hosts file and close it. Now you are done with all the configurations for multiple website hosting.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.240.21