0

I would like to create 2 or 3 Separate Web Applications that will have Host-Named site Collections. Is this possible without binding additional IP addresses? Can this be scripted via PowerShell?

0

OP: Is this possible without binding additional IP addresses? Yes

OP: Can this be scripted via PowerShell? Yes

Refer to Mark Arend's excellent blog post Host Named Site Collections (HNSC) for SharePoint 2010 Architects (MSDN Blogs) under Option 3 – Identify by Host Header.

While the config is more fussy than the other options, if your requirements or platform do not allow multiple IPs then it does the trick. Mark's blog post includes full PowerShell examples. Here is quick preview of his scripts:

#Once per server node in farm
New-WebBinding -Name "Standard" -HostHeader "sitename.customer.com"

#Once for the farm
New-SPSite http://sitename.customer.com -HostHeaderWebApplication http://Standard -Name "Our Work Site" -Template "STS#1" -OwnerAlias CUSTOMER\Administrator

I have successfully implemented several farms this way.

0

They will need separate IP addresses as they have no hostname to bind to within IIS. You can use New-SPWebApplication to create the Web Applications.

  • So I guess I then put in DNS, the other IP Address for the "Path Based site collection" created at the root of the new Web App and the DNS for the first HNSC ? – Bismarck May 17 '16 at 18:37
  • For multiple Web Applications using HNSC (hence, no hostname) you would need to add multiple IPs to each SharePoint server and bind each IIS to a unique IP address on that server. For Web Applications using path-based Site Collections, they have a host header and can share an IP address with multiple Web Applications and even one HNSC-based Web App. – Trevor Seward May 17 '16 at 18:50
  • It would be nice if "New-SPWebApplication" allowed me to specify an IP Address. When I created the Second Web app after setting the IP address on the first, the command fails stating port 80 is already in use. I think what I'll do is create them on Non Port 80 and then use Remove-WebBinding and New-WebBinding to reset the IP and Port before creating the root Site collection. – Bismarck May 17 '16 at 20:18
  • @TrevorSeward are you familiar with Mark Arend's blog post quoted in my answer? Is there a problem with his Option #3 which does not require multiple IPs? – JohnC Oct 11 '16 at 19:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.