Configure a Host Header for a Web Site (IIS 7)

来源:互联网 发布:js判断undefined null 编辑:程序博客网 时间:2024/06/06 07:39

Host headers (also known as domain names or host names) let youassign more than one site to a single IP address on a Web server.

noteNote   Host headers work for HTTP 1.1-compliant browsers (Internet Explorer 3.x and later, or Netscape Navigator 3.x and later).

Tohost more than one Web site on a Web server, you can assign a unique IPaddress to each Web site, designate a non-standard TCP port number fora Web site, or use host headers. Of the three methods, it is morecommon to use host headers than to assign unique IP addresses to Websites or to use non-standard TCP port numbers.

noteNote After you configure a host header or multiple host headers for an IPaddress, you must register the host headers with the appropriate nameresolution system. If your computer is on an intranet, register thehost header name or names with the intranet's name resolution system.If your computer is on the Internet, register the host header name ornames with the Domain Name System (DNS), which is administered byInterNic.

Prerequisites

Forinformation about the levels at which you can perform this procedure,and the modules, handlers, and permissions that are required to performthis procedure, see Sites Feature Requirements (IIS 7).

Exceptions to feature requirements

  • None

To configure a host header for a site

Youcan perform this procedure by using the user interface (UI), by runningAppcmd.exe commands in a command-line window, by editing configurationfiles directly, or by writing WMI scripts.

User Interface

To use the UI
  1. Open IIS Manager. For information about opening IIS Manager, see Open IIS Manager (IIS 7).

  2. In the Connections pane, expand the Sites node in the tree, and then select the site for which you want to configure a host header.

  3. In the Actions pane, click Bindings.

  4. In the Site Bindings dialog box, select the binding for which you want to add a host header and then click Edit or click Add to add a new binding with a host header.

  5. In the Host name box, type a host header for the site, such as www.contoso.com.

  6. Click OK.

  7. Toadd an additional host header, create a new binding with the same IPaddress and port, and the new host header. Repeat for each host headerthat you want to use this IP address and port.

原创粉丝点击