Thursday, November 8, 2012

SharePoint Host Named Site Collections


      I was never aware of this feature(Host Named Site Collections) in Sharepoint until 2-3 years back. I got the buzzword from one of my seniors. I did some reading about it and forgot about it as I never had a use for it. Recently I stumbled over this again and this time I thought of trying it out in one of my development VM's.

So to begin with......what is a Host Named Site Collection (HNSC)

Host Named Site Collection (going forward, I will be using HNSC) is the best option if you want to create multiple root-level site collections within a web application. (i.e. unique URL for your site collections. Cool……right? That is what I thought so)

In SharePoint, we have support for both path-based & HNSC.The basic difference is: 

All path-based site collections in a Web application share the same host name (DNS name), whereas each HNSC in a Web application is assigned with a unique DNS name.

In simple words:
HNSC allows you to create as many root-level host-named sites within a single Web application.
http://newsite.customer.com
http://www.testhnsc1.com

With path-based sites, you are limited to a single root-level site collection within a Web application
http://www.fahad.com/sites/site1
http://www.fahad.com/sites/site2

So....yeah...we can have HNSC. But with it come some advantages and disadvantages.

Advantage/Dis-advantages:

Host Named Site Collection (HNSC)

·         We can have fancy URLs for our site collections. We have more control over URLs.

·         Host headers cannot be applied at the Web application (IIS site) level, and doing so makes it impossible to access HNSC.

·         HNSC have a single (unique) URL. So they do not support alternate access mappings and are always considered to be in the Default zone.

·         Most importantly Alternate Access Mappings don’t work with HNSC. You can't use both HTTP and HTTPS together.

·         It can scale to thousands of site collections because they can all exist within a single Web application and still offer vanity naming capability.

·         This helps in hosting multiple tenants on the same farm(multi tenancy)

 
Path-Named

·         All 5 zones are available for Path based sites.
    
     ·         Alternate Access Mappings is very much supported (supports SSL)
   
     ·         User is limited to a single root-level site collection within a Web application
 
Powershell script for creating a HNSC

Well, before executing the below powershell script, we would have to create a web application without Host header.

New-SPSite http://www.testhnsc1.com -OwnerAlias Domain\username -HostHeaderWebApplication <Web-App-URL>

This creates a HNSC with the URL http://www.testhnsc1.com  in the SharePoint 2010 Web Application with the URL <Web-App-URL>


Related Post :  Implementing Host Named Site Collection , Sharepoint Multi Tenancy and Host Named Site Collection 

1 comment:

  1. Hi

    How can I migrate a Path-based site collection (already >200 GB) to several HNSCs?
    Target:
    1) reduce content-DB size
    2) resume with former access links to a specific content

    Regards Martin

    ReplyDelete