how to configure Delphi 2010 ISAPI.dll in IIS7 64bit? [closed]

最后都变了- 提交于 2019-12-03 21:56:47

As I recall, I had similar problems getting our ISAPI DLL to run in IIS7 on WinSvr2008R2(64b). I wrote down some quick notes to help me repeat the steps that finally got it working. I'll try to provide those here (at least what we did).

  1. Grant "Read & Execute, List folder contents, and Read" rights to IUSR to the folder C:\PathToISAPI_DLL
  2. Copy all DLL files that the ISAPI DLL needs to run into the c:\windows\syswow64 folder (e.g., midas.dll, dbxmss.dll, etc.)
  3. Start IIS Manager
  4. Add the app pool "MyAppPool" [no managed, classic, start now]
  5. Change "Advanced Settings" of new App Pool to allow 32-bit, plus set idle time-out
  6. Add an application "MyApp" to your website using "MyAppPool" and set the physical path to C:\PathToISAPI_DLL

Now you have to do several steps at the DOS prompt to finish configuring things:

cd /d c:\windows\system32\inetsrv

REM *** Grant rights to execute the DLL ***
appcmd.exe set config -section:isapiCgiRestriction /+[path='C:\PathToISAPI_DLL\ISAPI.dll',allowed='true']

REM *** Grant the url of the Execute access for hander mappings ***
appcmd.exe set config "Default Web Site/MyApp/ISAPI.DLL" "/commit:Default Web Site/MyApp" /section:handlers /accessPolicy:Read,Script,Execute

REM *** Make sure you have an ISAPI module mapping for *.dll at that path ***
appcmd.exe list config "Default Web Site/MyApp" /section:handlers | findstr /i *.dll

That's the extent of my notes. I have successfully followed them several times and it has always worked. I have never been able to get it work using just the GUI. I've always had to run the appcmd commands at a DOS prompt to finish configuring things.

Sometimes I still see a 404 error, in which case I delete the web.config from the folder with the ISAPI.DLL and run the last two appcmd commands again. Of course, my ISAPI DLL doesn't have any other settings in the web.config file so it doesn't hurt to just delete it...

Is it not just because the dll is 32 bit and IIS7 is a 64 bit process so is not able to read a Delphi 32 bit dll?

Your main page is static html which is handled by IIS with no problem.

But when IIS tries to load ISAPIGet.dll, it fails because it is not a 64 bit library, or one of its dependency is missing.

  • Are you sure you use a IIS7 app-pool in 32-bit mode?
  • Do you have all needed sub-libraries and bpl in the same path or in c:\windows\syswow64 ?
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!