Freigeben über


How to: Create and Configure Local ASP.NET Web Sites in IIS 

Using Internet Information Services (IIS) Manager, you can create a local Web site for hosting an ASP.NET Web application. This topic explains how you can create a local Web site and configure it to run ASP.NET pages. For additional details about installing and configuring IIS, or creating a Web site, see the IIS Help documentation that is included with the product or the online IIS product documentation on the Microsoft TechNet Web site.

As an alternative to creating a local site, you can also create a virtual directory. This provides a way to host the Web site on one computer, while the actual pages and content of the Web site are contained somewhere other than the root or home directory, such as on a remote computer. It is also a convenient way to set up a site for local Web development work because it does not require a unique site identity, which means that it requires fewer steps than creating a unique site. For details, see How to: Create and Configure Virtual Directories in IIS.

Starting IIS Manager

First, you need to start IIS Manager.

NoteImportant

You must be logged on as a member of the Administrators group on the local computer to perform the following procedure (or procedures), or you must have been delegated the appropriate authority.

To start IIS Manager from the Run dialog box

  1. On the Start menu, click Run.

  2. In the Open box, type inetmgr and click OK.

To start IIS Manager from the Administrative Services console

  1. On the Start menu, click Run. In the Run text box, type control panel, and then click OK.

  2. In the Control Panel window, click Administrative Tools.

  3. In the Administrative Tools window, click Internet Information Services.

Creating a Local Web site

Once IIS Manager is started, you can create a site. The following procedures explain how to create a site in IIS version 6.0.

NoteNote

The procedures for creating a local Web site in previous versions of IIS are similar to the following procedures, but differ in a few details. For more information about creating a Web site in other versions, see the IIS Help documentation that is included with your local copy of IIS (type https://localhost/iisHelp/ in your browser address bar and then press ENTER) or the online IIS product documentation for previous versions on the Microsoft TechNet Web site.

To create a local Web site in IIS 6.0

  1. In IIS Manager, expand the local computer, right-click the Web Sites folder, point to New, and click Web Site.

  2. In the Web Site Creation Wizard, click Next.

  3. In the Description box, type a descriptive label for the site (this label is not what you will type in the address bar of a browser), and then click Next.

  4. Type or select the IP address (the default is All Unassigned), TCP port, and host header (for example, www.microsoft.contoso.com) for your site.

    NoteImportant

    To ensure that user requests reach the correct Web site, you should distinguish each site on the server with at least one of three unique identifiers: a host header name, an IP address, or a TCP port number. Using unique host header names is the preferred way to identify multiple Web sites on a single server. To reach your site, a client must enter the name/IP address pair that is listed for the site in the DNS server, or listed in the local HOSTS file. For more information about choosing unique identifiers, see Hosting Multiple Web Sites on a Single Server in the IIS 6.0 product documentation.

  5. In the Path box, type or browse to the directory that contains, or will contain, the site content, and then click Next.

  6. Select the check boxes for the access permissions that you want to assign to your users, and then click Finish. By default, the Read and Run Scripts check boxes are selected; these permissions enable you to run ASP.NET pages for many common scenarios.

Configuring a Local Web Site

After creating a new local Web site, you can configure it to run ASP.NET pages and configure security. The following table shows the permissions settings that are available in all versions of IIS, including IIS 6.0.

Account or Group Permissions

Administrators

Full Control

System

Full Control

An account or group that you choose to give browse access to the site if you disabled anonymous authentication when you created the virtual directory.

Read & Execute

The account configured to access system resources for the ASP.NET current user context, such as the Network Service account (IIS 6.0) or the ASPNET account (IIS 5.0 and 5.1)

Read & Execute

List Folder Contents

Read

Write

When you are finished configuring the site, you can then add ASP.NET Web pages to the site's directory.

To configure security and authentication for a local Web site

  1. In IIS Manager, right-click node for the site that you want to configure, and then click Properties.

  2. Click the Directory Security tab, and then in the Authentication and access control section, click Edit.

  3. Select the check box for the authentication method or methods that you want to use for your site, and then click OK. By default, the Enable anonymous access and Windows Integrated Authentication check boxes are already selected.

  4. In Windows Explorer, navigate to the folder that will contain the pages for the site. Right-click the folder and then click Sharing and Security on the shortcut menu.

  5. On the Security tab, configure the additional accounts and permissions that are minimally necessary to run your Web site, and then click OK. Some of the accounts listed, such as Administrators and System, are already configured by default.

    NoteNote

    To change permissions for an existing account, select the account in the Group or user names list, and then select the appropriate permissions check boxes. To add a new account, click Add, and then click the Locations button. Select the local computer name from the list and click OK. Then type the particular account name that you want to add into the text box. After typing in a name, click Check Names to verify the account name, and finally click OK to add the account.

See Also

Tasks

How to: Create and Configure Virtual Directories in IIS
How to: Implement Simple Forms Authentication

Other Resources

Configuring ASP.NET Applications
ASP.NET Authentication