使Delphi 7.0 支持 Apache 2.0.54? ( 积分: 20 )

J

jgame

Unregistered / Unconfirmed
GUEST, unregistred user!
使Delphi 7.0 支持 Apache 2.0.54?


以下是 Apache 2.0.43 版的,Apache 2.0.54能不能跑啊??


我试试,有人跑过吗?




http://www.51delphi.com/wz/11.html
Delphi 7 发行的版本也只支持到Apache 2.0.39 版,对Apache 2.0.40 以后的版本无法支持,本文给出了让Delphi 6和Delphi7 支持最新的Apache 2.0.43 的方法。

首先让我们对Delphi 7 进行改造,Delphi 7.0 不支持 Apache 2.0.40 以后的版本的原因是Apache 2.0.40 以后版本修改了接口文件,因此要对Delphi 7.0 对应的接口文件进行修改,

具体的修改文件为: HTTPD2.pas,修改内容为:

打开 HTTPD2.pas (在c:/ Program Files/borland/delphi7/source/ Internet下)
修改一下常数:
· MODULE_MAGIC_NUMBER_MAJOR = 20020628; { Apache 2.0.40 }

· 如果是Apache 2.0.43 的话,应该修改为

· MODULE_MAGIC_NUMBER_MAJOR = 20020903; { Apache 2.0.43 } MODULE_MAGIC_NUMBER_MINOR = 0; (* 0...n *)

在结构 conn_rec 的定义里加入以下:
· ap_conn_keepalive_e = (AP_CONN_UNKNOWN, AP_CONN_CLOSE, AP_CONN_KEEPALIVE);

在结构 conn_rec 的定义里替换:
· (** Are we still talking? *)

· flags: Cardinal;

· { The following are in the flags bitset:

· unsigned aborted:1;

·

· (** Are we going to keep the connection alive for another request?

· * -1 fatal error, 0 undecided, 1 yes *)

· signed int keepalive:2;

·

· (** have we done double-reverse DNS? -1 yes/failure, 0 not yet,

· * 1 yes/success *)

· signed int double_reverse:2;

· }

为:

(** Are we still talking? *)

flags1: Cardinal;

{ The following are in the flags bitset:

unsigned aborted:1; }



(** Are we going to keep the connection alive for another request?

* @see ap_conn_keepalive_e *)

keepalive: ap_conn_keepalive_e;



flags2: Cardinal;

{ The following are in the flags bitset:

(** have we done double-reverse DNS? -1 yes/failure, 0 not yet,

* 1 yes/success *)

signed int double_reverse:2;

}

好了,保存这个文件,然后拷入c:/ Program Files/borland/delphi7/lib 目录。

重新编译你的程序,加入相应的Apache 的配置(具体配置方法请参照我以前的文章),启动Apache,打开浏览器。 ok! 没问题了吧!好。

现在我们看看怎么在Delphi 6 里面实现Apache 2.0 的支持,实际上很简单,只要把Delphi 7 里面相应的文件拷入 Delphi 6 的LIB 目录就可以了,具体为以下三个文件: ApacheTwoHTTP.pas, ApacheTwoApp.pas, HTTPD2.pas,然后打开你的现有的Apache 1.x 的程序,修改project 上面的 use 部分,把 Apacheapp改为Apachetwoapp,再把下面的ContentType 改为handler,好了,所有手术完成,现在你编译出来的就是支持Apache 2.0.43 的动态共享模块了。

注意:以上的修改为非官方修改,不能保证不出问题,请大家慎重处理。
 
使Delphi 7.0 支持 Apache 2.0.54?


以下是 Apache 2.0.43 版的,Apache 2.0.54能不能跑啊??


我试试,有人跑过吗?




http://www.51delphi.com/wz/11.html
Delphi 7 发行的版本也只支持到Apache 2.0.39 版,对Apache 2.0.40 以后的版本无法支持,本文给出了让Delphi 6和Delphi7 支持最新的Apache 2.0.43 的方法。

首先让我们对Delphi 7 进行改造,Delphi 7.0 不支持 Apache 2.0.40 以后的版本的原因是Apache 2.0.40 以后版本修改了接口文件,因此要对Delphi 7.0 对应的接口文件进行修改,

具体的修改文件为: HTTPD2.pas,修改内容为:

打开 HTTPD2.pas (在c:/ Program Files/borland/delphi7/source/ Internet下)
修改一下常数:
· MODULE_MAGIC_NUMBER_MAJOR = 20020628; { Apache 2.0.40 }

· 如果是Apache 2.0.43 的话,应该修改为

· MODULE_MAGIC_NUMBER_MAJOR = 20020903; { Apache 2.0.43 } MODULE_MAGIC_NUMBER_MINOR = 0; (* 0...n *)

在结构 conn_rec 的定义里加入以下:
· ap_conn_keepalive_e = (AP_CONN_UNKNOWN, AP_CONN_CLOSE, AP_CONN_KEEPALIVE);

在结构 conn_rec 的定义里替换:
· (** Are we still talking? *)

· flags: Cardinal;

· { The following are in the flags bitset:

· unsigned aborted:1;

·

· (** Are we going to keep the connection alive for another request?

· * -1 fatal error, 0 undecided, 1 yes *)

· signed int keepalive:2;

·

· (** have we done double-reverse DNS? -1 yes/failure, 0 not yet,

· * 1 yes/success *)

· signed int double_reverse:2;

· }

为:

(** Are we still talking? *)

flags1: Cardinal;

{ The following are in the flags bitset:

unsigned aborted:1; }



(** Are we going to keep the connection alive for another request?

* @see ap_conn_keepalive_e *)

keepalive: ap_conn_keepalive_e;



flags2: Cardinal;

{ The following are in the flags bitset:

(** have we done double-reverse DNS? -1 yes/failure, 0 not yet,

* 1 yes/success *)

signed int double_reverse:2;

}

好了,保存这个文件,然后拷入c:/ Program Files/borland/delphi7/lib 目录。

重新编译你的程序,加入相应的Apache 的配置(具体配置方法请参照我以前的文章),启动Apache,打开浏览器。 ok! 没问题了吧!好。

现在我们看看怎么在Delphi 6 里面实现Apache 2.0 的支持,实际上很简单,只要把Delphi 7 里面相应的文件拷入 Delphi 6 的LIB 目录就可以了,具体为以下三个文件: ApacheTwoHTTP.pas, ApacheTwoApp.pas, HTTPD2.pas,然后打开你的现有的Apache 1.x 的程序,修改project 上面的 use 部分,把 Apacheapp改为Apachetwoapp,再把下面的ContentType 改为handler,好了,所有手术完成,现在你编译出来的就是支持Apache 2.0.43 的动态共享模块了。

注意:以上的修改为非官方修改,不能保证不出问题,请大家慎重处理。
 
急用,help....
 
顶部