当前位置: 动力学知识库 > 问答 > 编程问答 >

Apache 2.2.21 module error in Delphi 7 (cannot load specific module into server)

问题描述:

I created an Apache 2.2.21 module (DSO) in Delphi 7 and altered the httpd.conf file but when I restart my Apache it raises "cannot load into server. The specified module could not be found" error. I double checked that my module (.so file) is there in apache modules folder. Here is the detail of my computer:

  1. O/S : Windows 7 64bit
  2. Apache: 2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/0.9.8r
  3. Delphi 7 32 bit

I've also converted my copy of httpd2.pas as per the leonardo's blog for Apache 2.2.x version compatibility changes for Delphi 7 but still having the same problem.

Here are are the code and configuration files:

  1. httpd2.pas:

Complete file can be found here (https://github.com/stijnsanders/xxm/blob/master/Delphi/apache/HTTPD2.pas)

  1. httpd.conf entry for my module:

LoadModule myapachews_module modules/mod_myapachews.so

<Location /rktest>

SetHandler mod_myapachews-handler

</Location>

网友答案:

Though I'm honoured a link to a repository of mine ends up in here, I'm also saddened you haven't taken a look at the xxm project since it serves exactly the purpose you're trying to achieve. It also has a Apache HTTPD handler to load xxm projects for you (and keep them portable over IIS, InternetExplorer's IInternetProtocol or a local xxmHttp for debugging).

To answer your question. On Windows, you can keep using the .dll file extension, there's no need to change it to .so which would be incorrect since the Delphi 7 compiler doesn't deliver ELF binaries. Remember to use forward slashes, or double the backslashes since these service as escape characters.

Also check the file is correctly written to Apache HTTPD's modules directory. Or you can use an absolute path in the httpd.conf with the LoadModule directive.

分享给朋友:
您可能感兴趣的文章:
随机阅读: