关于Delphi7的IntraWeb编译的Apache(DSO)模块

发布时间:2008-08-09 20:24:31 阅读次数:

一。新检一个intraweb project ,我选  apache1的

library IWDSOProject;

uses
  ApacheApp,
  IWInitApache,
  ServerController in 'ServerController.pas' {IWServerController: TIWServerControllerBase},
  IWUnit1 in 'IWUnit1.pas' {formMain: TIWForm1};

{$E so}

{$R *.RES}

exports
  apache_module name 'IWDSOProject_module';

begin
  IWRun(TFormMain, TIWServerController);
end.


二。编译出IWDSOProject.so , 拷到 /apache/modules 里

三。在 apache/conf/httpd.conf 最后加上
LoadModule IWDSOProject_module modules/IWDSOProject.so
<Location /test>
   SetHandler iwdsoproject-handler
</Location>

四。重启 apache服务。

五。可以浏览了喽!   http://localhost/test/


说明一下:LoadModule IWDSOProject_module modules/IWDSOProject.so
IWDSOProject_module 就是你的delphi里的 apache_module name 'IWDSOProject_module'; 中的IWDSOProject_module

SetHandler iwdsoproject-handler
,这个 iwdsoproject 就是你编译出来的文件(.so)前面的文件名的小写,再后面加上 “-handler”