Sunteți pe pagina 1din 9

Chau Chee Yang Technical Blog

Friday, October 02, 2009


Configure Windows 7 IIS7 for ISAPI DLL
Windows 7 IIS7 require some configurations to get ISAPI DLL works. It is not that straight forward compare to IIS 5.
Go to Control Panel | Programs and Features | Turn on Windows features on or off (require privilege mode). 1.
Check Internet Information Services and make sure ISAPI Extensions and ISAPI Filters is checked as well. 2.
Click OK button to start installation. 3.
After finish install IIS 7, open your favorite web browser and enter URL http://localhost/ to make sure the IIS is working
and running. You might need to check your firewall setting and add exception for port 80 TCP traffic if necessary.
First, you may need to add a virtual directory to host your ISAPI DLL:
Open Internet Information Service Manager (require privilege mode) 1.
Right click on Default Web Site node and click Add Virtual Directory of popup menu: 2.
Install IIS 7
Configure for ISAPI DLL
Add Virtual Directory
Chau Chee Yang
View my complete profile
About Me
dbExpress for Firebird
e Stream Software
Favorite Links
2012 (10)
2011 (27)
2010 (15)
2009 (27)
December (1)
November (1)
October (5)
DataSnap:
In-process
IAppServer
connection via
TDS...
DataSnap:
In-Process
Server Method
Linux: Configure a
local repository
from ISO image...
Setup a VMWare
machine to
simulate low
speed TCP/I...
Configure Windows
7 IIS7 for ISAPI
DLL
August (2)
July (2)
June (4)
May (1)
April (2)
March (2)
February (3)
January (4)
2008 (31)
2007 (12)
Blog Archive

Chau Chee Yang Technical Blog: Configure Windows 7 IIS7 for ISAP... http://chee-yang.blogspot.it/2009/10/configure-windows-7-iis7-for-isap...
1 di 9 08-Jul-14 10:21 AM
Enter Alias and Physical Path of the virtual directory:
To enable ISAPI for the virtual directory:
Select the virtual directory node (e.g.: ISAPI in this example). 1.
Double click the Handler Mappings icon. 2.
Click Edit Feature Permissions in Actions panel 3.
A Edit Feature Permission dialog prompt out 4.
Check Execute. 5.
Click OK button to commit the changes. 6.
This is optional but is convenient. To enable Directory Browsing for a virtual directory:
Select the virtual directory node (e.g.: ISAPI in this example). 1.
Double click the Directory Browsing icon. 2.
Click Enable in Actions panel. 3.
Enable ISAPI for Virtual Directory
Enable Directory Browsing for Virtual Directory
Chau Chee Yang Technical Blog: Configure Windows 7 IIS7 for ISAP... http://chee-yang.blogspot.it/2009/10/configure-windows-7-iis7-for-isap...
2 di 9 08-Jul-14 10:21 AM
Select the virtual directory node. 1.
Double click the Authentication icon. 2.
Click to select Anonymous Authentication item. 3.
Click Edit in Actions panel. 4.
A dialog will prompt out. 5.
Checked Application pool identity and press OK button to commit changes. 6.
Click on the root node. 1.
Double click the ISAPI and CGI Restrictions icon. 2.
Click Edit Feature Setting in Actions panel. 3.
Check Allow unspecified ISAPI modules option. This option allow any ISAPI dll to be executed under IIS. If you
dont use this option, you will need to specify a list of ISAPI DLLs explicitly.
4.
Select the virtual directory node (e.g.: ISAPI in this example). 1.
Right click on the node and click Edit Permission of popup menu. 2.
A Properties dialog prompt out. 3.
Switch to Security page 4.
Click Edit button to show Permission dialog. 5.
Add IIS_IUSRS into the permission list. 6.
Edit Anonymous Authentication Credentials
Enable ISAPI modules
Edit Permission for Virtual Directory
Chau Chee Yang Technical Blog: Configure Windows 7 IIS7 for ISAP... http://chee-yang.blogspot.it/2009/10/configure-windows-7-iis7-for-isap...
3 di 9 08-Jul-14 10:21 AM
This is only require if you are using IIS7 x64 and would like to run 32 bits ISAPI DLL on the IIS. If your ISAPI DLL and
IIS7 is both x86 or both x64, you may skip this step.
Click Application Pools node. 1.
Click DefaultAppPool item 2.
Click Advanced Settings from Actions panel. 3.
A Advanced Settings dialog prompt out 4.
Set Enable 32-bits Applications to True 5.
Click OK button to commit changes 6.
If you didnt enable this options for 32 bits applications, you may encounter the following errors when execute the ISAPI
from web browser:
The page cannot be displayed because an internal server error has occurred.
HTTP Error 500.0 - Internal Server Error
Module IsapiModule
Notification ExecuteRequestHandler
Handler ISAPI-dll
Error Code 0x800700c1
Requested URL http://localhost:80/isapi/isapi.dll
Physical Path C:\isapi\isapi.dll
Logon Method Anonymous
Logon User Anonymous
You may now deploy your ISAPI DLLs into the virtual directory and start execute the library from web browser.
You may create Delphi DataSnap ISAPP DLL library and deploy on IIS. From time to time, you may encounter
compilation error during development or deployment time if you have consume the ISAPI DLL. This is because the ISAPI
DLL invoked will cache in the application pool. You are not allow to overwrite the ISAPI DLL while its being cached.
To overcome this problem, you need to perform Recycle operation:
Enable 32 bits ISAPI DLL on IIS 7 x64
HTTP Error 500.0 - Internal Server Error
DataSnap and ISAPI DLL
Chau Chee Yang Technical Blog: Configure Windows 7 IIS7 for ISAP... http://chee-yang.blogspot.it/2009/10/configure-windows-7-iis7-for-isap...
4 di 9 08-Jul-14 10:21 AM
Click Application Pools node. 1.
Right click on DefaultAppPool item and click Recycle item. 2.
Deploying as ISAPI DLL is encourage during deployment stage as IIS will cache the ISAPI DLL for performance
consideration.
However, the caching might not feasible during development stage as recycling need to be performed while overwrite the
ISAPI DLL either by frequent compiling or overwriting. You may consider compile the server modules as CGI application
in development time. Each invocation of CGI is a separate OS process and wont be cache by IIS application pool.
Go to Control Panel | Programs and Features | Turn on Windows features on or off (require privilege mode). 1.
Check Internet Information Services and make sure CGI is checked. 2.
Click OK button to start installation. 3.
Click on the root node. 1.
Double click the ISAPI and CGI Restrictions icon. 2.
Click Edit Feature Setting in Actions panel. 3.
Check Allow unspecified CGI modules option. 4.
Install CGI on IIS
Enable CGI Module
Chau Chee Yang Technical Blog: Configure Windows 7 IIS7 for ISAP... http://chee-yang.blogspot.it/2009/10/configure-windows-7-iis7-for-isap...
5 di 9 08-Jul-14 10:21 AM
Posted by Chau Chee Yang at 10:21:00 AM
Labels: Delphi, Internet, Windows
The DataSnap server methods are using JSON as data stream via REST protocol. For example, a simple EchoString
server method defined as:
type
{$MethodInfo On}
TMyServerMethod = class(TPersistent)
public
function EchoString(Value: string): string;
end;
{$MethodInfo Off}
implementation
function TMyServerMethod.EchoString(Value: string): string;
begin
Result := Value;
end;
To access this method compiled in ISAPI DLL via URL, the URL is something like
http://localhost/datasnap/MyISAPI.DLL/datasnap/rest/TMyServerMethod/EchoString/Hello
and the response text will be:
{"result":["Hello"]}
Likewise, a CGI URL is
http://localhost/datasnap/MyCGI.exe/datasnap/rest/TMyServerMethod/EchoString/Hello

Reference:
DataSnap 2010 HTTP support with an ISAPI dll; Author: Tierney, Jim 1.
Consume DataSnap Server Methods via URL
34 comments:
raghu said...
It was very helpful.Thanks.
8:20 PM
Cestbienmoi said...
Changing the default app pool is not the best choice on x64 => conflict with other applications.
It is better to create a new App Pool (32 bit without .net framework). And assign the pool to the new virtual directory.
Be carefull on production server (iis7/7.5). You do not need to authorize unknown isapi on production server, in
handler mappings, you can "add Module Mapping" and specify your DLL as parameter of the isapi module.
12:28 AM
Anonymous said...
Hi
I'm just wondering if you know a shared web hosting company supporting Delphi ISAPI.DLL's?
Thanks
Sam
6:54 AM
Anonymous said...
Thanks for your help. This was a very good blog post, especially the part about the 32-bit settings.
Cheers, Trutz
5:25 PM
Alexandre Machado said...
Nice how-to, thanks! The only comment is that is really better to create a new application pool and use it with your
ISAPI modules.
Best reagards
2:46 AM
Chau Chee Yang Technical Blog: Configure Windows 7 IIS7 for ISAP... http://chee-yang.blogspot.it/2009/10/configure-windows-7-iis7-for-isap...
6 di 9 08-Jul-14 10:21 AM
Anonymous said...
Great Article!. It works for me 100%
4:34 AM
grumfe said...
Thank you! It's like a miracle to find info about how to make this work. Thanks for posting this!
3:45 AM
Anonymous said...
Thanks it was a great help and a step in the right direction but I'm still having problems connecting to a database.
The Isapi dll doesn't seem to read the config file where the connection string is.
4:05 PM
Chau Chee Yang said...
Perhaps you need to check the log and figure out why it doesn't work.
9:21 PM
Harmen Schaap said...
You saved my day !!!
After searching for a day I finally found this great article. This worked 100% for me.
12:10 AM
Anonymous said...
Very Nice!!!
I wasted a good time trying this alone. My experience with configuration of II6 was not enough.
Thanks
Aceto
7:53 AM
Anonymous said...
Thanks,
This post save a lot of working time.
Aceto
7:56 AM
Paul said...
Hi,
Thank you very much for this post. If helped me configure ISS 7 to use some Delphi Isapi dlls in few minutes.
Thank you again.
4:49 AM
Nase said...
Hi. I have IIS on Win7 OS and wanted to run ASP.Net 4.0 and PHP5.3. ASP.Net makes no problems and works
without any problem and without configuration. PHP5.3 always throws the error: HTTP-Fehler 500.0 - Internal
Server Error
C:\php5\php.exe - Der FastCGI-Prozess wurde unerwartet abgebrochen. Perhaps anyone has an idea?
10:42 PM
Antoniazzi said...
Perfect for Win7 64bits and ISAPI dlls.
Tks
6:10 PM
Antoniazzi said...
Perfect for Win7 64bits and Delphi Dlls.
6:10 PM
Chau Chee Yang Technical Blog: Configure Windows 7 IIS7 for ISAP... http://chee-yang.blogspot.it/2009/10/configure-windows-7-iis7-for-isap...
7 di 9 08-Jul-14 10:21 AM
mrozlog said...
Awesome Job!
Mike Rozlog
2:01 PM
Anonymous said...
After scratching my head for 4 hours I came across this article and get the issue fixed.
Many thanks and keep on the nice work.
6:32 PM
Anonymous said...
THANK YOU! THANK YOU! THANK YOU! Why can't Microsoft's own documentation be this good?
You have saved me after I wasted A LOT of time following other sources. The 32-bit step was particularly important
for me.
Finally, I have my old C++ ISAPI .dll working in IIS.
11:02 PM
Marcelo said...
Thank you. This was very helpful.
6:08 AM
Anonymous said...
Thank you very much!!!
Excellent work.
Do you also know how to run IIS as a proccess and not as Service?
[ ]s
Duran
7:17 AM
Chau Chee Yang said...
I have no idea how to configure IIS7 to run as application. You may try ask in http://serverfault.com/
6:00 PM
Siva said...
Thanks for your tutorial.I developed ISAPI web application in dephi 7.Its working fine in windows xp but its not
working on windows 7 32 bit.I did the same settings in IIS7 what mention in this article.For windows xp i did the
component service for particular virtual directory identity account is system account is selected.I couldn't found this
settings in windows.Please help to solve this problem.I am waiting for reply.Advance thanks to you
3:15 PM
Chau Chee Yang said...
Siva, which windows settings you refer to? Perhaps you need to read carefully and try redo everything from scratch
again.
8:59 AM
Siva said...
Thanks for your quick reply.I tried so many times.My Delphi XE ISAPI dll working fine in Windows XP.The same
application is not running in Windows 7 32 bit.I did the same settings what u mention the steps.In windows XP
InetMgr Virtual Directory Tab Application Protection is High(Isolated) settings.I couldn't found the settings in
Windows 7.How i can set this settings in Windows.Please help to solve this problem.Advance thanks to you.
Thanks & Regards
Siva
11:47 AM
Andy said...
With your help I finally got my ISAPI up and running. Thank you very much!
9:09 AM
Chau Chee Yang Technical Blog: Configure Windows 7 IIS7 for ISAP... http://chee-yang.blogspot.it/2009/10/configure-windows-7-iis7-for-isap...
8 di 9 08-Jul-14 10:21 AM
Newer Post Older Post Home
Subscribe to: Post Comments (Atom)
Post a Comment
Anonymous said...
This is not pure Windows 7 specific: on Windows server 2008 you can follow the same things (OK, it's IIS7/7.5 to
on that platform ;)
To bad I already figured this out myself a few days ago (this would have made my task a lot easier).
4:24 PM
Luis Ortega said...
Works perfect, however for some strange reason it does not work under secure site (https/SSL). Same DLL!
2:20 AM
SathishKumar Sandupatla said...
really superb... it helps me to place ISAPI dlls in Windows IIS7.
6:19 PM
Anonymous said...
Thanks, you saved me hours of headscratching
8:34 AM
Anonymous said...
Thanks for your help.
This was a great blog post, especially the part about the 32-bit settings.
Cheers
Ernesto.
8:48 AM
Anonymous said...
Thanks for your help.
5:05 AM
Cosmin said...
Have a long and prosperous life :)
7:08 PM
Anonymous said...
After configure this while i am trying to execute asp.net code which is save in c:\inetpub\webapplication1
\webapplication1\default.aspx error occuted like this... what to do?? any suggestion.. i am using windows 7 ultimate
32 bit os.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please
review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond
application level. This error can be caused by a virtual directory not being configured as an application in IIS.
11:19 PM
Powered by Blogger.
Chau Chee Yang Technical Blog: Configure Windows 7 IIS7 for ISAP... http://chee-yang.blogspot.it/2009/10/configure-windows-7-iis7-for-isap...
9 di 9 08-Jul-14 10:21 AM

S-ar putea să vă placă și