我正在尝试理解在Apache 2.x下运行的ISAPI。我根据我发现的教程使用Delphi XE创建了一个简单的DLL进行测试。
我已将这些行添加到我的Apache httpd.conf文件中。
ScriptAlias /Delphi/ "C:/Delphi/bin/"
<Directory "C:/Delphi/bin/">
AddHandler isapi-handler .dll
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
isapi_module已加载。
我已将DLL放在C:\ Delphi \ bin。
中当我使用以下URL调用它时(大小写正确); http://127.0.0.1/Delphi/ISAPI_Test1.dll
我收到403错误,Apache错误日志有这一行。
... [error] [client 127.0.0.1] attempt to invoke directory as script: C:/Delphi/bin/
我希望dll只使用默认处理程序:
procedure TWebModule1.WebModule1DefaultHandlerAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
Response.SendRedirect (Request.Referer);
end;
问题1:我的具体问题是什么?
问题2:任何人都可以指点我一步一步的教程或书籍,以获得基本的谢尔顿工作吗?在这一点上,我的理解中有太多漏洞。
谢谢。