Creating Multiple Sites Using Host Header Names
Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1
Every Web site has a descriptive name, and can support one or more host header names. Organizations that host multiple Web sites on a single server often use host headers because this method enables them to create multiple Web site identities without using a unique IP address for each site.
Important
You must be a member of the Administrators group on the local computer to perform the following procedure or procedures. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run IIS Manager as an administrator. At a command prompt, type runas /user:Administrative_AccountName "mmc %systemroot%\system32\inetsrv\iis.msc".
Procedures
To add a Web site using a host header identifier using the Web Site Creation Wizard
In IIS Manager, expand the local computer, right-click the Web Sites directory, point to New, and then click Web Site.
Click Next.
In the Description box, type the name you have selected for the Web site, and then click Next.
In the Enter the IP address to use for this Web site box, click the IP address used by all sites on the server.
In the TCP port this Web site should use box, type the port number used by all sites on the server.
In the Host Header for this Web site (Default:None) box, type the host header name to identify the Web site. The host header name must contain the full name of the site, for example, www.microsoft.com.
If SSL encryption is not enabled on the server, the SSL port box does not appear. If SSL encryption is enabled on the server, type the SSL port number, and then click Next. Note that you cannot use host headers with SSL encryption.
In the Path box, type or browse to the path of your Web site home directory.
To create a secured or private Web site, clear the Allow anonymous access to this Web site check box, and click Next. (Web sites are configured for anonymous access by default.)
In the Web Site Access Permissions box, set the permissions for the home directory.
Click Next, and then click Finish.
Important
You must be a member of the Administrators group on the local computer to run scripts and executables. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run your script or executable as an administrator. At a command prompt, type runas /profile /user:MyComputer</STRONG>Administrator cmd to open a command window with administrator rights and then type cscript.exe ScriptName (include the script's full path and any known parameters).
To add a Web site using a host header identifier using the Iisweb.vbs command-line administration script
If the new Web site will be in a new directory, create the new directory.
From the Start menu, click Run.
In the Open box, type cmd, and then click OK.
At the command prompt, switch to the systemroot\system32 directory.
Type the following at the command prompt and then press ENTER:
cscript iisweb.vbs /create HomeDirectory SiteDescription**" /d** Host Header /i IP Address /b Port
Note
The Iisweb.vbs script supports many more options for creating a Web site. To see the options available, see Creating Web Sites Using Iisweb.vbs.
Related Information
For detailed information about the different methods of hosting multiple Web sites on a single server, see Hosting Multiple Web Sites on a Single Server.
For information about Web site names, see Domain Name Resolution.