You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Michael Gerzabek <mi...@gmx.net> on 2008/04/11 10:49:02 UTC

T5 Apache httpd + T5

Hi,

I want to install T5 behind a httpd with mod_proxy and mod_rewrite. 
While the configuration on http is straight forward, T5 seems to behave 
different when it get's queried by httpd.

Jetty direct URL: http://localhost:8888/contact
This works fine and as supposed. The contact page get's hosted by T5.

Apache URL: http://localhost:81/contact
When I use this url I get a 404, file not found, which originated at T5. 
The console logger shows the warning

[WARN] ResourceCache Alias request of 
'file:/C:/Dokumente%20und%20Einstellungen/indi/workspace/michaelgerzabek.shop.com/src/main/webapp/contact' 
for 
'file:/C:/Dokumente%20und%20Einstellungen/indi/workspace/michaelgerzabek.shop.com/src/main/webapp/contact'

What does this mean? Where is the difference? Has anyone had some 
experiences with httpd's mod_proxy and mod_rewrite?

Regards,
Michael

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


Re: T5 Apache httpd + T5

Posted by Robin Helgelin <lo...@gmail.com>.
On Fri, Apr 11, 2008 at 2:48 PM, Michael Gerzabek
<mi...@gmx.net> wrote:
>  Yes, and it's easy. You click the Run > Open Run Dialog then select your
> Jetty App and select the checkbox Enable NCSA logging in the dialog.
>
>  There I found that the last rewrite rule had to be changed to
>
>
>  # All T5 apps have no .html, so we serve those from the
>  # servlet container
>  # .........................................................
>  RewriteRule "^(.*)" "http://localhost:8888$0" [L,P]
>
>  Now everything works as supposed.

Glad you solved it!

-- 
 regards,
 Robin

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


Re: T5 Apache httpd + T5

Posted by Michael Gerzabek <mi...@gmx.net>.
Michael Gerzabek schrieb:
>
> Is there a way to configure access logging like tomcat has for Jetty?
Yes, and it's easy. You click the Run > Open Run Dialog then select your 
Jetty App and select the checkbox Enable NCSA logging in the dialog.

There I found that the last rewrite rule had to be changed to

# All T5 apps have no .html, so we serve those from the
# servlet container
# .........................................................
RewriteRule "^(.*)" "http://localhost:8888$0" [L,P]

Now everything works as supposed.

Regards,
Michael

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


Re: T5 Apache httpd + T5

Posted by Michael Gerzabek <mi...@gmx.net>.
Mhm,

Robin Helgelin schrieb:
> ProxyPassReverse / http://localhost:8888/
>   
>
> I assume your application is running on context root?
>   
Yes it is.
> Also, does tomcat logging show any difference between requests coming
> from mod_proxy and requests coming directly to tomcat?
>   
I use Jetty 5.1.12 within eclipse 3.3, so the only logs I see are in the 
Console window. This is where I pasted the [WARN]ing.

Is there a way to configure access logging like tomcat has for Jetty?

Thanks,
Michael


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


Re: T5 Apache httpd + T5

Posted by Robin Helgelin <lo...@gmail.com>.
On Fri, Apr 11, 2008 at 11:57 AM, Michael Gerzabek
<mi...@gmx.net> wrote:
> I use mod_proxy successfully since 8 years. In the old days I had troubles
> over troubles with mod_jk and since I learned how to use mod_proxy and
> mod_rewrite I did never re-evaluate mod_jk.

Ok!

>  Ok, here my conf (it's local, not on the internet). This configuration is
> inspired by an old thread (2003 or so) on cocoon-dev [1]:

>    ProxyPassReverse / http://localhost:8888/

I assume your application is running on context root?

Also, does tomcat logging show any difference between requests coming
from mod_proxy and requests coming directly to tomcat?

-- 
 regards,
 Robin

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


Re: T5 Apache httpd + T5

Posted by Kevin Menard <km...@servprise.com>.
I think you can disable proxying with Location and LocationMatch.   
But, I can't access the config at the moment to confirm.

-- 
Kevin

On Apr 11, 2008, at 6:39 AM, Michael Gerzabek wrote:

> Kevin,
>
> the difference with that is that you pass every request to the  
> servlet container. My config serves static files, like css, pictures  
> etc. straight with httpd and let the fancy stuff do by the servlet  
> container.
>
> Thanks anyway!
> Michael

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


Re: T5 Apache httpd + T5

Posted by Michael Gerzabek <mi...@gmx.net>.
Kevin,

the difference with that is that you pass every request to the servlet 
container. My config serves static files, like css, pictures etc. 
straight with httpd and let the fancy stuff do by the servlet container.

Thanks anyway!
Michael

Kevin Menard schrieb:
> I've always used something akin to:
>
>    ProxyRequests Off
>
>    ProxyPass / http://host.servprise.office/
>
>    <Location />
>         ProxyPassReverse /
>    </Location>
>
> I think this would be cleaner for you than using rewrite rules to your
> servlet container.  Then again, I've never used a rewrite rule to proxy, so
> I may just be talking out of my butt.
>
>   


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


Re: T5 Apache httpd + T5

Posted by Kevin Menard <km...@servprise.com>.
I've always used something akin to:

   ProxyRequests Off

   ProxyPass / http://host.servprise.office/

   <Location />
        ProxyPassReverse /
   </Location>

I think this would be cleaner for you than using rewrite rules to your
servlet container.  Then again, I've never used a rewrite rule to proxy, so
I may just be talking out of my butt.

-- 
Kevin


On 4/11/08 5:57 AM, "Michael Gerzabek" <mi...@gmx.net> wrote:

> I use mod_proxy successfully since 8 years. In the old days I had
> troubles over troubles with mod_jk and since I learned how to use
> mod_proxy and mod_rewrite I did never re-evaluate mod_jk.
> 
> Ok, here my conf (it's local, not on the internet). This configuration
> is inspired by an old thread (2003 or so) on cocoon-dev [1]:
> 
> <VirtualHost *:81>
> 
>     ServerAdmin webmaster@michaelgerzabek.com
> 
>     DocumentRoot "C:/Dokumente und
> Einstellungen/indi/workspace/michaelgerzabek.com"
> 
>     <Directory "C:/Dokumente und
> Einstellungen/indi/workspace/michaelgerzabek.com">
>         Options -Indexes -MultiViews
>         AllowOverride None
>         Order allow,deny
>         Allow from all
>     </Directory>
>    
>     #######################################################################
>     # ERROR PAGES CONFIGURATION                                           #
>     #######################################################################
>        
>     ErrorDocument 502 /error/502.html
>     ErrorDocument 404 /error/404.html
>     ErrorDocument 500 /error/500.html
> 
>     #######################################################################
>     # MOD_PROXY CONFIGURATIONS                                            #
>     #######################################################################
> 
>     # Make sure that if the servlet container specifies a "Location" HTTP
>     # header during redirection starting with "http://localhost:8080/", we
>     # can handle it and return to our client the effective (not real)
>     # location we want to redirect them to. This is _essential_ to handle
>     # also the error returned by the backend servlet container.
>     ProxyPassReverse / http://localhost:8888/
> 
>     # Make sure that the virtual host name is passed through to the
>     # backend servlet container for virtual host support.
>     ProxyPreserveHost On
> 
>     # Tell mod_mod proxy that it should not send back the body-content of
>     # error pages, but be fascist and use its local error pages if the
>     # remote HTTP stack is sending an HTTP 4xx or 5xx status code.
>     ProxyErrorOverride On
> 
>     #######################################################################
>     # MOD_REWRITE CONFIGURATIONS                                          #
>     #######################################################################
> 
>     # The nastiness begins, let's fire up the "rewrite engine"
>     RewriteEngine On
>    
>     # forbidden resources
>     #----------------------------------------------------------------------
>     # Everything that starts with a NON-CASE-SENSITIVE match (the NC flag)
>     # of "/WEB-INF" or "/WEB-INF/" is forbidden (the F flag). And again,
>     # this is the last rule (the L flag), nothing will be processed by the
>     # rewrite engine if this rule is matched
>     RewriteRule "^/WEB-INF/(.*)" "$0" [L,F,NC]
> 
>     # static resources
>     #----------------------------------------------------------------------
>     RewriteRule "^/$" "/index.html" [R=permanent]
>     RewriteRule "^(.*)\.html" "$0" [L]
>     RewriteRule "^(.*)\.css" "$0" [L]
>     RewriteRule "^(.*)\.png" "$0" [L]
>    
>     # All T5 apps have no .html, so we serve those from the
>     # servlet container
>     # .........................................................
>     RewriteRule "^/(.*)" "http://localhost:8888/$0" [L,P]
>    
> </VirtualHost>
> 
> [1] http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=104441321803644&w=2
> 
> Michael
> 
> 
> Robin Helgelin schrieb:
>> On Fri, Apr 11, 2008 at 10:49 AM, Michael Gerzabek
>> <mi...@gmx.net> wrote:
>>   
>>> Hi,
>>> 
>>>  I want to install T5 behind a httpd with mod_proxy and mod_rewrite. While
>>> the configuration on http is straight forward, T5 seems to behave different
>>> when it get's queried by httpd.
>>>     
>> 
>> Would you mind posting your httpd configuration? Also, wouldn't you
>> rather run mod_jk instead of mod_proxy?
>> 
>>   
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


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


Re: T5 Apache httpd + T5

Posted by Michael Gerzabek <mi...@gmx.net>.
I use mod_proxy successfully since 8 years. In the old days I had 
troubles over troubles with mod_jk and since I learned how to use 
mod_proxy and mod_rewrite I did never re-evaluate mod_jk.

Ok, here my conf (it's local, not on the internet). This configuration 
is inspired by an old thread (2003 or so) on cocoon-dev [1]:

<VirtualHost *:81>

    ServerAdmin webmaster@michaelgerzabek.com

    DocumentRoot "C:/Dokumente und 
Einstellungen/indi/workspace/michaelgerzabek.com"

    <Directory "C:/Dokumente und 
Einstellungen/indi/workspace/michaelgerzabek.com">
        Options -Indexes -MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
   
    #######################################################################
    # ERROR PAGES CONFIGURATION                                           #
    #######################################################################
       
    ErrorDocument 502 /error/502.html
    ErrorDocument 404 /error/404.html
    ErrorDocument 500 /error/500.html

    #######################################################################
    # MOD_PROXY CONFIGURATIONS                                            #
    #######################################################################

    # Make sure that if the servlet container specifies a "Location" HTTP
    # header during redirection starting with "http://localhost:8080/", we
    # can handle it and return to our client the effective (not real)
    # location we want to redirect them to. This is _essential_ to handle
    # also the error returned by the backend servlet container.
    ProxyPassReverse / http://localhost:8888/

    # Make sure that the virtual host name is passed through to the
    # backend servlet container for virtual host support.
    ProxyPreserveHost On

    # Tell mod_mod proxy that it should not send back the body-content of
    # error pages, but be fascist and use its local error pages if the
    # remote HTTP stack is sending an HTTP 4xx or 5xx status code.
    ProxyErrorOverride On

    #######################################################################
    # MOD_REWRITE CONFIGURATIONS                                          #
    #######################################################################

    # The nastiness begins, let's fire up the "rewrite engine"
    RewriteEngine On
   
    # forbidden resources
    #----------------------------------------------------------------------
    # Everything that starts with a NON-CASE-SENSITIVE match (the NC flag)
    # of "/WEB-INF" or "/WEB-INF/" is forbidden (the F flag). And again,
    # this is the last rule (the L flag), nothing will be processed by the
    # rewrite engine if this rule is matched
    RewriteRule "^/WEB-INF/(.*)" "$0" [L,F,NC]

    # static resources
    #----------------------------------------------------------------------
    RewriteRule "^/$" "/index.html" [R=permanent]
    RewriteRule "^(.*)\.html" "$0" [L]
    RewriteRule "^(.*)\.css" "$0" [L]
    RewriteRule "^(.*)\.png" "$0" [L]
   
    # All T5 apps have no .html, so we serve those from the
    # servlet container
    # .........................................................
    RewriteRule "^/(.*)" "http://localhost:8888/$0" [L,P]
   
</VirtualHost>

[1] http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=104441321803644&w=2

Michael


Robin Helgelin schrieb:
> On Fri, Apr 11, 2008 at 10:49 AM, Michael Gerzabek
> <mi...@gmx.net> wrote:
>   
>> Hi,
>>
>>  I want to install T5 behind a httpd with mod_proxy and mod_rewrite. While
>> the configuration on http is straight forward, T5 seems to behave different
>> when it get's queried by httpd.
>>     
>
> Would you mind posting your httpd configuration? Also, wouldn't you
> rather run mod_jk instead of mod_proxy?
>
>   

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


Re: T5 Apache httpd + T5

Posted by Kevin Menard <km...@servprise.com>.
As of Apache HTTPd 2.2, AJP is implemented as a mod_proxy provider.  It's a
much cleaner configuration than either mod_jk or mod_jk2.

-- 
Kevin

On 4/11/08 5:01 AM, "Robin Helgelin" <lo...@gmail.com> wrote:

> On Fri, Apr 11, 2008 at 10:49 AM, Michael Gerzabek
> <mi...@gmx.net> wrote:
>> Hi,
>> 
>>  I want to install T5 behind a httpd with mod_proxy and mod_rewrite. While
>> the configuration on http is straight forward, T5 seems to behave different
>> when it get's queried by httpd.
> 
> Would you mind posting your httpd configuration? Also, wouldn't you
> rather run mod_jk instead of mod_proxy?


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


Re: T5 Apache httpd + T5

Posted by Robin Helgelin <lo...@gmail.com>.
On Fri, Apr 11, 2008 at 10:49 AM, Michael Gerzabek
<mi...@gmx.net> wrote:
> Hi,
>
>  I want to install T5 behind a httpd with mod_proxy and mod_rewrite. While
> the configuration on http is straight forward, T5 seems to behave different
> when it get's queried by httpd.

Would you mind posting your httpd configuration? Also, wouldn't you
rather run mod_jk instead of mod_proxy?

-- 
 regards,
 Robin

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