You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by matador <ma...@yahoo.com> on 2006/02/05 05:59:50 UTC

newbie:access tomcat virtual host via apache

runnning tomcat 5.x on windows with apache 2.0.5x with modjk.  tomcat on 
8080 and apache on 80.

so for a given webapp at foo.bar.com that really is served up by tomcat on 
8080 as http://foo.bar.com:8080.  how to get apache to see it so that i can 
access it as http://foo.bar.com without the port number?

<< no i wont run tomcat on 80 since we also run php on that apahce instance 
as well ;) >>

thx


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


Re: newbie:access tomcat virtual host via apache

Posted by matador <ma...@yahoo.com>.
Dieter Schicker <di...@ling.uni-graz.at> wrote in
news:43E5C975.2090608@ling.uni-graz.at: 

> If you can't mount / because you also run php on apache, you can afaik
> only mount specific directories of tomcat in Apache, e.g.  
> http://foo.bar.com:8080/jsp-examples =>
> http://foo.bar.com/jsp-examples. In Google you can find many examples
> for this configuration. 
> 
> Didi
> 
thx newbie question:  how would you mount / ?



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


RE: newbie:access tomcat virtual host via apache

Posted by Tim Lucia <ti...@yahoo.com>.
I used Apache's mod_rewrite and some rewriting rules, like this:


# This 'works' except that cookies are set by tomcat under /v31 (JSESSIONID)

NameVirtualHost www.mysite.test:80
<VirtualHost www.mysite.test:80>
    ServerAdmin webmaster@mysite.test
    DocumentRoot /usr/local/mysite/v31
    ServerName www.mysite.test
    ErrorLog logs/www.mysite.test-error_log
    CustomLog logs/www.mysite.test-access_log commonWithTime

    RewriteEngine      on
    RewriteLog                 logs/rewrite.log
    RewriteLogLevel    9
    RewriteRule                ^/$     /index.jsp
    RewriteRule                ^/(.*).jsp      /v31/$1.jsp
[L,PT]
    RewriteRule                ^/servlet/(.*)  /v31/servlet/$1
[L,PT]
    RewriteRule                ^/images/(.*)   /v31/images/$1          [L]
    RewriteRule                ^/style/(.*)    /v31/style/$1           [L]
    RewriteRule                ^/tag30/(.*)    /v31/tag30/$1           [L]
    RewriteRule                ^/pdf/(.*)      /v31/pdf/$1             [L]

    JkMount   /servlet/*            wlb
    JkMount   /*.jsp                wlb
</VirtualHost>

But the browser sees "/" as the context, not /v31, and the cookie belongs to
/v31 and thus the browser doesn't send it on requests 2-n, and therefore you
really don't have sesion tracking.  Kind of useless ;-)

Tim




-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of matador
Sent: Tuesday, February 07, 2006 9:00 PM
To: users@tomcat.apache.org
Subject: RE: newbie:access tomcat virtual host via apache


"Tim Lucia" <ti...@yahoo.com> wrote in
news:002401c62a6f$d8b27bb0$0200a8c0@tjllap: 

> A few weeks ago, I asked a similar question which went unanswered. 
> Basically, I want to have the user request www.somewhere.com but have 
> Apache forward that to tomcatserver:8009/someNonRootContext/ so I can 
> have different versions, w/o exposing the context to the user. 
> Rewriting works, except that cookies set in Tomcat are relative to 
> /someNonRootContext and so the browser does not send them back on the 
> next request.
> 
> Tim

ah, thats what i want to do but it sounds like thats not possible.  can you 
explain how you set up the url rewriting thing?


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



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


RE: newbie:access tomcat virtual host via apache

Posted by matador <ma...@yahoo.com>.
"Tim Lucia" <ti...@yahoo.com> wrote in
news:002401c62a6f$d8b27bb0$0200a8c0@tjllap: 

> A few weeks ago, I asked a similar question which went unanswered.
> Basically, I want to have the user request www.somewhere.com but have
> Apache forward that to tomcatserver:8009/someNonRootContext/ so I can
> have different versions, w/o exposing the context to the user. 
> Rewriting works, except that cookies set in Tomcat are relative to
> /someNonRootContext and so the browser does not send them back on the
> next request. 
> 
> Tim

ah, thats what i want to do but it sounds like thats not possible.  can you 
explain how you set up the url rewriting thing?


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


Re: newbie:access tomcat virtual host via apache

Posted by Dieter Schicker <di...@ling.uni-graz.at>.
I also asked a similar question which also went unanswered. Maybe it's 
simply not possible to do that ....

Didi

Tim Lucia wrote:
> A few weeks ago, I asked a similar question which went unanswered.
> Basically, I want to have the user request www.somewhere.com but have Apache
> forward that to tomcatserver:8009/someNonRootContext/ so I can have
> different versions, w/o exposing the context to the user.  Rewriting works,
> except that cookies set in Tomcat are relative to /someNonRootContext and so
> the browser does not send them back on the next request.
>
> Tim
>
> -----Original Message-----
> From: Dieter Schicker [mailto:didi@ling.uni-graz.at] 
> Sent: Sunday, February 05, 2006 4:46 AM
> To: Tomcat Users List
> Subject: Re: newbie:access tomcat virtual host via apache
>
>
> If you can't mount / because you also run php on apache, you can afaik 
> only mount specific directories of tomcat in Apache, e.g.  
> http://foo.bar.com:8080/jsp-examples => http://foo.bar.com/jsp-examples. 
> In Google you can find many examples for this configuration.
>
> Didi
>
> matador wrote:
>   
>> runnning tomcat 5.x on windows with apache 2.0.5x with modjk.  tomcat 
>> on
>> 8080 and apache on 80.
>>
>> so for a given webapp at foo.bar.com that really is served up by 
>> tomcat on
>> 8080 as http://foo.bar.com:8080.  how to get apache to see it so that i
>>     
> can 
>   
>> access it as http://foo.bar.com without the port number?
>>
>> << no i wont run tomcat on 80 since we also run php on that apahce 
>> instance
>> as well ;) >>
>>
>> thx
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>   
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   


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


RE: newbie:access tomcat virtual host via apache

Posted by Tim Lucia <ti...@yahoo.com>.
A few weeks ago, I asked a similar question which went unanswered.
Basically, I want to have the user request www.somewhere.com but have Apache
forward that to tomcatserver:8009/someNonRootContext/ so I can have
different versions, w/o exposing the context to the user.  Rewriting works,
except that cookies set in Tomcat are relative to /someNonRootContext and so
the browser does not send them back on the next request.

Tim

-----Original Message-----
From: Dieter Schicker [mailto:didi@ling.uni-graz.at] 
Sent: Sunday, February 05, 2006 4:46 AM
To: Tomcat Users List
Subject: Re: newbie:access tomcat virtual host via apache


If you can't mount / because you also run php on apache, you can afaik 
only mount specific directories of tomcat in Apache, e.g.  
http://foo.bar.com:8080/jsp-examples => http://foo.bar.com/jsp-examples. 
In Google you can find many examples for this configuration.

Didi

matador wrote:
> runnning tomcat 5.x on windows with apache 2.0.5x with modjk.  tomcat 
> on
> 8080 and apache on 80.
>
> so for a given webapp at foo.bar.com that really is served up by 
> tomcat on
> 8080 as http://foo.bar.com:8080.  how to get apache to see it so that i
can 
> access it as http://foo.bar.com without the port number?
>
> << no i wont run tomcat on 80 since we also run php on that apahce 
> instance
> as well ;) >>
>
> thx
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>   


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



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


Re: newbie:access tomcat virtual host via apache

Posted by Dieter Schicker <di...@ling.uni-graz.at>.
If you can't mount / because you also run php on apache, you can afaik 
only mount specific directories of tomcat in Apache, e.g.  
http://foo.bar.com:8080/jsp-examples => http://foo.bar.com/jsp-examples. 
In Google you can find many examples for this configuration.

Didi

matador wrote:
> runnning tomcat 5.x on windows with apache 2.0.5x with modjk.  tomcat on 
> 8080 and apache on 80.
>
> so for a given webapp at foo.bar.com that really is served up by tomcat on 
> 8080 as http://foo.bar.com:8080.  how to get apache to see it so that i can 
> access it as http://foo.bar.com without the port number?
>
> << no i wont run tomcat on 80 since we also run php on that apahce instance 
> as well ;) >>
>
> thx
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>   


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