Partager via


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

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 more information about how to install and configure IIS, or about how to create a Web site, see the IIS Help 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 lets you host the Web site on one computer, although the Web site content is somewhere else, 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. This means that it requires fewer steps than creating a unique site. For details, see How to: Create and Configure Virtual Directories in IIS 5.0 and 6.0.

Creating a Local Web site

To open IIS Manager, follow one of the procedures that are described in How to: Open IIS Manager topic. You can then create a site. The following procedures explain how to create a site in IIS version 6.0.

Note

The procedures for creating a local Web site in earlier versions of IIS are like the following procedures, but differ in some details. For more information about how to create a Web site in other versions, see the IIS Help or the IIS documentation on the Microsoft TechNet Web site. (Local IIS Help is available by typing https://localhost/iisHelp/ in a browser.)

To create a local Web site in IIS 6.0

  1. On the Start menu, click Run.

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

  3. In IIS Manager, expand the local computer, right-click the Web Sites folder, click New, and then click Web Site.

    The Web Site Creation Wizard is displayed.

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

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

  6. 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.

    Important

    To ensure that user requests reach the correct Web site, you must distinguish each site on the server with at least one of three unique identifiers. These are a host header name, an IP address, or a TCP port number. The preferred way to identify multiple Web sites on a single server is to use unique host header names. To reach the site, users 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 how to select unique identifiers, see Hosting Multiple Web Sites on a Single Server in the IIS 6.0 product documentation.

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

  8. Select the check boxes for the permissions that you want to assign to 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 you create a 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 is allowed to browse the site if you disabled anonymous authentication when you created the virtual directory.

Read & Execute

The account that is 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 the site, and then click OK. By default, the Enable anonymous access and Windows Integrated Authentication check boxes are already selected.

  4. In Windows Explorer, open the parent folder of the folder that contains the pages for the site. Right-click the folder and then click Sharing and Security.

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

    Note

    To add a new group or user name, click Add, and then click the Locations button. Select the local computer name from the list and then click OK. Then type the account name that you want to add into the text box. After typing the name, click Check Names to verify the account name. Click OK to add the account.

See Also

Tasks

How to: Create and Configure Virtual Directories in IIS 5.0 and 6.0

How to: Implement Simple Forms Authentication

How to: Deploy Web Projects Targeted for Earlier Versions of the .NET Framework

Other Resources

ASP.NET Web Site Administration

ASP.NET Authentication