loading...

Microsoft IIS 10.0 – Creating a wildcard host

How to build a Docker Compose YAML files

In this recipe, we are going to create a wildcard host step by step on IIS 10.0. We will also create an HTTPS wildcard host and add an SSL certificate on it. We will edit the hosts file and make an entry for the created wildcard host.

Let’s move to the following sections, where we will be covering this in detail.

Getting ready

To step through this recipe, you will need a running IIS 10.0 instance. You should also have administrative privileges.

How to do it…

  1. Open Server Manager on Windows Server 2016. Click on the Tools menu and open IIS Manager.
  2. Expand the IIS server ( WIN2016IIS). We then get the Application Pools and Sites listed.
  3. Expand the Sites option. You will get the list of existing websites: mysite.com, v2mysite.com, and v4mysite.com.
  1. Click on the S ites folder, go to the Actions panel, and you will get the Add Website… option. You can see this highlighted in the previous figure.

 

 

  1. Click on Add Website. You will get the Add website window:
  1. We already have a website called v2mysite.com, so let’s create a wildcard host for it. In the Add Website window, we have already filled the details of the wildcard host and the site name, demo.v2mysite.com . The application pool has also been created by itself and has the same name as the the site. The site name is just a name you are using to identify it in a list of IIS 10.0 sites.

 

 

  1. Now move to content directory. You will get the physical path of the wildcard host. I’ve created a folder called Demo in c:\inetpub\wwwroot\v2mysite\, as shown here.
  1. Set pass-through authentication as the default. In the Bindings section, select type http and enter IP 172.16.15.60. This is our server IP associated with v2mysite.com. Leave the default port at 80 and move to the host header. The host header is your website’s name, also known as domain name or host name. We are adding our wildcard host name, demo.v2mysite.com. Click on the OK button.
  2. Let’s add one more wildcard host, SSL.v2mysite.com. We will use the HTTPS protocol to access this wildcard host.
  3. Go to IIS Manager, click on the Sites folder, and go to the Actions pane.
  4. Click on Add Website. You will get the Add New Website window. We’ve added the details of the site name, SSL.v2mysite.com . Keep the application pool at the default, SSL.v2mysite.com.
  5. Set pass-through authentication as the default. In the Bindings section, select type http and enter IP 172.16.15.60. This is our server IP associated with v2mysite.com, but in your case the IP address should be different. Leave the default port at 443 and come to the host header. The host header is your website’s name. We will set it to our wildcard host name, ssl.v2mysite.com . We’ve already created the SSL certificate wildcard.
  1. Click on the OK button. Now come to IIS Manager, and you will see in the Sites folder that there are two wildcard hosts created.
  2. Now, you have to make one more setting in the hosts file. While we are not using the DNS for host names or domain names of websites, we will make the domain name or host name entry in the hosts file, which is located in C:\windows\system32\drivers\etc. The hosts file also converts the domain name to an IP for the local server:
  1. Open the hosts file in Notepad using administrator rights. Make the entry highlighted in the following screenshot:
  1. Now you are done with all the required entries for the domain SSL.v2mysite.com and IP 172.16.15.60. Press the Tab button and type the domain name SSL.v2mysite.com and one more entries for domain demo.v2mysite.com and IP 172.16.15.60.

 

How it works…

In this recipe, we added a wildcard host called http://demo.v2mysite.com. Also, we added one more wildcard host with the HTTPS protocol, https://ssl.v2mysiste.com. We then assigned it to the https://ssl.v2mysite.com wildcard host.

Comments are closed.

loading...