The SP 2013 App model requires the use of Host Named Site Collection which in turn means the web application that will host the App domains must not have a host header. Line 1789 in AutoSPInstallerFunctions.ps1 forces the HostHeader option of New-SPWebApplication. I put an if block around it to check if the $webApp.name was equal to my portal name and if so call New-SPWebApplication without the -HostHeader option which worked for me.
As I am writing this, I'm thinking that another way to determined whether or not to call New-SPWebApplication with the -HostHeader option could have been to compare the $webApp.url to $xmlinput.Configuration.ServiceApps.AppManagementService.AppDomain -or- add a new configuration item under WebApplication named hostHeader that accepts either a true/false or an actual hostHeader that could be left blank.
Joe
Comments: ** Comment from web user: brianlala **
As I am writing this, I'm thinking that another way to determined whether or not to call New-SPWebApplication with the -HostHeader option could have been to compare the $webApp.url to $xmlinput.Configuration.ServiceApps.AppManagementService.AppDomain -or- add a new configuration item under WebApplication named hostHeader that accepts either a true/false or an actual hostHeader that could be left blank.
Joe
Comments: ** Comment from web user: brianlala **
Thanks guys will investigate this soon, good suggestions. Part of this would I think involve stopping the Default Web Site too, to avoid conflicts (since without a host header, the port/IP combination might not be unique)
Brian