Codecore Logo
Quick Search
»
Advanced Search »

Configuring IIS for J9SP

RSS

IIS Version Reference

  • IIS 5.0 : Windows XP Home, Windows 2000
  • IIS 5.1 : Windows XP Professional
  • IIS 6 : Windows 2003 Server
  • IIS 7 : Windows Vista, Windows 7, & Windows 2008 Server

Simple IIS Configuration

What the installer does

The installer does most of the work for you. It creates a web site directory that contains all the files required to use .j9sp files.

This includes creating the following in the Common Program Data Directory:

  • Creates a directory named "WebSite".
  • Installs a web.config file in the WebSite directory that is compatible with IIS 5.x, IIS 6, and IIS7.
  • Installs the necessary dll files in the WebSite/bin directory.
  • Installs a sample default.j9sp file in the WebSite directory.

The web.config file tells IIS how to handle .j9sp files.

The installer does not create a web site or virtual directory in IIS for you. This is explained in the next step.

Create a website or virtual directory in IIS

Configuring IIS should just require that the user point a web site or virtual directory at the wwwroot directory and add the .j9sp mapping as described below in step 1.

IIS 5.x & IIS 6

See Step 1 in the Manual Installation section below.

IIS 7

In IIS 7, right click the web site or virtual directory to add the new application path to. For example right click the "Default Web Site" node. Select "Add Application..." and enter the following settings:

Alias: elve
Application Pool: Create or choose any application pool which has it's Managed Pipeline mode set to Integrated (NOT Classic).
Physical path: C:\ProgramData\Codecore Technologies\Elve\WebSite

Click OK.

Ensure ASP.NET is registered with IIS

ASP.NET is sometimes not registered with IIS.

To ensure it is run the following command:
  • 32 bit OS: C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i
  • 64 bit OS: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -i

Test the web site

If you are using the sample Elve web site and you used the settings specified above you can use the URL below:

http://localhost/elve/default.j9sp

Manual Installation

Manual Installation is usually unnecessary. The Elve installer can set almost everything up for you. See the Simple IIS Configuration section if you used the Elve installer to install the sample web site.

IIS 5.x & IIS 6

STOP: If you are using IIS 7.x (Windows Vista, Win 7, and Windows 2008) then skip this section and jump directly to the IIS 7 section.

1. Configure IIS

This step tells IIS to let ASP.NET 2.0 manage the .j9sp file extension.

Note: You must be a member of the Administrators group on the local computer to perform the following procedure or procedures. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run IIS Manager as an administrator. At a command prompt, type runas /User:Administrative_AccountName"mmc %systemroot%\system32\inetsrv\iis.msc".

  • Create a new virtual directory (/elve for example) pointing to your web directory.

The default website path is C:\ProgramData\Codecore Technologies\Elve\WebSite

  • Access Permissions: check Read, Execute (such as ISAPI applications or CGI)
  • Right-click the virtual directory and select Properties
  • On the Virtual Directory tab, click Configuration
  • On the mappings tab add a new Wildcard application map:

Executable: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
Extension: .j9sp
Verbs: All Verbs
Check both Script engine and Check that file exists.

Note: If the OK button remains greyed out, review the following Microsoft IIS Bug Workaround

For addition information, see Setting Application Mappings in IIS

2. Add httpHander to web.config

This step tells ASP.NET 2.0 which .net http handler to use for the .j9sp file extension.

Add the httpHandler reference to the web.config file in your web directory. If the file does not exist, here is a simple bare bones file:


<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.web>
        <httpHandlers>
            <add path="*.j9sp" verb="*" type="WebLibrary.J9SP_HttpHandler, WebLibrary" validate="true" />
        </httpHandlers>
    </system.web>
</configuration>

3. Copy dll files to bin directory

This step makes the ASP.NET 2.0 http handler available to the web application.

  • Create a bin directory in the web directory.
  • Copy WebLibrary.dll and CodecoreTechnologies.Elve.dll from the installation path which is usually C:\Program Files\Elve\ into the web directories bin sub directory.

Alternate Advanced Setup - Using the GAC

This step uses the Global Assembly Cache to make the http handler globally available to all applications without the need to have the dlls in the web application's bin directory or have the to reference the http handler in the web application's web.config file.

You may alternatively register the dlls in the Global Assembly Cache (GAC) which replaces steps to 2 and 3 above.

  • Register WebLibrary.dll and CodecoreTechnologies.Elve.dll in the Global Assembly Cache (GAC).

Windows XP only:

Copy the 2 files to the c:\windows\assembly\ directory in Windows XP.

Windows Vista:

Windows Vista requires elevated permissions to access the GAC, so you must use the gacutil console application from an elevated permissions console window. This also works with Windows XP.

To launch an elevated command prompt in Vista, simply press the Win key; type cmd; press Ctrl+Shift+Enter; and then hit Alt+C to confirm the elevation prompt.

gacutil /i CodecoreTechnologies.Elve.dll
gacutil /i WebLibrary.dll

  • web.config configuration:

If the dlls are registered in the GAC, the web.config file must include the full type name as seen below. Be sure the version number in the type name matches the version number of the WebLibrary.dll file in the GAC.

Since the dlls are in the GAC, the http handler reference can be:

Added to the system web.config file at: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config

- or -

Added to the web application directory's web.config file can have the full type name http handler reference.

<add path="*.j9sp" verb="*" type="WebLibrary.J9SP_HttpHandler, WebLibrary, Version=1.0.1.2, Culture=neutral, PublicKeyToken=1442df3824b3f6c4" validate="true" />

Be sure to update the version # in the line above to the currently installed version of the file.

IIS 7.x (Windows Vista, Win 7, and Windows 2008)

J9SP can use IIS 7's Integrated Pipeline mode which means you're taking full advantage of all the new features and underlying architecture of IIS7. It can also run in Classic Mode which basically means you want the site to operate as if it were running in IIS6.

IIS 7 uses a slightly different web.config structure to reference http handlers:


<system.webServer>
	<handlers>
		<add name="j9sp" path="*.j9sp" verb="*" type="WebLibrary.J9SP_HttpHandler, WebLibrary" />
	</handlers>
</system.webServer>

Reference

Use a Single Web.Config for IIS6 and IIS7
IIS 7.0: Add a Managed Handler Mapping
HttpModule and HttpHandler sections in IIS 7 web.config files

Troubleshooting

  • Ensure the app's application pool has it's Managed Pipeline Mode set to Integrated (not CLASSIC)
  • Ensure ASP.NET is registered with IIS
    • 32 bit OS: C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i
    • 64 bit OS: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -i
Privacy Policy | Conditions Of Use

Copyright ©2014 Codecore Technologies, All rights reserved.