You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Roman Kunert <rk...@yobe.org> on 2003/11/11 17:07:17 UTC

[users@httpd] parsing SSI files after rewriting and proxying

Hello

I have an Apache httpd 2.0.48 that covers a tomcat 4.1.27 engine by
using mod_rewrite and mod_proxy. Servlet on tomcat generates dynamic
.htm pages that include other files via SSI directive "<!--#include
virtual="test.jsp"-->". What I want is that SSI code gets parsed and
interpreted after rewriting and proxying process. If I only use the
ProxyPass and ProxyPassReverse directives everything works just fine but
if I add some rewriting with the [P] flag the include process fails
because apache does not seem to forward the request to tomcat but rather
tries to find the files to be included on the local filesystem relative
to DocumentRoot. Here's my configuration:

--- this does not work! ----------------

RewriteEngine On
RewriteLog "/var/log/apache2/rewrite.log"
RewriteLogLevel 5

RewriteRule "^/jsp/(.*)" "http://localhost:8180/$1" [P]
SetOutputFilter INCLUDES

---- but this does work! ----

ProxyPass /jsp http://localhost:8180/
ProxyPassReverse /jsp http://localhost:8180/
SetOutputFilter INCLUDES

the error is visible both with the statement "[an error occurred while
processing this directive]" on the dynamic .htm page and in the error log:

[error] [client 127.0.0.1] File does not exist: /var/www/apache2-default/jsp
[error] [client 127.0.0.1] unable to include "/jsp/test.jsp" in parsed
file proxy:http://localhost:8180/test.htm

here I have accessed the page test.htm that resides in tomcat and
includes the file test.jsp from the same directory.
/var/www/apache2-default is my DocRoot and http://localhost/jsp/test.jsp
works fine!

it doesn't matter if I use absolut or relative URI paths in the include
directive

Thanks for your help.

Roman Kunert












---------------------------------------------------------------------
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] parsing SSI files after rewriting and proxying

Posted by Roman Kunert <rk...@yobe.org>.
Nikolaus Schmitt wrote:

>Hi Roman,
>
>did You check if mod_jk  or mod_jk2 works for Your issue?
>Tomcat is capable to render HTML dynamically from different included jsp
>files.
>Thus, "test.htm" would be "test.jsp" and include "test1.jsp" for example.
>You could use apache to forward servlet relevant requests towards tomcat,
>and to server static content directly from the filesystem.
>
>I can't see the need for parsing tomcat output by an ssi engine.
>
>Regards
>Niko
>
>----- Original Message -----
>From: "Roman Kunert" <rk...@yobe.org>
>To: <us...@httpd.apache.org>
>Sent: Tuesday, November 11, 2003 5:07 PM
>Subject: [users@httpd] parsing SSI files after rewriting and proxying
>
>
>  
>
>>Hello
>>
>>I have an Apache httpd 2.0.48 that covers a tomcat 4.1.27 engine by
>>using mod_rewrite and mod_proxy. Servlet on tomcat generates dynamic
>>.htm pages that include other files via SSI directive "<!--#include
>>virtual="test.jsp"-->". What I want is that SSI code gets parsed and
>>interpreted after rewriting and proxying process. If I only use the
>>ProxyPass and ProxyPassReverse directives everything works just fine but
>>if I add some rewriting with the [P] flag the include process fails
>>because apache does not seem to forward the request to tomcat but rather
>>tries to find the files to be included on the local filesystem relative
>>to DocumentRoot. Here's my configuration:
>>
>>--- this does not work! ----------------
>>
>>RewriteEngine On
>>RewriteLog "/var/log/apache2/rewrite.log"
>>RewriteLogLevel 5
>>
>>RewriteRule "^/jsp/(.*)" "http://localhost:8180/$1" [P]
>>SetOutputFilter INCLUDES
>>
>>---- but this does work! ----
>>
>>ProxyPass /jsp http://localhost:8180/
>>ProxyPassReverse /jsp http://localhost:8180/
>>SetOutputFilter INCLUDES
>>
>>the error is visible both with the statement "[an error occurred while
>>processing this directive]" on the dynamic .htm page and in the error log:
>>
>>[error] [client 127.0.0.1] File does not exist:
>>    
>>
>/var/www/apache2-default/jsp
>  
>
>>[error] [client 127.0.0.1] unable to include "/jsp/test.jsp" in parsed
>>file proxy:http://localhost:8180/test.htm
>>
>>here I have accessed the page test.htm that resides in tomcat and
>>includes the file test.jsp from the same directory.
>>/var/www/apache2-default is my DocRoot and http://localhost/jsp/test.jsp
>>works fine!
>>
>>it doesn't matter if I use absolut or relative URI paths in the include
>>directive
>>
>>Thanks for your help.
>>
>>Roman Kunert
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>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
>
>
>
>  
>
Thanks for the quick answer,

I know that it works with mod_jk(2), but I wanted to get rid of this 
module and mod_rewrite just filled the gap nicely; any other idea?


---------------------------------------------------------------------
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] parsing SSI files after rewriting and proxying

Posted by Nikolaus Schmitt <n....@scaet.de>.
Hi Roman,

did You check if mod_jk  or mod_jk2 works for Your issue?
Tomcat is capable to render HTML dynamically from different included jsp
files.
Thus, "test.htm" would be "test.jsp" and include "test1.jsp" for example.
You could use apache to forward servlet relevant requests towards tomcat,
and to server static content directly from the filesystem.

I can't see the need for parsing tomcat output by an ssi engine.

Regards
Niko

----- Original Message -----
From: "Roman Kunert" <rk...@yobe.org>
To: <us...@httpd.apache.org>
Sent: Tuesday, November 11, 2003 5:07 PM
Subject: [users@httpd] parsing SSI files after rewriting and proxying


> Hello
>
> I have an Apache httpd 2.0.48 that covers a tomcat 4.1.27 engine by
> using mod_rewrite and mod_proxy. Servlet on tomcat generates dynamic
> .htm pages that include other files via SSI directive "<!--#include
> virtual="test.jsp"-->". What I want is that SSI code gets parsed and
> interpreted after rewriting and proxying process. If I only use the
> ProxyPass and ProxyPassReverse directives everything works just fine but
> if I add some rewriting with the [P] flag the include process fails
> because apache does not seem to forward the request to tomcat but rather
> tries to find the files to be included on the local filesystem relative
> to DocumentRoot. Here's my configuration:
>
> --- this does not work! ----------------
>
> RewriteEngine On
> RewriteLog "/var/log/apache2/rewrite.log"
> RewriteLogLevel 5
>
> RewriteRule "^/jsp/(.*)" "http://localhost:8180/$1" [P]
> SetOutputFilter INCLUDES
>
> ---- but this does work! ----
>
> ProxyPass /jsp http://localhost:8180/
> ProxyPassReverse /jsp http://localhost:8180/
> SetOutputFilter INCLUDES
>
> the error is visible both with the statement "[an error occurred while
> processing this directive]" on the dynamic .htm page and in the error log:
>
> [error] [client 127.0.0.1] File does not exist:
/var/www/apache2-default/jsp
> [error] [client 127.0.0.1] unable to include "/jsp/test.jsp" in parsed
> file proxy:http://localhost:8180/test.htm
>
> here I have accessed the page test.htm that resides in tomcat and
> includes the file test.jsp from the same directory.
> /var/www/apache2-default is my DocRoot and http://localhost/jsp/test.jsp
> works fine!
>
> it doesn't matter if I use absolut or relative URI paths in the include
> directive
>
> Thanks for your help.
>
> Roman Kunert
>
>
>
>
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> 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