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 –
https://howtodowithsharepoint.files.wordpress.com/2016/03/113.png?w=800
Step 1: Add DNS Entry
- Search for DNS on Windows Server
https://howtodowithsharepoint.files.wordpress.com/2016/03/25.png?w=800
- Select the Domain Name
- Right-click and select “New Host”
https://howtodowithsharepoint.files.wordpress.com/2016/03/33.png?w=800
- Enter new Host Name
- Enter IP Address of the Hosting Server
- Click Add Host
https://howtodowithsharepoint.files.wordpress.com/2016/03/43.png?w=800
This will add a new Host Name entry in the DNS Catalog
https://howtodowithsharepoint.files.wordpress.com/2016/03/53.png?w=800
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:
https://howtodowithsharepoint.files.wordpress.com/2016/03/1-1.png?w=800
Once you execute the PowerShell we can see the following output
https://howtodowithsharepoint.files.wordpress.com/2016/03/63.png?w=800
We can verify the creation of the new Host Header Site Collection by going to
Central Administrator -> Application Management -> View All Site Collections
https://howtodowithsharepoint.files.wordpress.com/2016/03/73.png?w=800
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:
https://howtodowithsharepoint.files.wordpress.com/2016/03/2-1.png?w=800
Once the PowerShell executed successfully we can see the following output on the command prompt
https://howtodowithsharepoint.files.wordpress.com/2016/03/83.png?w=800
We can verify the creation of Site Binding in the IIS by using following steps:
- Search for IIS on Windows Server
https://howtodowithsharepoint.files.wordpress.com/2016/03/92.png?w=800
- Select the Web Application and click Bindings Links as shown below
https://howtodowithsharepoint.files.wordpress.com/2016/03/102.png?w=800
- On the Site Bindings Window we can see a new Site Binding Added to the IIS
https://howtodowithsharepoint.files.wordpress.com/2016/03/114.png?w=800
- Select the Site Binding and Click Edit button to open Edit Site Binding window
https://howtodowithsharepoint.files.wordpress.com/2016/03/122.png?w=800
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
https://howtodowithsharepoint.files.wordpress.com/2016/03/132.png?w=800
And there we are
https://howtodowithsharepoint.files.wordpress.com/2016/03/142.png?w=800
That is all for this demo.
Hope you find helpful.