Click to Rate and Give Feedback
TechNet
TechNet Library
Windows Server
Web Server (IIS)
Managing Sites
 Create a Web Site (IIS 7)
Create a Web Site (IIS 7)

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

When you want to publish content for access over the Internet or an intranet connection, you can add a Web site to your Web server to hold the content.

During IIS 7 installation, a default Web site configuration is created in the \Inetpub\Wwwroot directory on your Web server. You can either use this default directory to publish your Web content, or create a directory at a file system location of your choice.

When you add a Web site in IIS 7, a site entry is created in the ApplicationHost.config file. The entry specifies the network binding for the site, maps the site to a location in the file system, and optionally specifies user credentials for content access.

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 Web 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, right-click the Sites node in the tree, and then click Add Web Site.

  3. In the Add Web Site dialog box, type a friendly name for your Web site in the Web site name box.

  4. Click Select if you want to select a different application pool than the one listed in the Application Pool box. In the Select Application Pool dialog box, select an application pool from the Application Pool list and then click OK.

  5. In the Physical path box, type the physical path of the Web site's folder, or click the browse button (...) to navigate the file system to find the folder.

  6. If the physical path that you entered in step 5 is to a remote share, click Connect as to specify credentials that have permission to access the path. If you do not use specific credentials, select the Application user (pass-thru authentication) option in the Connect As dialog box.

  7. Select the protocol for the Web site from the Type list.

  8. The default value in the IP address box is All Unassigned. If you must specify a static IP address for the Web site, type the IP address in the IP address box.

  9. Type a port number in the Port text box.

  10. Optionally, type a host header name for the Web site in the Host Header box.

  11. If you do not have to make any changes to the site, and you want the Web site to be immediately available, select the Start Web site immediately check box.

  12. Click OK.

Command Line

To add a site, use the following syntax:

appcmd add site /name: string /id: uint /physicalPath: string /bindings: string

The variable name string is the name, and the variable id uint is the unsigned integer that you want to assign to the site. The variables name string and id uint are the only variables that are required when you add a site in Appcmd.exe.

noteNote
When you add a site without specifying the values for the bindings and physicalPath attributes, the site will not be able to start.

The variable physicalPath string is the path of the site content in the file system.

The variable bindings string contains information that is used to access the site, and it should be in the form of protocol/IP_address:port:host_header. For example, a Web site binding is the combination of protocol, IP address, port, and host header. A binding of http/*:85: enables a Web site to listen for HTTP requests on port 85 for all IP addresses and domain names (also known as host headers or host names). On the other hand, a binding of http/*:85:marketing.contoso.com enables a Web site to listen for HTTP requests on port 85 for all IP addresses and the domain name marketing.contoso.com.

To add a Web site named contoso with an ID of 2 that has content in c:\contoso, and that listens for HTTP requests on port 85 for all IP addresses and a domain name of marketing.contoso.com, type the following at the command prompt, and then press ENTER:

appcmd add site /name: contoso /id:2 /physicalPath: c:\contoso /bindings:http/*:85: marketing.contoso.com

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

Configuration

The procedure in this topic affects the following configuration elements:

<site>

<application>

<virtualDirectory>

<bindings>

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:

  • Site.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

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
extending my web site using iis      queenidog351   |   Edit   |   Show History
I have a host that gives me 100MB of storage for a real good price and they are very very reliable. I'd like to stay with them. I have lots of photos to upload but I'm out of space and would like to set up a webserver on a laptop that is currently serving out my webcams and weather info. It's on all the time. That computer is running Win7 Home Premium and IIS is loaded and running. From another computer I can enter the local intranet address, 192.168.0.102 and get the default IIS "success" page up. I can't get access by computer name because there is no DNS translation for it. (I use DynDNS to keep my web address "constant".
How can I do this? I can add content to the "Security" laptop, but how does the public access this laptop through my existing website www.xxxx.com? Can I just put a hyperlink on my regular web pages that get served from the laptop instead of my current web host? IE, a request for a page gets made on my website, then gets rerouted by the hyperlink to my laptop that is on my intranet at the address given.
My port 80 is open and available and allowed through the windows firewall.
any help would be appreciated.
Tags What's this?: extension (x) home (x) iis (x) laptop (x) site (x) web (x) win7 (x) Add a tag
Flag as ContentBug
new install iis coming up with an error page      tusharr   |   Edit   |   Show History
I copied the SSL certificate to the new server however when I test the page using HTTP or HTTPS it is coming up with an error page. I imagine that that default site is not setup for browsing and there is a special URL that would work if I browse to it…but I don’t know what that is.
Tags What's this?: Add a tag
Flag as ContentBug
No Spaces      dbinaz   |   Edit   |   Show History

To all reading this, there needs to be NO spaces in front of the strings as listed

appcmd add site /name: contoso /id:2 /physicalPath: c:\contoso /bindings:http/*:85: marketing.contoso.com


Should be

appcmd add site /name: contoso /id:2 /physicalPath: c:\contoso /bindings:http/*:85: marketing.contoso.com

Tags What's this?: Add a tag
Flag as ContentBug
Some explanations      LukePuplett   |   Edit   |   Show History
Selecting a protocol (HTTP/HTTPS)

Looks like you can only choose one and that's almost always going to be HTTP. You can add others later. The others are mostly for non-visual websites; web services and the like.

Pass-thru Authentication

Also known as delegation is the process of using the authenticated user account provided by the web client to IIS to gain access to resources secured with ACLs and SIDs.

Host Header Names

Microsoft Internet Information Services (IIS) allows you to map multiple Web sites with the same port number to a single IP address by using a feature called Host Header Names. By assigning a unique host header name to each Web site, this feature allows you to map more than one Web site to an IP address.
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker