SharePoint 2016/2013 Administration : How to Create Host Header Site Collections

A host-named site collection allows you to address a site collection with a unique DNS name, such as http://site001.prashant.com.

SharePoint decides the mapping of the Host Name with the Site Collection at the time of initializing SPSite Object. During the initialization Process SharePoint queries the SPWebApplication object to see if Host Header details are associated with the Site Collection and if there is no information returned on Host Headers then it becomes evident that this is a typical site collection.

If we inspect the ULS logs for Site Collections with Host Headers, we will see the entries like Site lookup found the host header site http://site001.prashant.com/Pages/default.aspx on the other hand if we inspect the same logs for Site Collections without Host Headers Looking up the additional information about the typical site http://serverName:Port/sites/site001

In this article we will look into the steps to create Host Header based Site Collections as per the following process –

1

Step 1: Add DNS Entry

  • Search for DNS on Windows Server

2

  • Select the Domain Name
  • Right Click and Select “New Host”

3

  • Enter new Host Name
  • Enter IP Address of the Hosting Server
  • Click Add Host

4

This will add a new Host Name entry in the DNS Catalog

5

 Step 2: Create Site Collection

Since we don’t have Web UI available to create the Host Header based Site Collections so the only option we are left with PowerShell only.

Following is the PowerShell command that we can use to create a Host Header based Site Collection-

New-SPSite “http://developerWorkspace001.PRASHANT.LOCAL” -HostHeaderWebApplication “http://developmentportal.prashant.local:2016” -Name “Developers Workspace 001” -OwnerAlias “Prashant\Administrator” -Template “DEV#0”

In this command we have the following parameters and their values:

1.1.png

Once you execute the PowerShell we can see the following output

6

We can verify the creation of the new Host Header Site Collection by going to

Central Administrator -> Application Management -> View All Site Collections

7

 

 

 

 

Step 3: Add Site Binding

Following is the PowerShell command that we can use to Add the Site Binding in IIS-

New-WebBinding -Name “Development – Portal” -IPAddress “*” -Port 2016 -HostHeader “developerWorkspace001.PRASHANT.LOCAL”

In this command we have the following parameters and their values:

2.1

Once the PowerShell executed successfully we can see the following output on the command prompt

8

We can verify the creation of Site Binding in the IIS by using following steps:

  • Search for IIS on Windows Server

9

  • Select the Web Application and click on Bindings Links as shown below

10

  • On the Site Bindings Window we can see a new Site Binding Added to the IIS

11

  • Select the Site Binding and Click Edit button to open Edit Site Binding window

12

This shows that Binding is created successfully.

Now lets’ visit the Host Header Site Collection by visiting the following URL:

http://developerWorkspace001.PRASHANT.LOCAL

 

Enter the credential when asked for

13

 

And there we are

14

 

That is all for this demo.

Hope you find helpful.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s