Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to create a web application using powershell. Below is a list of commands I execute to achieve this and all works fine. Web application exists everywhere. But I cannot access it by it's url. I think I don't have a good underestanding of "HostHeader" thing.

When I type web application url in my browser I get an error indicating that the broswer cannot find this web site.

And I Insist to use powershell not central administration.

$user = Get-SPManagedAccount "Pouyanserver\Administrator"

$auth = New-SPAuthenticationProvider

New-SPWebApplication -Name "Mahan Air" -port 8080 -HostHeader "MahanAir" -url             "MahanAir:8080" -ApplicationPool "Mahan Air" -ApplicationPoolAccount $user -AuthenticationProvider $auth

what is the problem ? and what is the host header anyway ? when it just does not work?

share|improve this question
    
you have a web application, but did you create a site collection at its root? –  Derek Gusoff Sep 21 '13 at 11:51
add comment

1 Answer

up vote 0 down vote accepted

Host header is the part of the URL, e.g. it is the "mysite" in http://mysite.example.com. You need to make sure you configure DNS to have an A record of "mysite" that points to the IP address assigned to the IIS site in the IIS Manager.

share|improve this answer
    
How can I configure my dns ? for example if I say that my host header is "MySite". Then how should I tell the system that "Mysite" actually refers to localhost with a different port ? –  Pouyan Sep 20 '13 at 17:31
    
You would make sure that IIS responds to "mysite" (check the IIS Site Bindings in the IIS Manager) on the appropriate port (you can use 80, or another port if desired). In DNS, you would create an A record of "mysite" that points to the IP address of the IIS site binding. How you set up the record in the DNS server depends on the DNS server software (e.g. it is Microsoft DNS, or BIND, etc). –  Trevor Seward Sep 20 '13 at 17:35
    
IIS Binding is ok ... it says that you can access this web application by "mysite" on Port 8080. But I don't know about DNS ? I think I don't have DNS server role installed on my server ... how can I add a dns record ? –  Pouyan Sep 20 '13 at 17:47
    
You should have DNS installed elsewhere. If you have Active Directory (which you should), then it would likely be on the Domain Controller(s). –  Trevor Seward Sep 20 '13 at 18:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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