locked
How to use Host headers for SharePoint site ? RRS feed

  • Question

  • Hi all

    I have a running site on port 80

    I then have created aother new web application and a site collection (collaboration) using the port which was displayed by default while creating the web application, where now the Url is htt://servername :47854

    Now if I want to provide a valid url to the above url what are the suggested steps,

    Should that be achieved with the Host headers or DNS entry.

    Please provide the steps

     

    Thanks …

    satyam

    Tuesday, November 10, 2009 7:12 PM

Answers

  • Out of the box you can't connect to a sharepoint site (local) that has a different name then the server.

    Microsoft server 2008 has a security option that checks for name/ip combinations.

    Say, your server is named server1, with ip 10.0.0.1

    Sharepoint will allow the use of server1 as an hostheader.

    If you redirect 10.0.0.1 in your DNS or hostfile to portal. server 2008 will nog allow connectie.

    It will check the ip adres of portal (10.0.0.1) and then ask the name of 10.0.0.1 (server1). Since they are not the same, server 2008 will see this as a security breach, and so will not show the page. more information on my blog: http://sharepoint.vanglabbeek.nl/index.php/2010/03/17/alternate-access-mapping-aam-on-windows-2008r2/

    However, there is a workaround found here : http://support.microsoft.com/kb/896861

    Use method 2 for best results.

    Furthermore, i've learned to NEVER touch iis. NEst is to do everything from sharepoint central administration. As far as i know, it's a one way sync. Things configured in sharepoint will be synced to IIS, but changes in IIS will not be synced to sharepoint.


    Willing to learn everything about Sharepoint there is to learn. My blog
    • Proposed as answer by ChanelGK Friday, May 27, 2011 3:15 PM
    • Marked as answer by Mike Walsh FIN Wednesday, June 22, 2011 6:18 AM
    Monday, December 13, 2010 3:18 PM
  • The Exact steps are as below

    You create a new web application and a site collection, which will give you a URL which would contain the server name and the port number (e.g. http://servername:7788)

    Now instead of providing the url to the user there should be a easy was by which the user should be able to see the site, which is when the user types "portal" it should take him to http://servername:7788

    To Get that please follow the steps as shown below

    1) Ask the Systems team to place a DNS entry called portal
    2) On the SharePoint installed server go to C:\WINDOWS\system32\drivers\etc\Hosts . Open the hosts file with notepad and enter the IP address of the SharePoint server, give space (or hit the tab button once) and then type the DNS name which is portal (e.g 172.18.00.00     portal)
    2) On the same server open IIS (start-->RUN-->Inetmgr-->Enter)
    3) Expand the folder web Sites and right click on the site and select properties. On the tab "web Site", below web site Identification click on the button Advanced.
    4) Under Multiple Identities for the web site click on ADD, then in the TCP port enter 80 and in the Host Header Value type port, then click ok, ok and apply.
    5) go to the central administration and click on Operation, under Global configuration select "Alternate Access Mapping" in here click on the web application (in our case http://servername:7788) you will be taken to a next page called Edit Internal URLs in here just click the cancel button, when you do that you will be taken to another page called Alternate Access Mappings, in here please click on Add Internal Urls, you will now be taken to another page called ADD Internal URLS . make sure that you have selected the right site collection on the right side, then in the Add Internal Url type http://portal and click Save.

    You can now open a browser and type portal and hit enter. you will be taken to the site http://portal/pages/default.aspx.

    Hope That helps.

    Satyam.

    • Marked as answer by satyamnityam Tuesday, January 5, 2010 11:10 PM
    Tuesday, January 5, 2010 11:10 PM

All replies

  • You will want to setup Alternate Access Mappings for the site (in Central Admin > Operations). From here you can add an additional hostheader, then update the site in IIS with the new hostheader. So this will simply setup the same site at another address. You will have to update DNS accordingly.

    HTH
    David Lozzi
    Delphi Technology Solutions
    SharePoint & Dev Blog  |  LinkedIn | Twitter
    Tuesday, November 10, 2009 7:51 PM
  • Hi,

    You need to configure alternative access mapping for your web application
    - Run SharePoint Central Administration and the click Operations.
    - Under Global Configuration, click Alternative access mappings.

    - in the Alternative access mappings, click Edit Public URLs
    - you can change the Defult zone with the name that you need "htt://CompanyPortal"
    http://technet.microsoft.com/en-us/library/cc263208.aspx
    then you will need to add a DNS entry for the new name CompanyPortal to point to the SharePoint Server IP


    Best Regards, Ammar MCT
    • Marked as answer by Rock Wang– MSFT Wednesday, November 18, 2009 7:17 AM
    • Unmarked as answer by satyamnityam Friday, November 20, 2009 5:18 PM
    Tuesday, November 10, 2009 7:53 PM
  • Hi David and Ahmed.

    Thank you very much for the response,

    When I tried you steps I get a message that the page is under construction.

    Am I doing something wrong?

     

    Satyam

    Wednesday, November 11, 2009 5:40 PM
  • Hi,

    have you tried configuring AAM?
    which part gives you the error?
    Best Regards, Ammar MCT
    Wednesday, November 11, 2009 6:49 PM
  • Hi Ammar

    The steps are as below.

    Created a new web application and a site collection then I got the URL http://servername:25478

    A DNS entry was made, then

    àSharePoint Central Administration and the click Operations

    àUnder Global Configuration, click Alternative access mappings.

    àIn the Alternative access mappings, click Edit Public URLs

    àChanged the Defult zone with the name which was given in the DNS

    Then when I tried to access the site I get a message that the page is under construction.

     

    Satyam

    Wednesday, November 11, 2009 11:26 PM
  • Hi Satyam,

    I think you may have missed a step. You will need to add the host header to the IIS site as well, using IIS Manager.

    Hope that helps

    Paul.
    Wednesday, November 11, 2009 11:41 PM
  • Don't forget to IISRESET ... If you don't want that port and it's a new web application you can also just delete that site, create a new one and then enter the host header in the creation page... Just an idea...

    Kris Wagner, MCITP, MCTS Twitter @sharepointkris Blog: http://sharepointkris.com
    Thursday, November 12, 2009 7:56 AM
    Moderator
  • The Exact steps are as below

    You create a new web application and a site collection, which will give you a URL which would contain the server name and the port number (e.g. http://servername:7788)

    Now instead of providing the url to the user there should be a easy was by which the user should be able to see the site, which is when the user types "portal" it should take him to http://servername:7788

    To Get that please follow the steps as shown below

    1) Ask the Systems team to place a DNS entry called portal
    2) On the SharePoint installed server go to C:\WINDOWS\system32\drivers\etc\Hosts . Open the hosts file with notepad and enter the IP address of the SharePoint server, give space (or hit the tab button once) and then type the DNS name which is portal (e.g 172.18.00.00     portal)
    2) On the same server open IIS (start-->RUN-->Inetmgr-->Enter)
    3) Expand the folder web Sites and right click on the site and select properties. On the tab "web Site", below web site Identification click on the button Advanced.
    4) Under Multiple Identities for the web site click on ADD, then in the TCP port enter 80 and in the Host Header Value type port, then click ok, ok and apply.
    5) go to the central administration and click on Operation, under Global configuration select "Alternate Access Mapping" in here click on the web application (in our case http://servername:7788) you will be taken to a next page called Edit Internal URLs in here just click the cancel button, when you do that you will be taken to another page called Alternate Access Mappings, in here please click on Add Internal Urls, you will now be taken to another page called ADD Internal URLS . make sure that you have selected the right site collection on the right side, then in the Add Internal Url type http://portal and click Save.

    You can now open a browser and type portal and hit enter. you will be taken to the site http://portal/pages/default.aspx.

    Hope That helps.

    Satyam.

    • Marked as answer by satyamnityam Tuesday, January 5, 2010 11:10 PM
    Tuesday, January 5, 2010 11:10 PM
  • I performed all the above steps in the solution marked as correct answer.

    I configured AAM, Added DNS Entry and added host header in IIS, also added entry in the host file

    C:\WINDOWS\system32\drivers\etc\Hosts

    but when i access my site

    http://brainshare:46284

    I am asked for username and password and then login successfully

    but when i enter the name i entered in aam and dns (salesportal)

    as

    http:// salesportal

    I am asked for username and password but not authenticated

    What could be problem?


    Wednesday, July 21, 2010 12:04 PM
  • Hi

    I did all the above steps . But I am getting 

    "Internet Explorer cannot display the webpage"

    It is not redirecting to my portal. Could you please update me what am missing here or any other way is there to achieve the same ?

     

    With Regards

    Suresh

    Monday, September 13, 2010 10:57 AM
  • Suresh.

     

    Did you try to access the site from the server or from your machine?

     

    Satyam.

    Thursday, September 23, 2010 9:42 PM
  • Out of the box you can't connect to a sharepoint site (local) that has a different name then the server.

    Microsoft server 2008 has a security option that checks for name/ip combinations.

    Say, your server is named server1, with ip 10.0.0.1

    Sharepoint will allow the use of server1 as an hostheader.

    If you redirect 10.0.0.1 in your DNS or hostfile to portal. server 2008 will nog allow connectie.

    It will check the ip adres of portal (10.0.0.1) and then ask the name of 10.0.0.1 (server1). Since they are not the same, server 2008 will see this as a security breach, and so will not show the page. more information on my blog: http://sharepoint.vanglabbeek.nl/index.php/2010/03/17/alternate-access-mapping-aam-on-windows-2008r2/

    However, there is a workaround found here : http://support.microsoft.com/kb/896861

    Use method 2 for best results.

    Furthermore, i've learned to NEVER touch iis. NEst is to do everything from sharepoint central administration. As far as i know, it's a one way sync. Things configured in sharepoint will be synced to IIS, but changes in IIS will not be synced to sharepoint.


    Willing to learn everything about Sharepoint there is to learn. My blog
    • Proposed as answer by ChanelGK Friday, May 27, 2011 3:15 PM
    • Marked as answer by Mike Walsh FIN Wednesday, June 22, 2011 6:18 AM
    Monday, December 13, 2010 3:18 PM