You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Chris Villone <cv...@yahoo.com> on 2013/02/14 18:40:23 UTC

[users@httpd] Disable custom modules for a specific directory in my web server

Hi all, 

I have an apache server running on an embedded device that serves webpages to clients using a bunch of custom modules. 

I'm now trying to load some webpages from the device using http://127.0.0.1/foo/blah.html 

These pages don't need any of the custom modules since they don't use any of their processing. 

The problem is apache still runs through all the modules when loading the page and this causes the page to load very slowly even though it's coming from the local filesystem. I've tried using file: to retrieve the pages but then some pages don't display correctly because we are using jquery. 

All the pages that don't need the modules are in a specific directory "foo" under the 'DocumentRoot' 

I've tried re-compiling the modules to checks if the request is coming from 'foo' and disable the processing but it's still isn't good enough because it still runs through the modules. 

I've tried
<Location /foo> 
SetHandler None 
</Location> 

and that didn't work. 

Can I make these files have a different extension like .fhtml and use that? 

Is there a way for me to add another module that makes a check and then stops all the rest from running?

Can this be done with AddHandler/RemoveHandler, mod_rewrite? 

I believe this can be done, but I'm missing something.

We're running Apache/2.2.22 (Unix) 

I've googled and searched the archives but can't find an answer to this question.

Thanks for your time!
Chris

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


Re: [users@httpd] Disable custom modules for a specific directory in my web server

Posted by Tom Evans <te...@googlemail.com>.
On Thu, Feb 14, 2013 at 5:40 PM, Chris Villone <cv...@yahoo.com> wrote:
> Hi all,
>
> I have an apache server running on an embedded device that serves webpages to clients using a bunch of custom modules.
>
> I'm now trying to load some webpages from the device using http://127.0.0.1/foo/blah.html
>
> These pages don't need any of the custom modules since they don't use any of their processing.
>
> The problem is apache still runs through all the modules when loading the page and this causes the page to load very slowly even though it's coming from the local filesystem. I've tried using file: to retrieve the pages but then some pages don't display correctly because we are using jquery.
>
> All the pages that don't need the modules are in a specific directory "foo" under the 'DocumentRoot'
>
> I've tried re-compiling the modules to checks if the request is coming from 'foo' and disable the processing but it's still isn't good enough because it still runs through the modules.
>
> I've tried
> <Location /foo>
> SetHandler None
> </Location>
>
> and that didn't work.
>
> Can I make these files have a different extension like .fhtml and use that?
>
> Is there a way for me to add another module that makes a check and then stops all the rest from running?
>
> Can this be done with AddHandler/RemoveHandler, mod_rewrite?
>
> I believe this can be done, but I'm missing something.
>
> We're running Apache/2.2.22 (Unix)
>
> I've googled and searched the archives but can't find an answer to this question.
>

SetHandler allows you to specify what content handler to use for a
location. SetHandler none causes httpd to step through each registered
content handler until one accepts it.

However there are many other places a module can hook in to. In some
of those steps, all modules hooked in to that step are called, eg in
the URL fixups hook - or the modules are called one by one, until one
handles it, like the content handler hook.

Because of this, you cannot 'remove' modules hooks for one specific
location. Your module will always be called, but your module can also
return DECLINED if it wants nothing to do with the request.

Cheers

Tom

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


Re: [users@httpd] Disable custom modules for a specific directory in my web server

Posted by Pete Houston <ph...@openstrike.co.uk>.
Hello Chris,

Not sure how well it would work for your particular situation, given the
embedded nature, but one approach to this may be to run 2 completely
separate apache instances.

This is often done on servers to distinguish between lightweight and
heavy content: eg. have one stripped down apache for serving images and
static HTML and another one for heavy dynamic content such as mod_perl.

The main downside is that you would need to bind them to either separate
IP addresses or separate ports. eg. have your heavy server bound to
127.0.0.1:80 and the lighter, faster one to 127.0.0.1:81. You can even
proxy from the lighter to the heavier if it all needs to appear as
a single IP/port combo from the outside. They could have completely
different configurations or share as much or as little as required.

HTH,

Pete
-- 
Openstrike - improving business through open source
http://www.openstrike.co.uk/ or call 01722 770036 / 07092 020107