This article describes how to create and configure Web applications in Internet Information Services (IIS) 6.0.
An IIS application is any file that is executed in a defined set of directories in your Web site. When you create an application, you designate the starting-point directory (also known as the
application root) in your Web site. Each file or folder in the starting-point directory is considered part of that application until another starting-point directory is created. You use directory boundaries to define the scope of a Web application.
In IIS 6.0, an application starting point is indicated by a
package icon if it is created for a virtual directory or physical directory. If it is created for a Web site, the starting point is indicated by a
globe in a hand icon.
How to Create an ASP Web Application
- Start IIS Manager or open the IIS snap-in.
- Expand ServerName, where ServerName is the name of the server, and then expand Web Sites.
- Right-click the directory that you want to use as the application starting point, and then click Properties.
NOTE: You can use the home directory of a Web site as the application starting point. - In the DirectoryNameProperties dialog box (where DirectoryNameis the name of the directory that you selected), do one of the following:
- If you selected a Web site, click the Home Directory tab.
-or- - If you selected a virtual directory, click the Virtual Directory tab.
-or- - If you selected a physical directory, click the Directory tab.
- Under Application Settings, click Create.
NOTE: If the Create button is not present, a default application has already been specified. In this case, click Remove to remove the default application, and then click Create. - In the Application name box, type the name of the application that you want. Note that the application starting point is displayed next to Starting point.
- In the Execute Permissions list, click the level of permissions that you want to give this application. For example, for ASP scripts or Internet Database Connector (IDC) scripts, click Scripts only.
NOTE: The Scripts only option is more secure than the
Scripts and Executables option. - In the Application Pool box, click the option that you want, and then click Apply.
- Click the Documents tab.
- If your application uses a default document that is not displayed in the document list, click Add.
- Type the name of the document in the Default Document Name box, and then click OK.
- Select the newly added document, and then click
Move up until the new document is at the top of the document list.
How to Configure an ASP Web Application
Certain properties can be set for each ASP application that you have created. To configure an ASP application, follow these steps:
- Start IIS Manager or open the IIS snap-in.
- Expand ServerName, where ServerName is the name of the server, and then expand Web Sites.
- Right-click the Web site or the starting-point directory of the application that you want, and then click Properties.
- Depending on the starting-point directory that you selected, click the Home Directory, Virtual Directory, or Directory tab.
- Under Application Settings, click Configuration, and then click the Options tab.
- Click to select the Enable session statecheck box if you want ASP to create a session for each user who accesses an ASP application.
- Click to select the Enable buffering check box if you want ASP to collect all output that is generated by the ASP page before the output is sent to the requesting Web browser.
- Click to select the Enable parent pathscheck box if you want ASP to use relative paths to the parent directory of the current directory (paths using the .. syntax).
NOTE: If you select this option, do not grant Execute permissions in the parent directories. This is to prevent a script in a subdirectory from running an unauthorized program in a parent directory. - In the Default ASP language box, type the language that you want to use.
This box specifies the language that is used to process commands in the ASP delimiters (<% and %>). Note that VBScript is the default ASP language.
NOTE: You can override the default language in your ASP page by using the <%@LANGUAGE%> directive. - In the ASP Script timeout box, type the length of time that want the ASP to allow a script to run.
NOTE: You can set the time-out period to a value ranging from 1 to 2147483647. - Click OK two times to save your changes and return to the Internet Information Services window.
- Quit IIS Manager or close the IIS snap-in.
Example of How to Create an ASP Web Applicationin a New Web Site
The following example illustrates how to create an ASP application in a new Web site in IIS.
NOTE: This example assumes the default installation of Windows Server 2003 is on drive C.
Step 1: Create a Content Directory
- Start Windows Explorer, and then navigate to the following location:
C:\Inetpub
- On the File menu, point to New, and then click Folder.
- In the New Folder box, type Content, and then press ENTER.
- Quit Windows Explorer.
Step 2: Create an ASP Web Application
- Start Notepad.
- In the Notepad window, type the following code:
<HTML>
<HEAD><TITLE>ASP Web Application</TITLE></HEAD>
<BODY BGCOLOR=white>
<H1>ASP Web Application</H1>
<HR>
Type your name
<FORM METHOD=POST ACTION=Output.asp>
<INPUT TYPE=TEXT NAME="username">
<INPUT TYPE=SUBMIT>
</FORM>
</BODY>
</HTML>
- On the File menu, click Save As.
- In the Save As dialog box, navigate to Content in the Save in box, click All Files in the Save as type box, type
Input.htm in the File name box, and then click Save. - On the Edit menu, click Select All, and then click Delete on the Edit menu.
- In the Notepad window, type the following code:
<HTML>
<HEAD><TITLE>ASP Web Application</TITLE></HEAD>
<BODY BGCOLOR=white>
<P>You typed:
<%
NAME=REQUEST.FORM("username")
RESPONSE.WRITE(NAME)
%>
</P>
</BODY>
</HTML>
- On the File menu, click Save As.
- In the Save As dialog box, click Content in the Save in list, click All Files in the Save as type list, type
Output.asp in the File name list, and then click Save.
The Content folder contains the Input.htm file and the Output.asp file. - Quit Notepad.
Step 3: Create a Web Site
- Start IIS Manager or open the IIS snap-in.
- Expand ServerName, where ServerName is the name of the server, and then expand Web Sites.
- Right-click Default Web Site, and then click Stop.
- Right-click Web Sites, point to New, and then click Web Site.
The Web Site Creation Wizard starts. - Click Next.
- On the Web Site Description page, type
Example in the Description box, and then click Next. - On the IP Address and Port Settings page, click Next.
- On the Web Site Home Directory page, type
c:\inetpub\content in the Path box, and then click Next. - On the Web Site Access Permissions page, verify that only the following check boxes are selected:
Read
Run scripts (such as ASP)
- Click Next, and then click Finish.
The Example Web site is created and you are returned to the Internet Information Services window.
Step 4: Configure the ASP Web Application
- In the Internet Information Services window, right-click Example, and then click Properties.
- Click the Home Directory tab.
- Under Application Settings, click Create.
NOTE: If the Create button is not present, a default application has already been specified. In this case, click Remove to remove the default application, and then click Create. - Clear the contents of the Application namebox, and then type Example.
- Click the Documents tab, and then click Add.
- In the Default Document Name box, type Input.htm, and then click OK.
- In the document list, click Input.htm, and then click Move up until Input.htm is at the top of the list.
- Click OK.
You are returned to the Internet Information Services window.
Step 5: Test the ASP Web Application
- Right-click Example, and then click Browse.
The ASP Web Application page is displayed in the right pane of the Internet Information Services window. - In the Type your name box, type your name, and then click Submit Query.
A message similar to the following is displayed in the right pane of the Internet Information Services window, where
name is the name that you typed:You typed: name
To remove the Example Web site and restart the Default Web Site, follow these steps:
- Remove the Example Web site:
In the Internet Information Services window, right-click Example, click Delete, and then click Yes when the following message appears:Are you sure you want to delete this item?
NOTE: This procedure does not remove the Content directory or the files that it contains.
- To restart the Default Web Site, right-click Default Web Site, and then click Start.
The Default Web Site is restarted.