You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Alexei Kosut <ak...@nueva.pvt.k12.ca.us> on 1997/07/12 03:41:58 UTC

DLLifying Apache + other stuff (like ISAPI support)

Sorry for the delay. Organic's NFS/email server went down this
afternoon, and still is, which put a damper on some of my plans, as
you can well imagine...

However, I've done the changes I wanted to do for mod_dll, and
uploaded it to ftp://dev.apache.org/httpd/incoming/dllstuff.zip. To
use, follow these instructions:

1. Place libapache.def into the source directory.
2. Place mod_dll.c in the nt directory
3. Add dll_module to nt/modules.c
4. Change apache.mak to produce a DLL:
   - Change the output name from apache.exe to libapache.dll
   - add "/dll /def:libapache.def" to the linker options
5. Compile yourself a libapache.dll. This should also produce a
   libapache.lib. You'll need this later.
6. Make a new project, that creates apache.exe. Link it to
   libapache.lib. VC++ 5.0, at least, needs to have at least one
   source file, so put a blank one in.
7. You should now have a working Apache, as long as apache.exe and
   libapache.dll are in the same directory (or in %PATH%).

To create a module as a DLL:

1. Make a new DLL project. Add the module's source file(s).
2. Add "__declspec(dllexport)" to the declaration of the module's
   module structure. e.g., replace "module status_module;"
   with "module __declspec(dllexport) status_module;".
3. Link it with libapache.lib.
4. Compile it. You should end up with mod_foo.dll.

Now put mod_foo.dll into your server root, add
"LoadModule foo_module mod_foo.dll" to your httpd.conf file.

It should now "just work". But I've probably forgotten something
really important... or it's a freak of nature that it works for
me. But feel free to try it. If I screwed anything up, either in the
directions or in the code, I'll try and fix it (can't fix code until
Monday. Can fix directions 24 hours a day *grin*)

As a "bonus," I've also put into dllstuff.zip a new module I've
written, mod_isapi.c. Stick it in the nt dir, add it to modules.c, put
"AddHandler isapi-isa dll" in your srm.conf, and Apache will load and
run Internet Server Applications (aka ISAPI Extensions). The module
implements all of the ISAPI 2.0 spec except for the asynchronous I/O
stuff, which is labeled "Microsoft-specific" in the spec, and would be
hell to implement in Apache. SO I didn't.

But the rest of the ISAPI spec is implemented. It works with the
couple of sample ISAs that came with IIS. I haven't implemented ISAPI
Filters, those are much harder. But I plan to at least try.

I think that ISAPI support is an important thing to have in Apache for
Windows. Will help us establish a market, will let users take ISAs off
the shelf and run them with Apache as well as IIS and all the other NT
servers (most NT servers, including the non-MS ones, support
ISAPI). So I think it should be a standard module with 1.3.

Or you can use it to try out mod_dll. It works (if you follow the
steps above). As does mod_usertrack, mod_headers and mod_status
(although the restart date is off - 2023 or so. Don't know why
yet). Other modules probably work too, but those are the ones I've
tried.

Have a good weekend.

-- 
________________________________________________________________________
Alexei Kosut <ak...@nueva.pvt.k12.ca.us>      The Apache HTTP Server
URL: http://www.nueva.pvt.k12.ca.us/~akosut/   http://www.apache.org/