You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by antoine <an...@gmail.com> on 2009/11/05 13:38:43 UTC

[users@httpd] Apache2 content generators

Hello ,

Is it possible to configure apache to pass a document through 2 or more
content generating modules ??

So far i have understand that only one module can be enabled in the 
content generation phase
per request.

Regards

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache2 content generators

Posted by antoine <an...@gmail.com>.
Andre thank you very much for your response.

I think that putting mod_php (if it is possible) as an output filter is 
the only solution
to my project.

Regards

André Warnier wrote:
> antoine wrote:
>> Eric Covener wrote:
>>> On Thu, Nov 5, 2009 at 10:25 AM, antoine <an...@gmail.com> wrote:
>>>  
>>>> The first one(mine) adds some stuff to the html body and the
>>>> second one is the mod_php that takes the first's results and gives the
>>>> client the final page.
>>>>
>>>>     
>>>
>>> Is running PHP as a filter deprecated?  That'd be an option.
>>>
>>>   
>> Sorry can you explain better. Thanks
>>
>
> Let me roll back a little bit, and then get back to Erik's question 
> above.
>
> Basically, there can only be one Apache "response generator" module.
>
> There can be "input" filters before : they filter the HTTP request and 
> can do something to the request, but not to the result yet, because it 
> is not yet created.
>
> Then there is one "response generator".  That is the one which 
> (usually) gets the basic document from disk (or creates it from 
> scratch), modifies it or not, and produces the HTTP response.
>
> Then there can be more "output" filters, which act on the response 
> already produced by the response generator above, and can modify it 
> some more.
>
> I am unfamiliar with mod_php, but I imagine that it usually functions 
> itself like the "response genrator" above.  Thus, it picks up a 
> document from disk, examines it to see if it contains any php to 
> process, and if yes it processes this php and modifies the original 
> document accordingly. Then it sends out the result as an HTTP response.
>
> If that is how it works, then it is going to be difficult for you to 
> insert something else before it.  Because then, your module would have 
> to pick up the page from disk, do something to it, and then figure out 
> a way to pass that modified document to mod_php to process.  But 
> mod_php wants to pick up the original from disk also, so you have a 
> problem.
>
> On the other hand, if mod_php, like Erik mentions above, can also be 
> configured to work as an output filter (instead of as the content 
> generator), then this may be the solution.
> Your module could then be "content generator" : pick up the original 
> document from disk, produce a HTTP response, and that response would 
> then be processed by mod_php acting as an output filter.
>
> Got it ?
> Now you have to check yourself if mod_php /can/ be configured to work 
> as an output filter, like Erik seems to hint that it can, or could.
>
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server 
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache2 content generators

Posted by André Warnier <aw...@ice-sa.com>.
antoine wrote:
> Eric Covener wrote:
>> On Thu, Nov 5, 2009 at 10:25 AM, antoine <an...@gmail.com> wrote:
>>  
>>> The first one(mine) adds some stuff to the html body and the
>>> second one is the mod_php that takes the first's results and gives the
>>> client the final page.
>>>
>>>     
>>
>> Is running PHP as a filter deprecated?  That'd be an option.
>>
>>   
> Sorry can you explain better. Thanks
> 

Let me roll back a little bit, and then get back to Erik's question above.

Basically, there can only be one Apache "response generator" module.

There can be "input" filters before : they filter the HTTP request and 
can do something to the request, but not to the result yet, because it 
is not yet created.

Then there is one "response generator".  That is the one which (usually) 
gets the basic document from disk (or creates it from scratch), modifies 
it or not, and produces the HTTP response.

Then there can be more "output" filters, which act on the response 
already produced by the response generator above, and can modify it some 
more.

I am unfamiliar with mod_php, but I imagine that it usually functions 
itself like the "response genrator" above.  Thus, it picks up a document 
from disk, examines it to see if it contains any php to process, and if 
yes it processes this php and modifies the original document 
accordingly. Then it sends out the result as an HTTP response.

If that is how it works, then it is going to be difficult for you to 
insert something else before it.  Because then, your module would have 
to pick up the page from disk, do something to it, and then figure out a 
way to pass that modified document to mod_php to process.  But mod_php 
wants to pick up the original from disk also, so you have a problem.

On the other hand, if mod_php, like Erik mentions above, can also be 
configured to work as an output filter (instead of as the content 
generator), then this may be the solution.
Your module could then be "content generator" : pick up the original 
document from disk, produce a HTTP response, and that response would 
then be processed by mod_php acting as an output filter.

Got it ?
Now you have to check yourself if mod_php /can/ be configured to work as 
an output filter, like Erik seems to hint that it can, or could.



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache2 content generators

Posted by antoine <an...@gmail.com>.
Eric Covener wrote:
> On Thu, Nov 5, 2009 at 10:25 AM, antoine <an...@gmail.com> wrote:
>   
>> The first one(mine) adds some stuff to the html body and the
>> second one is the mod_php that takes the first's results and gives the
>> client the final page.
>>
>>     
>
> Is running PHP as a filter deprecated?  That'd be an option.
>
>   
Sorry can you explain better. Thanks

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache2 content generators

Posted by Eric Covener <co...@gmail.com>.
On Thu, Nov 5, 2009 at 10:25 AM, antoine <an...@gmail.com> wrote:
> The first one(mine) adds some stuff to the html body and the
> second one is the mod_php that takes the first's results and gives the
> client the final page.
>

Is running PHP as a filter deprecated?  That'd be an option.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache2 content generators

Posted by antoine <an...@gmail.com>.
André Warnier wrote:
> antoine wrote:
>> Hello ,
>>
>> Is it possible to configure apache to pass a document through 2 or more
>> content generating modules ??
> No.
>>
>> So far i have understand that only one module can be enabled in the 
>> content generation phase
>> per request.
>>
> Maybe if you explained what you are trying to do, and gave some 
> details about which Apache you are using on which system, we might 
> find a better answer.
I want after the metadata processing and after any input filters to have 
2 content generators in the row. For example for .php files to have 2 
handlers. The first one(mine) adds some stuff to the html body and the 
second one is the mod_php that takes the first's results and gives the 
client the final page.

>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server 
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache2 content generators

Posted by André Warnier <aw...@ice-sa.com>.
antoine wrote:
> Hello ,
> 
> Is it possible to configure apache to pass a document through 2 or more
> content generating modules ??
No.
> 
> So far i have understand that only one module can be enabled in the 
> content generation phase
> per request.
> 
Maybe if you explained what you are trying to do, and gave some details 
about which Apache you are using on which system, we might find a better 
answer.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org