Recipe 12.18. Enabling Dynamic ContentProblemYou want to allow dynamic web applications to run on IIS. SolutionUsing a graphical user interfaceTo enable Active Server Pages (ASP), ASP.NET, Internet Data Connector, Server Side Includes, or WebDAV on your server, do the following:
If the ASP.NET extension is not displayed, you have to install ASP.NET first as follows:
To enable a specify CGI application or ISAPI DLL to run on your server, do the following:
To enable all CGI applications or ISAPI DLLs to run on your server, do the following:
Using a command-line interfaceThe 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" DiscussionTable 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.
See AlsoRecipe 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) |