【求助】WinXP+Apache环境下用Delphi6开发ISAPI的问题 (100分)

  • 主题发起人 主题发起人 叮叮当当
  • 开始时间 开始时间

叮叮当当

Unregistered / Unconfirmed
GUEST, unregistred user!
在WindowsXP+Apache 1.3.24环境下用Delphi 6.0开发ISAPI,新建应用程序的时候选择了
“ISAPI/NSAPI Dynamic Link Library”,增加了一个Action并设置了PathInfo为/test,
然后在Action的事件中写了一段非常简单的代码:

procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;
 Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var
 Page: TStringList;
begin
 Page := TStringList.Create;
 try
  with Page do
 begin
  Add('<HTML>');
  Add('<HEAD>');
  Add('<TITLE>HELLO</TITLE>');
  Add('</HEAD>');
  Add('<BODY>');
  Add('HELLO!');
  Add('<HR>');
  Add('</BODY>');
  Add('</HTML>');
 end;
 Response.Content := Page.Text;
finally
 Page.Free;
end;
Handled := True;
end;

在Apache的 httpd.conf 配置文件里加入了“AddHandler isapi-isa .dll”一行,
重启Server后,在网站运行这个DLL输出如下:

HELLO!
-------------------------------------------------------------------------------
HTTP/1.1 200 OK Date: Sun, 14 Apr 2002 12:53:54 GMT Server: Apache/1.3.24
(Win32) Content: Connection: close Transfer-Encoding: chunked Content-Type:
text/html; charset=iso-8859-1 231
OK
The server encountered an internal error or misconfiguration and was unable to
complete your request.
Please contact the server administrator, webmaster@rtgame.com and inform them
of the time the error occurred, and anything you might have done that may have
caused the error.

More information about this error may be available in the server error log.
--------------------------------------------------------------------------------
Apache/1.3.24 Server at www.rtgame.com Port 80</ADDRE

那个“HELLO!”是程序正常的输出,可是为什么在末尾会加上一大堆Apache的错误讯息呢?
查看Apache Error Log日志显示刚才出的错误是:
ISAPI asynchronous I/O not supported: f:/broodwarweb/cgi-bin/test.dll

后来听一位朋友说应该在建立应用程序的时候选择“Apache Shared Module (DLL)”,
可是我照着做了以后编译的DLL在网站运行时出现了500错误,查看Apache Error Log日志
显示错误为:
DLL could not load GetExtensionVersion(): f:/broodwarweb/cgi-bin/test.dll

请各位大侠帮帮忙啊!谢谢!
 
ISAPI是IIS的东西,apache能支持吗?
 
cgi还差不多
 
哦,居然支持?那是apache没设置好
 
To: Pipi
请教?
 
请教也没用,我没用apache搞过isapi,所以没设置过
我查查资料看有没有发现,5分钟没回来就是搞不掂,没脸回来了
 
下面是Apache关于对ISAPI支持的说明文档:

Apache HTTP Server Version 1.3
Module mod_isapi
This module supports ISAPI Extensions within Apache for Windows.

Status: Base
Source File: mod_isapi.c
Module Identifier: isapi_module
Compatibility: WIN32 only

Summary
This module implements the Internet Server extension API.
It allows Internet Server extensions (e.g. ISAPI .dll modules) to be served
by Apache for Windows, subject to the noted restrictions.

ISAPI extension modules (.dll files) are written by third parties.
The Apache Group does not author these modules, so we provide no support for
them. Please contact the ISAPI's author directly if you are experiencing
problems running their ISAPI extention. Please do not post such problems to
Apache's lists or bug reporting pages.

Usage
In the server configuration file, use the AddHandler directive to associate
ISAPI files with the isapi-isa handler, and map it to the with their file
extensions. To enable any .dll file to be processed as an ISAPI extention,
edit the httpd.conf file and add the following line:

AddHandler isapi-isa .dll

ISAPI extensions are governed by the same permissions and restrictions as CGI
scripts. That is, Options ExecCGI must be set for the directory that contains
the ISAPI .dll file.

Review the Additional Notes and the Programmer's Journal for additional details
and clarification of the specific ISAPI support offered by mod_isapi.

Additional Notes
Apache's ISAPI implementation conforms to all of the ISAPI 2.0 specification,
except for the "Microsoft-specific" extensions dealing with asynchronous I/O.
Apache's I/O model does not allow asynchronous reading and writing in a manner
that the ISAPI could access. If an ISA tries to access unsupported features,
including async I/O, a message is placed in the error log to help with
debugging. Since these messages can become a flood, a new directive;
ISAPILogNotSupported Off, is introduced in Apache 1.3.13.

Some servers, like Microsoft IIS, load the ISA into the server, and keep it
loaded until memory usage is too high, or specific configuration options are
used. Apache currently loads and unloads the ISA for each request.
This is inefficient, but Apache's request model makes this method the only
method that currently works. Apache 2.0 is expected to support more effective
loading and caching methods, with more precise control over individual ISAPI
modules and directories.

Also, remember that while Apache supports ISAPI Extensions, it does not support
ISAPI Filters. Support for filters may be added at a later date, but no support
is planned at this time.
 
这句有问题:
Apache's ISAPI implementation conforms to all of the ISAPI 2.0 specification,
except for the "Microsoft-specific" extensions dealing with asynchronous I/O.
Apache's I/O model does not allow asynchronous reading and writing in a manner
that the ISAPI could access. If an ISA tries to access unsupported features,
including async I/O, a message is placed in the error log to help with
debugging.
 
To: Pipi
有没有办法让Delphi编译的DLL不使用ISAPI 2.0中的Microsoft扩展呢?
 
找了半天,没找到
 
。。。。。。。
我会继续顶这个帖子的,谢谢你!
 
干嘛用apache,用apache就用php好了
 
不如先试试看IIS有没有问题?
 
IIS没有问题的,我试过。
 
将response.content:=page.text;
这一句搬到handled:=true;
这句上面试试,我没有调试环境哎
 
用IIS不好吗?
 
To:叮叮当当,
我现在连win XP下Apache2.0(不是Apache1.X)还没调试通呢,那些地方需要设置呀?
请给些提示.先谢了
 

Similar threads

I
回复
0
查看
811
import
I
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
757
import
I
后退
顶部