共用方式為


Add a Binding to a Site (IIS 7)

Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista

You can assign multiple bindings to a site when you have site content that serves different purposes or for which you must use a different protocol. For example, a commerce site might have an application that requires that users log on to an account to purchase merchandise. The company hosts the site over HTTP, but users must log on to their account on an HTTPS page. In this example, the site would have two bindings: one for the HTTP portion and one for the HTTPS portion.

Out of the box, you cannot add bindings for protocols other than HTTP and HTTPS by using IIS Manager. If you want to add a binding for a different protocol, such as a protocol supported by Windows Communication Foundation (WCF), you must use one of the other administration tools to do this. However, if you download and install the new IIS 7 File Transfer Protocol (FTP) server, you can add FTP bindings by using IIS Manager. There might also be other modules or third-party functionality available for download that extend the UI.

Prerequisites

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

Exceptions to feature requirements

  • None

To add a binding to a site

You can perform this procedure by using the user interface (UI), by running Appcmd.exe commands in a command-line window, by editing configuration files 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). For information about navigating to locations in the UI, see Navigation in IIS Manager (IIS 7).

  2. In the Connections pane, expand the Sites node in the tree, and then click to select the site for which you want to add a binding.

  3. In the Actions pane, click Bindings.

  4. In the Site Bindings dialog box, click Add.

  5. In the Add Site Binding dialog box, add the binding information and then click OK.

Command Line

To add a binding to a site, use the following syntax:

**appcmd set site /site.name:**string /+bindings.[protocol='string',bindingInformation='string']

The variable site.name string is name of the site to which you want to add a binding. The variable protocol string is the protocol that you want to use, and the variable bindingInformation string is the combination of IP address, port, and host header.

For example, to configure a site named contoso to have an HTTPS binding for all IP addresses, on port 443, without a host header, type the following at the command prompt, and then press ENTER:

appcmd set site /site.name:contoso /+bindings.[protocol='https',bindingInformation='*:443:']

For more information about Appcmd.exe, see Appcmd.exe (IIS 7).

Configuration

The procedure in this topic affects the following configuration elements:

<bindings> under <site> element

For more information about IIS 7 configuration, see IIS 7.0: IIS Settings Schema on MSDN.

WMI

Use the following WMI classes, methods, or properties to perform this procedure:

  • SSLBinding.Create method

For more information about WMI and IIS, see Windows Management Instrumentation (WMI) in IIS 7. For more information about the classes, methods, or properties associated with this procedure, see the IIS WMI Provider Reference on the MSDN site.

See Also

Concepts

Managing Sites in IIS 7 Create a Web Site (IIS 7)

Other Resources

Windows Communication Foundation IIS 7.0 File Transfer Protocol (x86) IIS 7.0 File Transfer Protocol (x64)