You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Alexander Lazic <al...@none.at> on 2005/10/31 16:26:02 UTC

[users@httpd] Rfi (Request for ideas ;-)

Hi,

we have the following requirement.

We have a 2-Tier achitechure witch looks like:

  +----------+
  | Web-Tier |
  +----------+
       |
       |
       V
  +----------+
  | App-Tier |
  +----------+

The webserver apache is configured to prevent calls to the app-tier
by serving html-Files if they can be found locally on the webserver.

Otherwise (if the Files do not exist locally) the request-url will be
changed (file-extension to application-server-extension) and 
passed-through to the app-tier.


Our solution at the moment is:

---
.
.
RewriteCond %{DOCUMENT_ROOT}/index\.html !-s
RewriteRule /index\.html /index\.jsp [PT]
.
.
---

I think there is a 'better' solution out there, isn't it?

I assume that these conditions make apache a little bit slower, because
apache looks on every request on the disk, we have 23 of these
statements.

Does anybody have some nice ideas to prevent that many *stat() calls?

Thanx

Alex ;-)

---------------------------------------------------------------------
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] Rfi (Request for ideas ;-)

Posted by Alexander Lazic <al...@none.at>.
On Mit 02.11.2005 10:47, Joshua Slive wrote:
>On 10/31/05, Alexander Lazic <al...@none.at> wrote:
>>
>> Does anybody have some nice ideas to prevent that many *stat() calls?
>
>Note that this is not as bad as it looks, because mod_rewrite evaluates
>the RewriteRule BEFORE the RewriteCond, so the stat will only happen in
>the above example if the request is for /index.html.

Thanx this i don't have known.

Well thax all for your input i will talk with my customer ;-)

Greetings

Aleks

---------------------------------------------------------------------
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] Rfi (Request for ideas ;-)

Posted by Joshua Slive <js...@gmail.com>.
On 10/31/05, Alexander Lazic <al...@none.at> wrote:
> The webserver apache is configured to prevent calls to the app-tier
> by serving html-Files if they can be found locally on the webserver.
>
> Otherwise (if the Files do not exist locally) the request-url will be
> changed (file-extension to application-server-extension) and
> passed-through to the app-tier.
>
>
> Our solution at the moment is:
> .
> RewriteCond %{DOCUMENT_ROOT}/index\.html !-s
> RewriteRule /index\.html /index\.jsp [PT]
>
> I think there is a 'better' solution out there, isn't it?
>
> I assume that these conditions make apache a little bit slower, because
> apache looks on every request on the disk, we have 23 of these
> statements.
>
> Does anybody have some nice ideas to prevent that many *stat() calls?

Note that this is not as bad as it looks, because mod_rewrite
evaluates the RewriteRule BEFORE the RewriteCond, so the stat will
only happen in the above example if the request is for /index.html.

As Nick mentioned, the best way to handle this is to find some
characteristic of the request that differentiates local and back-end
content.  If the only such characteristic is the existence of the file
on the disk, then obviously, you can't avoid at least one stat.

One alternative might be to rethink your architecture a little.  You
could put all the content (including the static stuff) on the back-end
server, and put apache with mod_cache in front.  Then provided that
the back-end server sends proper cache-control information, you will
almost never touch the back-end server on the cachable static content.

Joshua.

---------------------------------------------------------------------
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] Rfi (Request for ideas ;-)

Posted by Alexander Lazic <al...@none.at>.
On Mon 31.10.2005 15:40, Nick Kew wrote:
>On Monday 31 October 2005 15:26, Alexander Lazic wrote:
>> Hi,
>>
>> we have the following requirement.
>>
>> We have a 2-Tier achitechure witch looks like:
>
>The easy way would be to put something in the paths that can be used as
>an easy lookup.  For example, use /app/...  paths for your app with a
><Location>, or use filenames ending in ".app" with an AddHandler.

Thanx, this was also my idea but my customers don't like this idea :-(

I have assumed that there is a module with fam or similar else to she
some changes in DocumentRoot and then you get a $FLAG into the Apache.

I'am not sure that these should be a part of a httpd.

Greetings

Aleks

---------------------------------------------------------------------
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] Rfi (Request for ideas ;-)

Posted by Nick Kew <ni...@webthing.com>.
On Monday 31 October 2005 15:26, Alexander Lazic wrote:
> Hi,
>
> we have the following requirement.
>
> We have a 2-Tier achitechure witch looks like:

The easy way would be to put something in the paths that
can be used as an easy lookup.  For example, use /app/...
paths for your app with a <Location>, or use filenames
ending in ".app" with an AddHandler.

-- 
Nick Kew

---------------------------------------------------------------------
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