Home > IIS6 > Creating virtual host for SSL/HTTPS port in IIS6

Creating virtual host for SSL/HTTPS port in IIS6

July 3rd, 2009

You can not create the virtual host for SSL port in IIS.  Its a UI bug. But you can achieve the same thing using the command line by using the following steps:

1. Create two websites in IIS and configure HTTPS on both of the websites.
2. At this point you will not be able to start both the websites at the same time, because https is configured on 443 port in both the websites.
3. Stop both the website if running.
4. Go to commands line and cd to C:\Inetpub\AdminScripts folder.
5. Now you have to figure out the website identity of you want to change the host. Type following command to command line. You may want to run this command two times, because first time it may try to set the VB script as default script

C:\Inetpub\AdminScripts>iisweb /query
Connecting to server ...Done.
Site Name (Metabase Path)                     Status  IP              Port  Host

==============================================================================
Default Web Site (W3SVC/1)                    STOPPED ALL             80    N/A
Communicator Web Access (W3SVC/175074822)     STOPPED 127.0.0.1       81    N/A
VMware Management Interface 1.0.4 (W3SVC/2)   STARTED ALL             8222  N/A
reliance (W3SVC/1386234876)                   STARTED ALL             82    N/A

Note: you should get all the sites registered in your IIS server along with their site identities.
6. Modify the virtual host of SSL port using following command

C:\Inetpub\AdminScripts>cscript.exe adsutil.vbs set  W3SVC/<site identifier>/SecureBindings ":443:<host header>"
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

SecureBindings                  : (LIST) ":443:<host header>"

7. Make sure host name is properly configured in your DNS server.
8. Start both the websites.
9. You should be able to access both the application using different host on https communication.

More:
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/e5bc9d3c-0043-43c9-a5cc-ac390d74849b.mspx?mfr=true
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/8d9f2a8f-cd23-448c-b2c7-f4e87b9e2d2c.mspx?mfr=true

Comments are closed.