Recipe12.18.Enabling Dynamic Content


Recipe 12.18. Enabling Dynamic Content

Problem

You want to allow dynamic web applications to run on IIS.

Solution

Using a graphical user interface

To enable Active Server Pages (ASP), ASP.NET, Internet Data Connector, Server Side Includes, or WebDAV on your server, do the following:

  1. Open Internet Information Services (IIS) Manager.

  2. In the left pane, expand the server node in the console tree and select Web Service Extensions.

  3. Right-click on the web service extension you want to enable and select Allow.

If the ASP.NET extension is not displayed, you have to install ASP.NET first as follows:

  1. From the Start menu, select Control Panel Add or Remove Programs.

  2. Click Add/Remove Windows Components.

  3. Select Application Server and click Details.

  4. Select ASP.NET and click OK followed by Next.

To enable a specify CGI application or ISAPI DLL to run on your server, do the following:

  1. Open Internet Information Services (IIS) Manager.

  2. In the left pane, expand the server node in the console tree and select Web Service Extensions.

  3. Click the link Add a new web service extension.

  4. Type a descriptive name for the new extension.

  5. Type the full path to the CGI application or ISAPI DLL.

  6. Select the checkbox labeled Set extension status to Allowed and click OK.

To enable all CGI applications or ISAPI DLLs to run on your server, do the following:

  1. Open Internet Information Services (IIS) Manager.

  2. In the left pane, expand the server node in the console tree and select Web Service Extensions.

  3. Right-click either All Unknown ISAPI Extensions or All Unknown CGI Extensions and select Allow.

Using a command-line interface

The following command lists all web service extensions installed (but not necessarily enabled) on the computer:

> iisext /listext

This command enables ASP:

> iisext /enfile C:\Windows\system32\inetsrv\asp.dll

To verify the ASP extension has been enabled, do the following:

> iisext /listfile

The output from this command will display a 1 beside extensions that are enabled and a 0 beside ones that are disabled.

To add and enable a new web service extension for a CGI form handler application called form.exe located in the C:\Inetpub\wwwroot\cgi-bin directory, do the following:

> iisext /addfile C:\Inetpub\wwwroot\cgi-bin\form.exe 1 MyForm 1 "CGI Form Handler"

The first 1 enables the extension and the second 1 allows it to be removed later if desired. The string MyForm is the extension's internal service name, while "CGI Form Handler" is the name displayed in the IIS Manager. Be sure to also give the \cgi-bin folder Scripts and Executables permission in IIS Manager (see Recipe 12.6).

Using VBScript
' This code shows how to enable several extensions. ' ------ SCRIPT CONFIGURATION ------ strComputer = "<ServerName>" ' ------ END CONFIGURATION --------- set objWS = GetObject("IIS://" & strComputer & "/W3SVC") objWS.EnableApplication("WebDAV") objWS.EnableApplication("Active Server Pages") objWS.EnableApplication("Server Side Includes") objWS.EnableApplication("Internet Data Connector") objWS.EnableApplication("ASP.NET") objWS.SetInfo WScript.Echo "Web Services Extensions enabled"

Discussion

Table 12-8 lists the internal service names and executables for several different web service extensions. For the scripting solution, use the name in the Extension column with the EnableApplication method to enable a certain extension.

Table 12-8. IIS web service extensions

Extension

Internal name

Executable

Active Server Pages

ASP

%windir%\system32\inetsrv\asp.dll

ASP.NET

ASP.NET v1.1.4322

%windir%\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll

Internet Data Connector

HTTPODBC

%windir%\system32\inetsrv\httpodbc.dll

Server Side Includes

SSINC

%windir%\system32\inetsrv\ssinc.dll

WebDAV

WEBDAV

%windir%\system32\inetsrv\httpext.dll


See Also

Recipe 12.16, MS KB 332060 (IIS 6.0: Definition of Term Web Service Extension), MS KB 315122 ("HTTP Error 404 - File or Directory not found" error message when you request dynamic content with IIS 6.0), MS KB 328360 (How to enable and disable ISAPI extensions and CGI applications in IIS 6.0), MS KB 327403 (How To: Rename Web Service Extensions in IIS 6.0), MS KB 812405 (PRB: ASP.NET 1.0 Does Not Appear in the Web Service Extension List in IIS 6.0), MS KB 328505 (HOW TO: List Web Server Extensions and Extension Files in IIS 6.0), and MS KB 160422 (How IIS launches a CGI application)



Windows Server Cookbook
Windows Server Cookbook for Windows Server 2003 and Windows 2000
ISBN: 0596006330
EAN: 2147483647
Year: 2006
Pages: 380
Authors: Robbie Allen

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net