Link to home
Start Free TrialLog in
Avatar of Motaz
Motaz

asked on

ISAPI and so

I installed apache 2.
How can I execute ISAPI dll and .so files,
how can I configure it, and where should I put it, in cgi-bin?

and how can I call it from the browser.
I'm using Windows 2000
Thanks
Motaz
Avatar of bansidhar
bansidhar
Flag of India image

ISAPI Dll and .so files are Apache loadable modules. These are loaded when the server is started. These are designed as helper functions for web server.

You can put these files whereever you want (No restriction). Only restrictions is that the server should have suficient permission for those files. Normally the .so files are put in the modules directory.

Check C:\Program Files\Apache Group\Apache2\modules directory

To configure youhave to use the LoadModule directive.

The syntax is

LoadModule module filename

eg:
   LoadModule access_module modules/mod_access.so

another example:
Loading php ISAPI module

   LoadModule php4_module c:/php/sapi/php4apache.dll
   AddModule mod_php4.c
   AddType application/x-httpd-php .php

Note: PHP ISAPI module is still experimental and may not work.

Need further clarification? Please let me know.

bansidhar
Avatar of Motaz
Motaz

ASKER

Thanks for your reply,
but how can I call that files from the browser.
There is already existing .so files in modules directory, but I don't know how to call it.

Motaz
As I stated earlier these are for adding additional functionality to the server. You don't have to call it. It is being called from the web server as and when require.

for example:

If you run any PHP script the server calls the php4apache.dll to parse the script and sends you the result.

bansidhar
Avatar of Motaz

ASKER

I mean, how the clients use this web application,
for example:

http://myservername/mydll.dll
or
http://myservername/myDSO.so

Motaz
These are not web application. These are web server extensions and cannot be called from the client as you are refering.
Avatar of Motaz

ASKER

So what is the difference between web server application and extension.
I'm using Delphi to generate CGI web applicaion, and it works fine in apache, then I changed that CGI to ISAPI in Delphi by changing some lines, but the application is the same (Web application).
Motaz
Here you can call the ISAPI same way you were calling the CGI.
Avatar of Motaz

ASKER

I tried to call it, but I get permission error
Can you give me the details of the exact error you are getting.

"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"

Please go through
http://httpd.apache.org/docs/mod/mod_isapi.html

bansidhar

Avatar of Motaz

ASKER

I put ISAPI dll inside cgi-bin directory.
I get "You have no permission to run this file"

Motaz
Avatar of Motaz

ASKER

I already added this line in configuration file:

AddHandler isapi-isa .dll
ASKER CERTIFIED SOLUTION
Avatar of SebbeDK
SebbeDK

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Motaz

ASKER

I do that steps:

LoadModule Mediations_module modules/MonitorDSO.so

<Location /mediations>
SetHandler MonitorDSO-handler
</Location>

but I cann't start the service, it gave me this error:

Syntax error on line 173 of C:/Program Files/Apache Group/Apache2/conf/httpd.con
f:
Cannot load C:/Program Files/Apache Group/Apache2/modules/MonitorDSO.so into ser
ver: The specified module could not be found.

I tried to rename the file to m.so for case sensitivity, also I get the same error
I put that file in modules directory
Motaz
Did you create it as an Apache 1.x shared module?

You can check if you did by looking at the DPR's source.

If if's for Apache 1.x the uses clause should be something like this for a standard SO:

uses
  WebBroker,
  ApacheApp,
  Unit1 in 'Unit1.pas' {WebModule1: TWebModule};

If that's the case, then you need to change the ApacheApp to ApacheTwoApp, so it looks something like this:

uses
  WebBroker,
  ApacheTwoApp,
  Unit1 in 'Unit1.pas' {WebModule1: TWebModule};

Avatar of Motaz

ASKER

I'm using IntraWeb in Delphi 7
no WebBrocker at all
I tried Apache 1, and Apache 2 DSO, but I get the same result
And you're 100% positive the file's located in C:/Program Files/Apache Group/Apache2/modules?
Avatar of Motaz

ASKER

Yes, I'm sure.
I even write it in case sensitive
Avatar of Motaz

ASKER

Finally I decided not to use Apache at this time, may be I may use it in newer versions when they make a GUI settings same like IIS, and after they support ISAPI without writing alot of lines in mystery httpd.conf

Thanks every one
Motaz
www.geocities.com/motaz1
I have encountered exactly the same problem. It does not seem to be caused by syntax errors but actually a problem in the format of the .so file. One of the Delphi developers put up a link for an unofficial patch to get Delphi 7 to work for Apache versions greater than 2.0.39 at http://www.drbob42.com/delphi7/apache2040.htm. I believe that this is causing the problem and this patch may fix the problem. I haven't used it yet but it seems like the most likely solution.
I seem to have found the cause of your .so problem Motaz. Basically it is being caused by the "brilliant" documentation from IntraWeb. In order to get even a basic IntraWeb DSO to work you need to change quite a bit.

Firstly you need to change the delphi source as described in the link ttp://www.drbob42.com/delphi7/apache2040.htm. Then copy these 3 pas files into your project directory and include them in the project.

ApacheTwoApp
ApacheTwoHTTP
HTTPD2

The only one you edit is HTTPD2 but the others are dependent.

Secondly you need to change the IWInitApache to IWInitApacheTwo and then it seems to work fine. Just stick it in the modules directory, setup the LoadModule and Location in the .conf file. See http://www.blong.com/Articles/Apache%20For%20Windows/ApacheWindows.html#WritingDSOs. And it should all come together.

Fluffy54