|
IIS supports multiple Web sites on a single server. For example, rather than using
three different servers to host three different Web sites, you can install all three
Web sites on the same server. Consolidating Web sites saves hardware resources,
conserves space, and reduces energy costs.
To ensure that user requests reach the correct Web site, you must configure a unique
identity for each site on the server. To do so, you must distinguish each Web site
with at least one of three unique identifiers: a host header name, an IP address,
or a unique TCP port number.
Web sites hosted on the same server can be distinguished using the following unique
identifiers.
•
|
Host header name
|
|
•
|
IP address
|
|
•
|
TCP port number
|
Using host header names to uniquely identify sites on a server is recommended for
most situations.
This section includes the following information:
•
|
Creating Multiple Sites Using Multiple IP Addresses: Describes
how to use unique IP addresses to to distinguish multiple sites.
|
|
•
|
Creating Multiple Sites Using Host Header Names: Describes
how to use host headers to distinguish multiple sites.
|
|
•
|
Creating Multiple Sites Using Ports: Describes how to use
nonstandard TCP port numbers to distinguish multiple sites.
Creating Multiple Sites Using Multiple IP Addresses
Some server configurations require the use of unique IP addresses to distinguish
multiple Web sites on the same server.IIS enables you to configure Web sites to
listen on all available IP addresses, or on an individual IP address. If you use
multiple IP addresses to distinguish between different sites on the same server,
you must configure IIS to assign each site a unique IP address.
|
Procedures
|
|
To add a Web site using a unique IP address identifier using the Web Site Creation
Wizard
|
|
|
|
1.
|
In IIS Manager, expand the local computer, right-click the Web
Sites directory, point to New, and then click
Web Site.
|
|
2.
|
Click Next.
|
|
3.
|
In the Description box, type the name you have selected for the
Web site, and click Next.
|
|
4.
|
In the Enter the IP address to use for this Web site box, click
the unique IP address reserved for this site.
|
|
5.
|
In the TCP port this Web site should use box, type the port number
used by all sites on the server. This should typically be left at the default of
80.
|
|
6.
|
If SSL encryption is enabled on the server, type the SSL port number, and then click
Next. If SSL encryption is not enabled on the server, the SSL
port box does not appear.
|
|
7.
|
In the Path box, type or browse to the path of your Web site home
directory.
|
|
8.
|
To create a secured or private Web site, clear the Allow anonymous access to
this Web site check box, and then click Next. (Web
sites are configured for anonymous access by default.)
|
|
9.
|
In the Web Site Access Permissions box, set the permissions for
the home directory.
|
|
10.
|
Click Next, and then click Finish.
|
|
Creating Multiple Sites Using Host Header Names
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
Procedures
|
|
To add a Web site using a host header identifier using the Web Site Creation
Wizard
|
|
|
|
1.
|
In IIS Manager, expand the local computer, right-click the Web
Sites directory, point to New, and then click
Web Site.
|
|
2.
|
Click Next.
|
|
3.
|
In the Description box, type the name you have selected for the
Web site, and then click Next.
|
|
4.
|
In the Enter the IP address to use for this Web site box, click
the IP address used by all sites on the server.
|
|
5.
|
In the TCP port this Web site should use box, type the port number
used by all sites on the server.
|
|
6.
|
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.
|
|
7.
|
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.
|
|
8.
|
In the Path box, type or browse to the path of your Web site home
directory.
|
|
9.
|
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.)
|
|
10.
|
In the Web Site Access Permissions box, set the permissions for
the home directory.
|
|
11.
|
Click Next, and then click Finish.
|
|
Creating Multiple Sites Using Ports
Although not recommended for production servers, you can use nonstandard TCP port
numbers to create unique Web site identifiers for site development and testing purposes.
You can do this by creating a Web site identity that consists of a TCP/IP address
or host header name, appended with a nonstandard TCP port number. Because TCP/IP
endpoints are defined by a combination of IP address (or the corresponding name)
and port number, configuring a Web site with a nonstandard port number creates a
unique endpoint, or identity, for the site.
If you use a nonstandard TCP port number to identify a Web site, users must know
the nonstandard TCP port number assigned to the Web site, and append the port number
to the Web site's name or IP address in their Web browser address bar
Procedures
|
|
To add a Web site using a unique port identifier using the Web Site Creation
Wizard
|
|
|
|
1.
|
In IIS Manager, expand the local computer, right-click the Web
Sites directory, point to New, and then click
Web Site.
|
|
2.
|
In the Web Site Creation Wizard, click Next.
|
|
3.
|
In the Description box, type the name that you have selected for
the Web site, and then click Next.
|
|
4.
|
In the Enter the IP address to use for this Web site box, click
the IP address used for all sites on this server.
|
|
5.
|
In the TCP port this Web site should use box, type the unique port
number reserved for this site.
|
|
6.
|
Optional: 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 containing
the full name of the site, for example, www.microsoft.com.
|
|
7.
|
If SSL encryption is enabled on the server, type the SSL port number, and then click
Next. If SSL encryption is not enabled on the server, the SSL
port box does not appear.
|
|
8.
|
In the Path box, type or browse to the path of your Web site home
directory.
|
|
9.
|
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.)
|
|
10.
|
In the Web Site Access Permissions box, set the permissions for
the home directory.
|
|
11.
|
Click Next, and then click Finish.
|
|
|