1

I'm trying to understand ISAPI as run under Apache 2.x. I've created a simple DLL using Delphi XE to test with based on a tutorial I found.

I've added these lines to my Apache httpd.conf file.

ScriptAlias /Delphi/ "C:/Delphi/bin/"
<Directory "C:/Delphi/bin/">
  AddHandler isapi-handler .dll    
  AllowOverride None
  Options ExecCGI
  Order allow,deny
  Allow from all
</Directory>

The isapi_module is loaded.

I've placed the DLL in C:\Delphi\bin.

When I call it with the following URL (case is correct); http://127.0.0.1/Delphi/ISAPI_Test1.dll

I get a 403 error and the Apache Error Log has this line.

... [error] [client 127.0.0.1] attempt to invoke directory as script: C:/Delphi/bin/

I expect the dll to simply use the default handler:

procedure TWebModule1.WebModule1DefaultHandlerAction(Sender: TObject;
  Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
  begin
    Response.SendRedirect (Request.Referer);
  end;

Question 1: What is my specific issue here?
Question 2: Can anybody point me to a step by step tutorial or book for getting a basic skelton working? I've got too many holes in my understanding at this point.

Thank you.

Rich Shealer
  • 3,362
  • 1
  • 34
  • 59
  • 1
    I have done a lot of work using Apache but as a "Shared Module" and not "CGI" mode. Have you tried the "Shared Module" approach? Is there a link on the web for the "tutorial I found"?? – M Schenkel Jan 28 '11 at 15:01
  • This post must be moved to ServerFault (where it is indeed duplicated), see my answer. – jachguate Jan 28 '11 at 15:18
  • @M Schenkel The tutorial is older and goes back to Delphi 5. http://delphi.about.com/library/bluc/text/uc060901a.htm – Rich Shealer Jan 28 '11 at 16:52

1 Answers1

2

For this subject, look at serverfault.com, for example, this question: apache attempt to invoke directory as script

Community
  • 1
  • 1
jachguate
  • 16,976
  • 3
  • 57
  • 98