You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Leo Li <li...@gmail.com> on 2008/12/11 09:27:18 UTC

Is it possible to build apache http server as a in-process module?

Hi, all

     I would like to adopt apache http server in my project. But it is
necessary for the http server to be an in-process module to be plugged in
the current system. That is, I would make a little modification to the make
file and build the httpd as a dll/so and export the main method for other
modules to reference. But would it lead to some side-effect?


Thank you in advance.
-- 
Good luck!

Leo Li

Re: Is it possible to build apache http server as a in-process module?

Posted by Morgan Gangwere <0....@gmail.com>.
Nick Kew wrote:
> 
> On 14 Dec 2008, at 05:31, William A. Rowe, Jr. wrote:
> 
>> Leo Li wrote:
>>>
>>>    What I want to do is to plugin an in-process http server module in an
>>> exsiting product to expose its original functionality as web service
>>> (soap over http). :)  Since the existing product is already an
>>> executable one so it seems that the only choice is to write an apache
>>> module to communicate with apache http server and the existing product
>>> by IPC...
>>>    I know there are in-process http server in java but I would not like
>>> to add the burdon of an additional JVM and the cost of JNI calls so I am
>>> now looking for an in-process http server in native language.
> 
> Might an alternative for you be to use apache as a proxy, and
> just write a proxy protocol module to communicate with your
> original application?  You might take the way mod_proxy_ajp
> communicates with a java appserver as a model for that.
> 

... or write your own webserver to do what you want? Python has a nice 
shell of one built right in!

-- 
Morgan Gangwere

Unknown Software
http://sonof.bandit.name/
Member, INCOSE [ incose.org ] PACA [ paca.org ] and NMUG [ nmug.net ]

[indrora@boxly ~]#_

Find me on FreeNode! irc.freenode.net ~indrora on ##linux

Re: Is it possible to build apache http server as a in-process module?

Posted by Nick Kew <ni...@webthing.com>.
On 14 Dec 2008, at 05:31, William A. Rowe, Jr. wrote:

> Leo Li wrote:
>>
>>    What I want to do is to plugin an in-process http server module  
>> in an
>> exsiting product to expose its original functionality as web service
>> (soap over http). :)  Since the existing product is already an
>> executable one so it seems that the only choice is to write an apache
>> module to communicate with apache http server and the existing  
>> product
>> by IPC...
>>    I know there are in-process http server in java but I would not  
>> like
>> to add the burdon of an additional JVM and the cost of JNI calls  
>> so I am
>> now looking for an in-process http server in native language.

Might an alternative for you be to use apache as a proxy, and
just write a proxy protocol module to communicate with your
original application?  You might take the way mod_proxy_ajp
communicates with a java appserver as a model for that.

-- 
Nick Kew

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Is it possible to build apache http server as a in-process module?

Posted by Leo Li <li...@gmail.com>.
On Sun, Dec 14, 2008 at 1:31 PM, William A. Rowe, Jr.
<wr...@rowe-clan.net>wrote:

> Leo Li wrote:
> >
> >    What I want to do is to plugin an in-process http server module in an
> > exsiting product to expose its original functionality as web service
> > (soap over http). :)  Since the existing product is already an
> > executable one so it seems that the only choice is to write an apache
> > module to communicate with apache http server and the existing product
> > by IPC...
> >    I know there are in-process http server in java but I would not like
> > to add the burdon of an additional JVM and the cost of JNI calls so I am
> > now looking for an in-process http server in native language.
>
> This isn't close to a users@ list question.  There is also a modules-dev
> mailing list at the httpd project which discusses the c language sources,
> the API and is more in tune with what you are asking.
>
> You would want to look at one of the MPM implementations under server/mpm/
> and replace/revise it to run in process.  It's a non-trivial exercise but
> certainly is possible.
>
> Bill
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


   Thank you, I would like to have a try of the module.



-- 
Good luck!

Leo Li

Re: Is it possible to build apache http server as a in-process module?

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Leo Li wrote:
>  
>    What I want to do is to plugin an in-process http server module in an
> exsiting product to expose its original functionality as web service
> (soap over http). :)  Since the existing product is already an
> executable one so it seems that the only choice is to write an apache
> module to communicate with apache http server and the existing product
> by IPC...
>    I know there are in-process http server in java but I would not like
> to add the burdon of an additional JVM and the cost of JNI calls so I am
> now looking for an in-process http server in native language.

This isn't close to a users@ list question.  There is also a modules-dev
mailing list at the httpd project which discusses the c language sources,
the API and is more in tune with what you are asking.

You would want to look at one of the MPM implementations under server/mpm/
and replace/revise it to run in process.  It's a non-trivial exercise but
certainly is possible.

Bill

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Is it possible to build apache http server as a in-process module?

Posted by Leo Li <li...@gmail.com>.
On Fri, Dec 12, 2008 at 1:08 AM, Morgan Gangwere <0....@gmail.com>wrote:

>  Leo Li wrote:
>
>>
>> Hi, all
>>       I would like to adopt apache http server in my project. But it is
>> necessary for the http server to be an in-process module to be plugged in
>> the current system. That is, I would make a little modification to the make
>> file and build the httpd as a dll/so and export the main method for other
>> modules to reference. But would it lead to some side-effect?
>>   Thank you in advance.
>> --
>> Good luck!
>>
>> Leo Li
>>
>
> Short answer: its not possible
> Long Answer: Its not possible because apache was designed as a stand-alone
> HTTPd.
>
> Simple solution: write a way for your app to talk to Apache. I.e. write a
> Module that mubmles between your app and apache when it gets a request of
> some kind that it likes.
>
> Past that, why would you want to do what you're talking about?



-- 
Morgan Gangwere

Unknown Software
http://sonof.bandit.name/
Member, INCOSE [ incose.org ] PACA [ paca.org ] and NMUG [ nmug.net ]

[indrora@boxly ~]#_

Find me on FreeNode! irc.freenode.net ~indrora on ##linux

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Thank you for your answer, Morgan.
   What I want to do is to plugin an in-process http server module in an
exsiting product to expose its original functionality as web service
(soap over http). :)  Since the existing product is already an executable
one so it seems that the only choice is to write an apache module to
communicate with apache http server and the existing product by IPC...
   I know there are in-process http server in java but I would not like to
add the burdon of an additional JVM and the cost of JNI calls so I am now
looking for an in-process http server in native language.




-- 
Good luck!

Leo Li

Re: Is it possible to build apache http server as a in-process module?

Posted by Morgan Gangwere <0....@gmail.com>.
Leo Li wrote:
> 
> Hi, all
>  
>      I would like to adopt apache http server in my project. But it is 
> necessary for the http server to be an in-process module to be plugged 
> in the current system. That is, I would make a little modification to 
> the make file and build the httpd as a dll/so and export the main method 
> for other modules to reference. But would it lead to some side-effect?
>  
>  
> Thank you in advance.
> -- 
> Good luck!
> 
> Leo Li

Short answer: its not possible
Long Answer: Its not possible because apache was designed as a 
stand-alone HTTPd.

Simple solution: write a way for your app to talk to Apache. I.e. write 
a Module that mubmles between your app and apache when it gets a request 
of some kind that it likes.

Past that, why would you want to do what you're talking about?

-- 
Morgan Gangwere

Unknown Software
http://sonof.bandit.name/
Member, INCOSE [ incose.org ] PACA [ paca.org ] and NMUG [ nmug.net ]

[indrora@boxly ~]#_

Find me on FreeNode! irc.freenode.net ~indrora on ##linux