You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Christophe Lemaire <ch...@skynet.be> on 2005/03/30 22:12:27 UTC

Apache as front-end for several tomcat

Hello,

I would like to setup a Apache 2.0.53 as front-end for several Tomcat 
5.0.19. I use JK1.2.8 as connector.

I have defined one worker per tomcat server. I use three name based 
virtual hosts in the apache config.

The problem is only the first virtual host works. In the mod_jk.log, I 
can see that every request sent to the apache are checked with the 
JkMount from the first virtual host only.

Here are my config files :

-------------------- workers.properties -----------------------
worker.list=demo1,demo2,demo3,stat

worker.demo1.type=ajp13
worker.demo1.host=192.168.0.1
worker.demo1.port=8009

worker.demo2.type=ajp13
worker.demo2.host=192.168.0.2
worker.demo2.port=8009

worker.demo3.type=ajp13
worker.demo3.host=192.168.0.3
worker.demo3.port=8009

worker.stat.type=ajp13
worker.stat.host=192.168.0.3
worker.stat.port=7201
----------------- end of  workers.properties -------------------

In the httpd.conf file, I include the file mod_jk.conf (no other 
virtual hosts are defined in httpd.conf):

-------------------- mod_jk.conf -----------------------
# Load mod_jk module
LoadModule jk_module modules/mod_jk.so

# Where to find workers.properties
JkWorkersFile conf/workers.properties

# Where to put jk logs
JkLogFile logs/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLevel debug

# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"

NameVirtualHost *:81

<VirtualHost *:81>
    ServerName demo1.myweb.org
    JkMount /*/tracking/* stat
    JkMount /tracking/* stat
    JkMount /web/* demo1
    JkMount /ald/* demo1
    JkMount /htmleditor/* demo1
    JkMount /* demo1
</VirtualHost>

<VirtualHost *:81>
    ServerName demo2.myweb.org
    JkMount /*/tracking/* stat
    JkMount /* demo2
</VirtualHost>

<VirtualHost *:81>
    ServerName demo3.myweb.org
    JkMount /*/tracking/* stat
    JkMount /* demo3
</VirtualHost>
----------------- end of mod_jk.conf -------------------

Extract from mod_jk.log :

URL typed in the browser : http://demo3.myweb.org:81/

[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (700): Attempting to map URI '/' 
from 6 maps
[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context 
URI '/*/tracking/*'
[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context 
URI '/tracking/*'
[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context 
URI '/web/*'
[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context 
URI '/ald/*'
[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context 
URI '/htmleditor/*'
[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context 
URI '/*'
[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (755): Found a context match 
demo1 -> /
[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] jk_handler::mod_jk.c 
(1715): Into handler jakarta-servlet worker=demo1 r->proxyreq=0
[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
wc_get_worker_for_name::jk_worker.c (92): found a worker demo1
[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
init_ws_service::mod_jk.c (479): agsp=81 agsn=demo3.myweb.org 
hostn=demo3.myweb.org shostn=demo1.myweb.org cbsport=0 sport=0 
claport=81

But I get the homepage of demo1.myweb.org...

Any idea why this happen?


Thanks in advance,
Christophe


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


Re: Apache as front-end for several tomcat

Posted by Dan Barron <db...@dswllc.com>.
If you are running multiple instances of Tomcat, from what I understand and 
from my configuration (i run two Tomcat/mod_jk2 with Apache) you would then 
need each of them to listen on a different port.  Right now the only 
instance that will receive requests via the worker is the instance that is 
using port 8009.

At 01:33 PM 3/30/2005, Christophe Lemaire wrote:
>Not sure. I have seen several config of name based virtual hosts that 
>listen on the same port.
>
>On 30-mars-05, at 23:02, Didier McGillis wrote:
>
>>would it be the fact that your sending the requests through the same port 
>>number?
>>
>>>From: Christophe Lemaire <ch...@skynet.be>
>>>Reply-To: "Tomcat Users List" <to...@jakarta.apache.org>
>>>To: tomcat-user@jakarta.apache.org
>>>Subject: Apache as front-end for several tomcat
>>>Date: Wed, 30 Mar 2005 22:12:27 +0200
>>>
>>>Hello,
>>>
>>>I would like to setup a Apache 2.0.53 as front-end for several Tomcat 
>>>5.0.19. I use JK1.2.8 as connector.
>>>
>>>I have defined one worker per tomcat server. I use three name based 
>>>virtual hosts in the apache config.
>>>
>>>The problem is only the first virtual host works. In the mod_jk.log, I 
>>>can see that every request sent to the apache are checked with the 
>>>JkMount from the first virtual host only.
>>>
>>>Here are my config files :
>>>
>>>-------------------- workers.properties -----------------------
>>>worker.list=demo1,demo2,demo3,stat
>>>
>>>worker.demo1.type=ajp13
>>>worker.demo1.host=192.168.0.1
>>>worker.demo1.port=8009
>>>
>>>worker.demo2.type=ajp13
>>>worker.demo2.host=192.168.0.2
>>>worker.demo2.port=8009
>>>
>>>worker.demo3.type=ajp13
>>>worker.demo3.host=192.168.0.3
>>>worker.demo3.port=8009
>>>
>>>worker.stat.type=ajp13
>>>worker.stat.host=192.168.0.3
>>>worker.stat.port=7201
>>>----------------- end of  workers.properties -------------------
>>>
>>>In the httpd.conf file, I include the file mod_jk.conf (no other virtual 
>>>hosts are defined in httpd.conf):
>>>
>>>-------------------- mod_jk.conf -----------------------
>>># Load mod_jk module
>>>LoadModule jk_module modules/mod_jk.so
>>>
>>># Where to find workers.properties
>>>JkWorkersFile conf/workers.properties
>>>
>>># Where to put jk logs
>>>JkLogFile logs/mod_jk.log
>>>
>>># Set the jk log level [debug/error/info]
>>>JkLogLevel debug
>>>
>>># Select the log format
>>>JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
>>>
>>># JkRequestLogFormat set the request format
>>>JkRequestLogFormat "%w %V %T"
>>>
>>>NameVirtualHost *:81
>>>
>>><VirtualHost *:81>
>>>    ServerName demo1.myweb.org
>>>    JkMount /*/tracking/* stat
>>>    JkMount /tracking/* stat
>>>    JkMount /web/* demo1
>>>    JkMount /ald/* demo1
>>>    JkMount /htmleditor/* demo1
>>>    JkMount /* demo1
>>></VirtualHost>
>>>
>>><VirtualHost *:81>
>>>    ServerName demo2.myweb.org
>>>    JkMount /*/tracking/* stat
>>>    JkMount /* demo2
>>></VirtualHost>
>>>
>>><VirtualHost *:81>
>>>    ServerName demo3.myweb.org
>>>    JkMount /*/tracking/* stat
>>>    JkMount /* demo3
>>></VirtualHost>
>>>----------------- end of mod_jk.conf -------------------
>>>
>>>Extract from mod_jk.log :
>>>
>>>URL typed in the browser : http://demo3.myweb.org:81/
>>>
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>>>map_uri_to_worker::jk_uri_worker_map.c (700): Attempting to map URI '/' 
>>>from 6 maps
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>>>map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context 
>>>URI '/*/tracking/*'
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>>>map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context 
>>>URI '/tracking/*'
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>>>map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context 
>>>URI '/web/*'
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>>>map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context 
>>>URI '/ald/*'
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>>>map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context 
>>>URI '/htmleditor/*'
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>>>map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context 
>>>URI '/*'
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>>>map_uri_to_worker::jk_uri_worker_map.c (755): Found a context match demo1 -> /
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] jk_handler::mod_jk.c 
>>>(1715): Into handler jakarta-servlet worker=demo1 r->proxyreq=0
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>>>wc_get_worker_for_name::jk_worker.c (92): found a worker demo1
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>>>init_ws_service::mod_jk.c (479): agsp=81 agsn=demo3.myweb.org 
>>>hostn=demo3.myweb.org shostn=demo1.myweb.org cbsport=0 sport=0 claport=81
>>>
>>>But I get the homepage of demo1.myweb.org...
>>>
>>>Any idea why this happen?
>>>
>>>
>>>Thanks in advance,
>>>Christophe
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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


Re: Apache as front-end for several tomcat

Posted by Didier McGillis <co...@hotmail.com>.
check in your access_log for apache, what do they say

>From: Christophe Lemaire <ch...@skynet.be>
>Reply-To: "Tomcat Users List" <to...@jakarta.apache.org>
>To: "Tomcat Users List" <to...@jakarta.apache.org>
>Subject: Re: Apache as front-end for several tomcat
>Date: Wed, 30 Mar 2005 23:33:24 +0200
>
>Not sure. I have seen several config of name based virtual hosts that 
>listen on the same port.
>
>On 30-mars-05, at 23:02, Didier McGillis wrote:
>
>>would it be the fact that your sending the requests through the same port 
>>number?
>>
>>>From: Christophe Lemaire <ch...@skynet.be>
>>>Reply-To: "Tomcat Users List" <to...@jakarta.apache.org>
>>>To: tomcat-user@jakarta.apache.org
>>>Subject: Apache as front-end for several tomcat
>>>Date: Wed, 30 Mar 2005 22:12:27 +0200
>>>
>>>Hello,
>>>
>>>I would like to setup a Apache 2.0.53 as front-end for several Tomcat 
>>>5.0.19. I use JK1.2.8 as connector.
>>>
>>>I have defined one worker per tomcat server. I use three name based 
>>>virtual hosts in the apache config.
>>>
>>>The problem is only the first virtual host works. In the mod_jk.log, I 
>>>can see that every request sent to the apache are checked with the 
>>>JkMount from the first virtual host only.
>>>
>>>Here are my config files :
>>>
>>>-------------------- workers.properties -----------------------
>>>worker.list=demo1,demo2,demo3,stat
>>>
>>>worker.demo1.type=ajp13
>>>worker.demo1.host=192.168.0.1
>>>worker.demo1.port=8009
>>>
>>>worker.demo2.type=ajp13
>>>worker.demo2.host=192.168.0.2
>>>worker.demo2.port=8009
>>>
>>>worker.demo3.type=ajp13
>>>worker.demo3.host=192.168.0.3
>>>worker.demo3.port=8009
>>>
>>>worker.stat.type=ajp13
>>>worker.stat.host=192.168.0.3
>>>worker.stat.port=7201
>>>----------------- end of  workers.properties -------------------
>>>
>>>In the httpd.conf file, I include the file mod_jk.conf (no other virtual 
>>>hosts are defined in httpd.conf):
>>>
>>>-------------------- mod_jk.conf -----------------------
>>># Load mod_jk module
>>>LoadModule jk_module modules/mod_jk.so
>>>
>>># Where to find workers.properties
>>>JkWorkersFile conf/workers.properties
>>>
>>># Where to put jk logs
>>>JkLogFile logs/mod_jk.log
>>>
>>># Set the jk log level [debug/error/info]
>>>JkLogLevel debug
>>>
>>># Select the log format
>>>JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
>>>
>>># JkRequestLogFormat set the request format
>>>JkRequestLogFormat "%w %V %T"
>>>
>>>NameVirtualHost *:81
>>>
>>><VirtualHost *:81>
>>>    ServerName demo1.myweb.org
>>>    JkMount /*/tracking/* stat
>>>    JkMount /tracking/* stat
>>>    JkMount /web/* demo1
>>>    JkMount /ald/* demo1
>>>    JkMount /htmleditor/* demo1
>>>    JkMount /* demo1
>>></VirtualHost>
>>>
>>><VirtualHost *:81>
>>>    ServerName demo2.myweb.org
>>>    JkMount /*/tracking/* stat
>>>    JkMount /* demo2
>>></VirtualHost>
>>>
>>><VirtualHost *:81>
>>>    ServerName demo3.myweb.org
>>>    JkMount /*/tracking/* stat
>>>    JkMount /* demo3
>>></VirtualHost>
>>>----------------- end of mod_jk.conf -------------------
>>>
>>>Extract from mod_jk.log :
>>>
>>>URL typed in the browser : http://demo3.myweb.org:81/
>>>
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>>>map_uri_to_worker::jk_uri_worker_map.c (700): Attempting to map URI '/' 
>>>from 6 maps
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>>>map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context 
>>>URI '/*/tracking/*'
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>>>map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context 
>>>URI '/tracking/*'
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>>>map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context 
>>>URI '/web/*'
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>>>map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context 
>>>URI '/ald/*'
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>>>map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context 
>>>URI '/htmleditor/*'
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>>>map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context 
>>>URI '/*'
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>>>map_uri_to_worker::jk_uri_worker_map.c (755): Found a context match demo1 
>>>-> /
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] jk_handler::mod_jk.c 
>>>(1715): Into handler jakarta-servlet worker=demo1 r->proxyreq=0
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>>>wc_get_worker_for_name::jk_worker.c (92): found a worker demo1
>>>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] init_ws_service::mod_jk.c 
>>>(479): agsp=81 agsn=demo3.myweb.org hostn=demo3.myweb.org 
>>>shostn=demo1.myweb.org cbsport=0 sport=0 claport=81
>>>
>>>But I get the homepage of demo1.myweb.org...
>>>
>>>Any idea why this happen?
>>>
>>>
>>>Thanks in advance,
>>>Christophe
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>



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


Re: Apache as front-end for several tomcat

Posted by Christophe Lemaire <ch...@skynet.be>.
Not sure. I have seen several config of name based virtual hosts that 
listen on the same port.

On 30-mars-05, at 23:02, Didier McGillis wrote:

> would it be the fact that your sending the requests through the same 
> port number?
>
>> From: Christophe Lemaire <ch...@skynet.be>
>> Reply-To: "Tomcat Users List" <to...@jakarta.apache.org>
>> To: tomcat-user@jakarta.apache.org
>> Subject: Apache as front-end for several tomcat
>> Date: Wed, 30 Mar 2005 22:12:27 +0200
>>
>> Hello,
>>
>> I would like to setup a Apache 2.0.53 as front-end for several Tomcat 
>> 5.0.19. I use JK1.2.8 as connector.
>>
>> I have defined one worker per tomcat server. I use three name based 
>> virtual hosts in the apache config.
>>
>> The problem is only the first virtual host works. In the mod_jk.log, 
>> I can see that every request sent to the apache are checked with the 
>> JkMount from the first virtual host only.
>>
>> Here are my config files :
>>
>> -------------------- workers.properties -----------------------
>> worker.list=demo1,demo2,demo3,stat
>>
>> worker.demo1.type=ajp13
>> worker.demo1.host=192.168.0.1
>> worker.demo1.port=8009
>>
>> worker.demo2.type=ajp13
>> worker.demo2.host=192.168.0.2
>> worker.demo2.port=8009
>>
>> worker.demo3.type=ajp13
>> worker.demo3.host=192.168.0.3
>> worker.demo3.port=8009
>>
>> worker.stat.type=ajp13
>> worker.stat.host=192.168.0.3
>> worker.stat.port=7201
>> ----------------- end of  workers.properties -------------------
>>
>> In the httpd.conf file, I include the file mod_jk.conf (no other 
>> virtual hosts are defined in httpd.conf):
>>
>> -------------------- mod_jk.conf -----------------------
>> # Load mod_jk module
>> LoadModule jk_module modules/mod_jk.so
>>
>> # Where to find workers.properties
>> JkWorkersFile conf/workers.properties
>>
>> # Where to put jk logs
>> JkLogFile logs/mod_jk.log
>>
>> # Set the jk log level [debug/error/info]
>> JkLogLevel debug
>>
>> # Select the log format
>> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
>>
>> # JkRequestLogFormat set the request format
>> JkRequestLogFormat "%w %V %T"
>>
>> NameVirtualHost *:81
>>
>> <VirtualHost *:81>
>>    ServerName demo1.myweb.org
>>    JkMount /*/tracking/* stat
>>    JkMount /tracking/* stat
>>    JkMount /web/* demo1
>>    JkMount /ald/* demo1
>>    JkMount /htmleditor/* demo1
>>    JkMount /* demo1
>> </VirtualHost>
>>
>> <VirtualHost *:81>
>>    ServerName demo2.myweb.org
>>    JkMount /*/tracking/* stat
>>    JkMount /* demo2
>> </VirtualHost>
>>
>> <VirtualHost *:81>
>>    ServerName demo3.myweb.org
>>    JkMount /*/tracking/* stat
>>    JkMount /* demo3
>> </VirtualHost>
>> ----------------- end of mod_jk.conf -------------------
>>
>> Extract from mod_jk.log :
>>
>> URL typed in the browser : http://demo3.myweb.org:81/
>>
>> [Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>> map_uri_to_worker::jk_uri_worker_map.c (700): Attempting to map URI 
>> '/' from 6 maps
>> [Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>> map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map 
>> context URI '/*/tracking/*'
>> [Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>> map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map 
>> context URI '/tracking/*'
>> [Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>> map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map 
>> context URI '/web/*'
>> [Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>> map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map 
>> context URI '/ald/*'
>> [Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>> map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map 
>> context URI '/htmleditor/*'
>> [Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>> map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map 
>> context URI '/*'
>> [Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>> map_uri_to_worker::jk_uri_worker_map.c (755): Found a context match 
>> demo1 -> /
>> [Wed Mar 30 22:15:46 2005] [12762:8192] [debug] jk_handler::mod_jk.c 
>> (1715): Into handler jakarta-servlet worker=demo1 r->proxyreq=0
>> [Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>> wc_get_worker_for_name::jk_worker.c (92): found a worker demo1
>> [Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>> init_ws_service::mod_jk.c (479): agsp=81 agsn=demo3.myweb.org 
>> hostn=demo3.myweb.org shostn=demo1.myweb.org cbsport=0 sport=0 
>> claport=81
>>
>> But I get the homepage of demo1.myweb.org...
>>
>> Any idea why this happen?
>>
>>
>> Thanks in advance,
>> Christophe
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>


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


RE: Apache as front-end for several tomcat

Posted by Didier McGillis <co...@hotmail.com>.
would it be the fact that your sending the requests through the same port 
number?

>From: Christophe Lemaire <ch...@skynet.be>
>Reply-To: "Tomcat Users List" <to...@jakarta.apache.org>
>To: tomcat-user@jakarta.apache.org
>Subject: Apache as front-end for several tomcat
>Date: Wed, 30 Mar 2005 22:12:27 +0200
>
>Hello,
>
>I would like to setup a Apache 2.0.53 as front-end for several Tomcat 
>5.0.19. I use JK1.2.8 as connector.
>
>I have defined one worker per tomcat server. I use three name based virtual 
>hosts in the apache config.
>
>The problem is only the first virtual host works. In the mod_jk.log, I can 
>see that every request sent to the apache are checked with the JkMount from 
>the first virtual host only.
>
>Here are my config files :
>
>-------------------- workers.properties -----------------------
>worker.list=demo1,demo2,demo3,stat
>
>worker.demo1.type=ajp13
>worker.demo1.host=192.168.0.1
>worker.demo1.port=8009
>
>worker.demo2.type=ajp13
>worker.demo2.host=192.168.0.2
>worker.demo2.port=8009
>
>worker.demo3.type=ajp13
>worker.demo3.host=192.168.0.3
>worker.demo3.port=8009
>
>worker.stat.type=ajp13
>worker.stat.host=192.168.0.3
>worker.stat.port=7201
>----------------- end of  workers.properties -------------------
>
>In the httpd.conf file, I include the file mod_jk.conf (no other virtual 
>hosts are defined in httpd.conf):
>
>-------------------- mod_jk.conf -----------------------
># Load mod_jk module
>LoadModule jk_module modules/mod_jk.so
>
># Where to find workers.properties
>JkWorkersFile conf/workers.properties
>
># Where to put jk logs
>JkLogFile logs/mod_jk.log
>
># Set the jk log level [debug/error/info]
>JkLogLevel debug
>
># Select the log format
>JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
>
># JkRequestLogFormat set the request format
>JkRequestLogFormat "%w %V %T"
>
>NameVirtualHost *:81
>
><VirtualHost *:81>
>    ServerName demo1.myweb.org
>    JkMount /*/tracking/* stat
>    JkMount /tracking/* stat
>    JkMount /web/* demo1
>    JkMount /ald/* demo1
>    JkMount /htmleditor/* demo1
>    JkMount /* demo1
></VirtualHost>
>
><VirtualHost *:81>
>    ServerName demo2.myweb.org
>    JkMount /*/tracking/* stat
>    JkMount /* demo2
></VirtualHost>
>
><VirtualHost *:81>
>    ServerName demo3.myweb.org
>    JkMount /*/tracking/* stat
>    JkMount /* demo3
></VirtualHost>
>----------------- end of mod_jk.conf -------------------
>
>Extract from mod_jk.log :
>
>URL typed in the browser : http://demo3.myweb.org:81/
>
>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>map_uri_to_worker::jk_uri_worker_map.c (700): Attempting to map URI '/' 
>from 6 maps
>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context URI 
>'/*/tracking/*'
>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context URI 
>'/tracking/*'
>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context URI 
>'/web/*'
>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context URI 
>'/ald/*'
>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context URI 
>'/htmleditor/*'
>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context URI 
>'/*'
>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>map_uri_to_worker::jk_uri_worker_map.c (755): Found a context match demo1 
>-> /
>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] jk_handler::mod_jk.c 
>(1715): Into handler jakarta-servlet worker=demo1 r->proxyreq=0
>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] 
>wc_get_worker_for_name::jk_worker.c (92): found a worker demo1
>[Wed Mar 30 22:15:46 2005] [12762:8192] [debug] init_ws_service::mod_jk.c 
>(479): agsp=81 agsn=demo3.myweb.org hostn=demo3.myweb.org 
>shostn=demo1.myweb.org cbsport=0 sport=0 claport=81
>
>But I get the homepage of demo1.myweb.org...
>
>Any idea why this happen?
>
>
>Thanks in advance,
>Christophe
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>



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