Create a Web Application (IIS 7)
Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista
An application is a grouping of content at the root level of a Web site or a grouping of content in a separate folder under the Web site's root directory. When you add an application in IIS 7, you designate a directory as the application root, or starting point, for the application and then specify properties specific to that particular application, such as the application pool that the application will run in.
An application pool enables an application or a group of applications to run in isolation from one or more applications in another application pool. For more information about application pools, see Managing Application Pools in IIS 7.
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 Applications Feature Requirements (IIS 7).
Exceptions to feature requirements
- Only server administrators can add and edit applications.
To add an application
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.
To use the UI
Open IIS Manager. For information about opening IIS Manager, see Open IIS Manager (IIS 7).
In the Connections pane, expand the Sites node.
Right-click the site for which you want to create an application, and click Add Application.
In the Alias text box, type a value for the application URL, such as marketing. This value is used to access the application in a URL.
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.
In the Physical path text box, type the physical path of the application's folder, or click the browse button (...) to navigate the file system to find the folder.
Optionally, click Connect as to specify credentials that have permission to access the physical path. If you do not use specific credentials, select the Application user (pass-through authentication) option on the Connect As dialog box.
Optionally, click Test Settings to verify the settings that you specified for the application.
To add an application to a site, use the following syntax:
**appcmd add app /site.name:**string **/path:**string **/physicalPath:**string
The variable site.namestring is the name of the Web site to which you want to add the application. The variable pathstring is the virtual path of the application, such as /application, and physicalPathstring is the physical path of the application's content in the file system.
For example, to add an application named marketing to a site named contoso, with content at c:\application, type the following at the command prompt, and then press ENTER:
appcmd add app /site.name:contoso /path:/marketing /physicalPath:c:\application
For more information about Appcmd.exe, see Appcmd.exe (IIS 7).
The procedure in this topic affects the following configuration elements:
<application> element under <site>
<virtualDirectory> element under <application>
For more information about IIS 7 configuration, see IIS 7.0: IIS Settings Schema on MSDN.
Use the following WMI classes, methods, or properties to perform this procedure:
- Application.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.