26
Mar
07

How to: modify ports and host headers on SharePoint 2007

Have you ever wondered how you can change port numbers and hostheaders when you created a web application based on port numbers? Here’s a short tutorial with lots of screenshots.
After you’ve created a web application based on servername and port number, you can’t simply change the port number in IIS.The tutorial consists of 4 parts:

  1. Creation of a Web Application based on servername and port number
  2. Creation of a Web Application based on FQDN and host header
  3. Extending the Web Application to another Web Application (in this case, extend the old Web Application to the new Web Application
  4. Publish the Web Application to ISA Server 2004

1. Go to the central administration panel and click on Create or Extend a Web Application

extend

2. Click on the Create or Extend Web Application screen on “Create a Web Application”

extendexisting

3. Fill in the fields with the appropiate values (based on port numbers, not host headers)

extendexistingcreate

extendexistingcreate1

5. After step 4 click on Ok and wait a few seconds

extendexistingcreate1finished

6. I skipped some steps, but you have to create a site collection to get a running site

extendsitecollectionfinished

7. As you can see we now have a site running on port 12966 without host headers

extendiis

8.To modify the port number and insert a host header, again go to the Central Administration and click on Create or Extend a Web Application. Create a new Web Application and fill in the host header and port number (in our case we do everything on port 80)

extendnew

9. After you created a new web application, extend the existing web application (based on port 12966 without host header) to another existing web application (the just created web application with port 80 and a host header)

extendnewtoanother

After this, we can dump our old web application (via Administration Panel! not via IIS)

10. At this point, we are not able to browse the site. This is because we have to create a ISA Web Publishing rule.

extendiisnew

11.extendnewfinished

12. Start the new Web Publishing Wizard in ISA Server

extendisa

13. Create a new Web Publishing rule, with a web listener based on Port 80

extendisa1

14.

extendisa80

15. As you can see it is now possible to browse the site based on the host header and using port 80.

extendsisaiisfinished

Special thanks to Matthijs Kloens and Roel van Lisdonk for providing the solution and screenshots

Maybe there are other ways to do this, if you have one, please help us out and drop a comment! Drop also a comment if things are unclear or you need a little help.


13 Responses to “How to: modify ports and host headers on SharePoint 2007”


  1. 1 Oskar Austegard Mar 27th, 2007 at 7:58 pm

    I added your blog’s Microsoft category to the sites searched by http://SharePointSearch.info - try it out, it’s quite useful.

    Oskar

  2. 2 Jaap Steinvoorte Mar 27th, 2007 at 9:26 pm

    Hi Oskar,
    Thanks! :-) I’ll give it a try. In the meantime, I add the site to my blogroll.

  3. 3 clayton Jul 31st, 2007 at 1:13 am

    if I have a usb to serial plug and cord how can I get vista to recognise it?

  4. 4 clayton Jul 31st, 2007 at 1:39 am

    I see several serial to usb or vice versa that do not list compatability with vista but they are more affordable. I want to know if there is a driver which can be downloaded for the vista use of these usb to serial ports.

  5. 5 gipsy58 Sep 26th, 2007 at 4:25 pm

    Do I have a problem? I tried it several times. But when I delete the 1st web application both web applications are removed.

    rgrds G

  6. 6 Joe Tokarski Feb 1st, 2008 at 7:25 pm

    Having Issues

    When I try to extend the existing site to the new under “Use an existing IIS web site” I do not see any of my SharePoint sites includeing the new one created. Am I not understanding the instructions?

  7. 7 Matthias Unruhe Mar 5th, 2008 at 12:24 pm

    Hi folks,
    There is another pretty simple way to get your SharePoint Web Application run on a different port and/or using a (different) host header.

    1. Go to the properties of the IIS Web Site that hosts your SharePoint Web Application
    2. On the Tab “Web Site” add a new “Web site identification” by clicking the “Advanced…” button
    3. Add a new Web site identification that uses the appropriate port and host header.
    4. Have fun

    When configuring an additional host header I prefer using port 80.
    You can add as many host headers for each port as you like.

    But!!!
    There is one point that is pretty uncool!!!
    If you use this method the browser’s address bar will always show the original URL. So the host header is simply resolved.

    Cheers,
    Matthias

  8. 8 Jaap Steinvoorte Mar 5th, 2008 at 11:26 pm

    Wow Matthias! thanks for this one. I had several issues with extending a web app to another host header. I used to develop a sharepoint site at http://dogfood.ada-ict.nl, extended this one to http://www.ada-ict.nl and wanted to enable also http://ada-ict.nl. http://ada-ict.nl is now resolved to http://dogfood.ada-ict.nl... Not happy with this but you could imagine
    Thanks again!

    Jaap

  9. 9 Nabil Mar 7th, 2008 at 1:12 pm

    After you have added the host headers, go to the Sharepoint Central Administration to the Operations tab. Click on Alternate Access Mappings and define alternate addresses that you put in the host headers. After this when you type in these addresses in the browser, it will not redirect to the original site anymore.

  10. 10 Leon Zandman Mar 18th, 2008 at 12:20 pm

    @Matthias: I don’t think your method is safe! If you only make those changes in IIS, then SharePoint won’t know about them, because the new host header settings aren’t in the SharePoint configuration database. This will probably result in a lot of trouble.

    The recommended way for changing the host header of a SharePoint site is by first changing the Alternative Access Mappings in SharePoint and then ALSO changing the IIS config as described here:

    http://www.davehunter.co.uk/Blog/Lists/Posts/Post.aspx?List=f0e16a1a-6fa9-4130-bcab-baeb97ccc4ff&ID=82

  11. 11 Ivan Mar 22nd, 2008 at 7:34 pm

    In SPS 2003 and WSS 2.0 the metabase stores the entire configuration for the IIS Web Site (IIS virtual server/IIS Web Application). In MOSS 2007 and WSS 3.0 this is true as well, but there are some slight differences that you should be aware of.

    The configuration database cares about all the databases used, all of the IIS Web Sites/Web Applications, solutions, web part packages, site templates, web application and farm settings specific to SharePoint technologies (like default quota, blocked file types, antivirus configuration, etc…) and many that are as well listed in the IIS metabase (such as host header configuration, SSL enabled, authentication, and ports).

    The IIS metabase contains the by default, the port, host header, authentication, and many unique items that are not in the config database (IIS bindings/IP Assignments, SSL Certificate, ISAPI, and HTTP headers, etc…)

    The full set of IIS bindings and SSL certificates are not exposed in the web application creation UI - specifically the IP address assignment. The reason for this is that while the other bindings are usually identical for all servers in the farm, the IP binding is almost always unique for each server in the farm when you want to assign such a binding. This presents the problem where we would have to create a control to specify what that binding is on a per server basis, which doesn’t fit well with our “each box is a clone of each other box” server farm model. And if you later decided to add a server to the farm, we would need to provide a way to specify what those bindings should be for the new server before it tried to create the IIS Web site for your web application. Currently the way to apply those items is to apply them via the IIS manager, do an IIS metabase backup, restart the WSS Web Application service, then restore IIS metabase.

    Use a mixture of Host Headers, ports (most common for SSPs Admin and Central admin), and IP bindings, for common configuration across the servers when possible to support hosting multiple IIS Web Sites/Web Applications on the same server. Be careful when you change any web application settings in IIS Manager… they may not be there after the services are restarted. Note: Host headers are supported with SSL with wild card SSL certificates. You can use IP bindings but they aren’t exposed in the SharePoint web application creation UI, first go into SharePoint to extend the web application with a host header binding, then go into IIS Manager to remove the host header binding and add an IP binding and SSL certificate to the IIS Web site as applicable. Be sure to do an IIS metabase backup, restart the WSS Web Application Service and then restore the IIS metabase.

    Also, once a webb application has been created with a content db, you cant extend to it, its already in use. However, you can click extend then create a new IIS Virtual Server with the appropriate settings and extend the web application to the new iis virtual server..

    I ran into this issue with RSA on the external iis virtual server RSA does not like host headers and so we had to use IP Binding…

    Joel Oleson goes into a full explanation on his blog…

    Cheers,

    -Ivan

  12. 12 Sean Sep 11th, 2008 at 9:45 pm

    Trying the method outline above, i get the following error message on step 9
    “The IIS Web Site you have selected is in use by SharePoint. You must select another port or hostname. ”

    I created the “default” site as 443 which now causes issues with DPM, authentication in Vista etc. I would rather have it be at port 80. Seems Sharepoint could address this in some way….

  1. 1 SharePoint Training Trackback on Nov 4th, 2008 at 10:18 pm

Leave a Reply