You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Mladen Turk <mt...@apache.org> on 2006/08/19 12:55:02 UTC

How to detect the mpm used via apxs?

Hi,

Anyone knows how to detect the mpm used so that
module can be build with/without threading code
depending if the mpm is prefork or any other threaded
one like worker by using apxs?

The only way I can imagine is to parse the stdout from
httpd, but IMHO something like
apxs -q MPM should do the trick like it does for CFLAGS
or INCLUDES.

Regards,
Mladen.

Re: How to detect the mpm used via apxs?

Posted by Enrico Weigelt <we...@metux.de>.
* Mladen Turk <mt...@apache.org> wrote:

Hi,

> Anyone knows how to detect the mpm used so that
> module can be build with/without threading code
> depending if the mpm is prefork or any other threaded
> one like worker by using apxs?

are you shure you really want to know the mpm name instead of
just a flag which tells you if threading is available ?

> The only way I can imagine is to parse the stdout from
> httpd, but IMHO something like
> apxs -q MPM should do the trick like it does for CFLAGS
> or INCLUDES.

Actually, I don't like the whole apxs script at all. Why not just
install an extra .pc file for each installed module, also for
the MPM's ?


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service

  phone:     +49 36207 519931         www:       http://www.metux.de/
  fax:       +49 36207 519932         email:     contact@metux.de
  cellphone: +49 174 7066481
---------------------------------------------------------------------
 -- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops --
---------------------------------------------------------------------

Re: How to detect the mpm used via apxs?

Posted by Enrico Weigelt <we...@metux.de>.
* Guy Hulbert <gw...@eol.ca> wrote:

<snip>

> or if you've already compiled it ...
> 
> $ /usr/sbin/apache2 -V | grep MPM
>  -D APACHE_MPM_DIR="server/mpm/worker"

Bad, very bad. Breaks crosscompiling.

Ah, yeah, apache cannot be crosscompile'd w/o massive manual 
intervention at all ... ;-o

(but I'm working on that ...)


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service

  phone:     +49 36207 519931         www:       http://www.metux.de/
  fax:       +49 36207 519932         email:     contact@metux.de
  cellphone: +49 174 7066481
---------------------------------------------------------------------
 -- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops --
---------------------------------------------------------------------

Re: How to detect the mpm used via apxs?

Posted by Mladen Turk <mt...@apache.org>.
William A. Rowe, Jr. wrote:
> Mladen Turk wrote:
>> Randy Kobes wrote:
>>>>>> Anyone knows how to detect the mpm used so that
>>>>>> module can be build with/without threading code
>>>>>> depending if the mpm is prefork or any other threaded
>>>>>> one like worker by using apxs?
>>> /path/to/apxs -q MPM_NAME
>> That was exactly what I needed.
> 
> Well, that wouldn't exactly tell you that 'classic' mpm works exactly
> (rather than very close to) prefork.  Anyone can write an mpm.
> 
> ap_mpm_query() was made to answer such questions, and creates you a module
> if you test at run-time that will load in either an unthreaded or threaded,
> forked or not forked server.
>

I know that, but I need a way for mod_jk to set the default
-DJK_PREFORK in case the mpm compiled is prefork just like for
httpd 1.3 without the need for --enable-prefork configure flag.

If however ap_mpm_query() returns the non prefork and the module
is compiled with -DJK_PREFORK it will fail to load with error
message.

Regards,
Mladen.




Re: How to detect the mpm used via apxs?

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Mladen Turk wrote:
> Randy Kobes wrote:
>>>>
>>>>> Anyone knows how to detect the mpm used so that
>>>>> module can be build with/without threading code
>>>>> depending if the mpm is prefork or any other threaded
>>>>> one like worker by using apxs?
>>
>> /path/to/apxs -q MPM_NAME
> 
> That was exactly what I needed.

Well, that wouldn't exactly tell you that 'classic' mpm works exactly
(rather than very close to) prefork.  Anyone can write an mpm.

ap_mpm_query() was made to answer such questions, and creates you a module
if you test at run-time that will load in either an unthreaded or threaded,
forked or not forked server.

Re: How to detect the mpm used via apxs?

Posted by Mladen Turk <mt...@apache.org>.
Randy Kobes wrote:
>>>
>>>> Anyone knows how to detect the mpm used so that
>>>> module can be build with/without threading code
>>>> depending if the mpm is prefork or any other threaded
>>>> one like worker by using apxs?
> 
> /path/to/apxs -q MPM_NAME
>

That was exactly what I needed.

Thanks,
Mladen.




Re: How to detect the mpm used via apxs?

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Sat, 19 Aug 2006, Guy Hulbert wrote:

> On Sat, 2006-19-08 at 10:18 -0300, Davi Arnaut wrote:
>> Em 19/08/2006, �s 07:55, Mladen Turk escreveu:
>>
>>> Anyone knows how to detect the mpm used so that
>>> module can be build with/without threading code
>>> depending if the mpm is prefork or any other threaded
>>> one like worker by using apxs?

/path/to/apxs -q MPM_NAME

-- 
best regards,
Randy Kobes

Re: How to detect the mpm used via apxs?

Posted by Guy Hulbert <gw...@eol.ca>.
On Sat, 2006-19-08 at 10:18 -0300, Davi Arnaut wrote:
> Em 19/08/2006, às 07:55, Mladen Turk escreveu:
> 
> > Hi,
> >
> > Anyone knows how to detect the mpm used so that
> > module can be build with/without threading code
> > depending if the mpm is prefork or any other threaded
> > one like worker by using apxs?
> 
> Why use apxs ?

or if you've already compiled it ...

$ /usr/sbin/apache2 -V | grep MPM
 -D APACHE_MPM_DIR="server/mpm/worker"


> 
> mpm.h:
> 
> #define WORKER_MPM
> #define MPM_NAME "Worker"

I thought he must already know this ...

> 
> >
> > The only way I can imagine is to parse the stdout from
> > httpd, but IMHO something like
> > apxs -q MPM should do the trick like it does for CFLAGS
> > or INCLUDES.
> >
> > Regards,
> > Mladen.
> 

-- 
--gh



Re: How to detect the mpm used via apxs?

Posted by Davi Arnaut <da...@haxent.com.br>.
Em 19/08/2006, às 07:55, Mladen Turk escreveu:

> Hi,
>
> Anyone knows how to detect the mpm used so that
> module can be build with/without threading code
> depending if the mpm is prefork or any other threaded
> one like worker by using apxs?

Why use apxs ?

mpm.h:

#define WORKER_MPM
#define MPM_NAME "Worker"

>
> The only way I can imagine is to parse the stdout from
> httpd, but IMHO something like
> apxs -q MPM should do the trick like it does for CFLAGS
> or INCLUDES.
>
> Regards,
> Mladen.