SharePoint for Web Hosters: Host Header-based Site Collections

written by Matt Ranlett on Wednesday, February 27 2008

If you weren't aware of it, a lot of thought went into SharePoint in terms of making it a viable platform for web hosting.  You can use Active Directory OR Forms Based Authentication.  You can actually read the entire 126 page document titled Creating Shared Hosting Solutions on Windows SharePoint Services 3.0 for yourself if you want to know more.

 NOTE worth mentioning: You can still use account creation mode in Active Directory with WSS 3.0, but Microsoft seems to already be announcing that this will not be supported in WSS 4.0 and beyond (page 36, section 7.1.1).

One of the coolest things you can do is create host header based site collections, granting a single SharePoint web application the ability to contain http://www.contoso.com and http://www.fabrikam.com.  Not web applications or extended web applications, but actual site collections.  Given that Microsoft recommends a maximum limit of 20 Web Applications on a farm, the ability to use site collections as the entry point for host headers is very significant (expanding the potential total number of sites on a single farm into the thousands).

The easy to find guidance online tells you that executing the STSADM command with the -hhurl (or -hostheaderwebapplicationurl) switch will create your new site collection, but there are some problems I ran into which I'm going to share with you.

First, here is a sample command:

stsadm -o createsite -url http://SITE-COLLECTION-VANITY-URL -ownerlogin DOMAIN\username -owneremail username@domain.com -hhurl http://WEB-APPLICATION-URL

More details on CreateSite

If you browse to this site, you should get a prompt to select a site template.  At this point you can pick a default template, one you've uploaded, or you can go back to STSADM and import the settings from an existing site collection (similar to backup and restore, which might also work).  Of course, there is an option switch to the CreateSite command which lets you pick the template in the format of STS#1 (for blank sites).

The problem I encountered was that I kept getting 400 Bad Request errors back from IIS when I tried to browse to the site.  I tried putting the URL in the system's HOSTS file but that didn't help.  I ended up having to manually add the host header to the Web Application's Virtual Directory in IIS per this image:

IIS Advanced IP handling

Similar Posts

  1. Collaborate over the Internet with OneNote and Office Live
  2. Copying Site Collection options
  3. Strange Problems with a mysteriously corrupted list

Comments are closed

Options:

Size

Colors