httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ras...@lerdorf.on.ca (Rasmus Lerdorf)
Subject Re: Molly and the Apache API
Date Sat, 31 May 1997 13:09:07 GMT
> The other reason, which isn't related to what I've just said but also
> relates to 2.0, is that Apache does not really have a good (built-in)
> dynamic loading facility for modules. It's a pain to add modules to
> Apache: You have to recompile the server, even if the module you're
> adding is precompiled. So it's easier to distribute modules as
> source. Which means that not many people sell Apache modules. Or write
> them for wide distribution in a commercial sense. Which means that
> there's no reason for a server to implement the Apache API.

I have played a bit with mod_dld and mod_php together.  It does work, and
mod_php has an option in its install to configure it to be dynamically
loaded.  This doesn't really make it any easier to install the module, nor
does it have any real performance gains due to the pre-forking nature of
Apache, but it does have some level of nifty-coolness.

Along with a well-documented API, the other idea which has been floating
around here for a while of being able to extend the API through modules
would be a very good thing for 2.0.  Stuff like: mod_msql, mod_mysql,
mod_postgres, mod_ldap, mod_snmp, mod_anydbm, mod_odbc, mod_oracle, etc..
Being able to provide base-support for common things that multiple modules
might need would be a very good thing.  The current regex confusion would
be easily solved with a mod_regex.  Not only does it give module writers a
common consistent interface for each of these, but it also gives us some
level of control of how these external library functions are called.  This
is probably going to be essential when we move to an MT environment.  A
lot of these libraries are not MT-Safe and probably never will be.  We
will have to ensure that only 1 thread at a time enters the library and if
we have 2 separate modules both using the same library directly, we would
have no way of controlling access.  If there was a common access point, we
could, or there would have to be some generic API mechanism whereby
modules would register the fact that they have entered a certain library
and then when they are done they would tell the API mechanism that they
are done.  Holy deadlock problems batman!

The one thing I can't quite figure out is how mod_perl issues could be
solved.  When you write a mod_perl script that does a "Use DBI" at the
beginning for example, and that loads say a MySQL and an Oracle layer,
these are probably not going to be able to make use of any sort of Apache
API abstraction of the respective libraries.  Same goes for the current
regex problem.  Sticking an apache_regexec() function in the API is
probably not going to make anybody run out and rewrite Perl to use these
functions.

-Rasmus


Mime
View raw message