Delphi ISAPI dlls on IIS web servers

Delphi ISAPI dlls are ISAPI extensions NOT ISAPI filters.

Ensure you are installing a 32bit dll on a Windows 32bit OS (a 32bit dll can be installed on 64bit OS but requires extra steps).

Installing on Microsoft’s IIS web server v6.0 (Windows Server 2003):

This assumes your website is located on c:\inetpub\wwwroot and you locate your dll files within a folder c:\inetpub\scripts which is a fairly standard configuration.

Copy your isapi dll and any other dll’s it needs to the c:\inetpub\scripts folder.

Open IIS Manager.

Under Websites, you will find a folder of your website (usually named Default website), right click on this and select New… Virtual Directory

Follow the wizard, type an alias which your html files will use as a folder name (eg. SCRIPTS), then on the next screen, select your c:\inetpub\scripts folder as your path.

This will allow your website clients access to the scripts folder which is outside your web directory via \\websitename\SCRIPTS\xxx.dll/dllaction where xxx is the name of your isapi dll and dllaction is the name of the ISAPI action you wish to call.

Still in IIS Manager, click on Web Services Extensions and under tasks, click on “Add a new web service extension”, in the wizard, create a name for your dll (you can use the actual dll filename if you wish), and select the isapi dll and any other dll’s it requires in the required dll section.

With luck, you should be good to go.

If you wish to copy a new version of your isapi dll, you will need to stop the web site (right click on the website in IIS Manager and select Stop, AND, stop the DefaultAppPool which caches your dll by selecting Application Pools, then right click on DefaultAppPool), then once you cave copied your new dll, you need to re-start both of these. (If you don’t have access to IIS Manager, you could remotely just restart the server and try to copy your dll before any user accesses the old version.

DO NOT add your ISAPI dll to the script mapping sections otherwise you will find that whenever a user accesses your dll via the web, only the defined default ISAPI action will run as your script mapped dll is filtering out the action!


No comments yet.

You must be logged in to post a comment.

No trackbacks yet.