Use one Logger per apache Virtual Host; something like that :
<VirtualHost demo1.myweb.org:81>
  ServerName demo1.myweb.org
  CustomLog /var/log/demo1_vhost_access.log combined
  JkMount / demo1
...
</VirtualHost>
<VirtualHost demo2.myweb.org:81>
  ServerName demo2.myweb.org
  CustomLog /var/log/demo2_vhost_access.log combined
  JkMount / demo2
...
</VirtualHost>
...

And, I think you have to have a config with a JkMount on /

Regards

On Thu, 31 Mar 2005 13:50:15 +0200
Christophe Lemaire <[EMAIL PROTECTED]> wrote:

> 
> Oh, I forgot to say I can't see which virtual host is used in the  
> access_log. How can I do that?
> 
> Here is what I have in the access log :
> 194.78.221.136 - - [31/Mar/2005:13:41:11 +0200] "GET / HTTP/1.1" 401 942
> 194.78.221.136 - - [31/Mar/2005:13:41:11 +0200] "GET / HTTP/1.1" 401 942
> 
> Christophe
> 
> >
> > There are 3 backend servers, 2 servers run one Tomcat on standard  
> > ports and 1 server runs two Tomcat on different ports (see file  
> > workers.porperties).
> >
> > For the log file, I have only 1 log file for all the workers defined  
> > in mod_jk.conf by the following line :
> >
> >>>>> # Where to put jk logs
> >>>>> JkLogFile logs/mod_jk.log
> >
> > So I don't have any info about the other workers.
> >
> > If you are talking about the other tomcat, I can access them directly  
> > via their IP and port with a browser on the LAN. So I can say all the  
> > tomcat servers are up and running.
> >
> > The strange thing is that this setup works fine with mod_JK2. But I  
> > would like to have a setup with JK1 since JK2 is not supported  
> > anymore.
> >
> > Regards,
> >
> > Christophe
> >
> > On 31-mars-05, at 01:28, Montz, James C. (James Tower) wrote:
> >
> >> Are the Tomcat instance running on the same physical server and you  
> >> are
> >> just using IP Aliases, or are the workers running on 3 sperate backend
> >> machines?
> >>
> >> You apache config looks OK, so I don't believe its an issue with  
> >> Apache
> >> Virtual Host configuration. I believe all work in being forwarded to
> >> Demo1 only.
> >>
> >> I believe you can have multiple instances of tomcat listening on the
> >> same port by specifying an IP address in the connector. But I find it
> >> much easier just to congigure each instance to listen on a different
> >> port.
> >> If you check your other 2 workers log files, you will probably see an
> >> error similar to "Bind address already in use".
> >> Modify each Tomcat instance to the SHUTDOWN and AJP listener are each  
> >> on
> >> unique ports;
> >>
> >> For example, In each respective instance server.xml use;
> >>
> >> Demo1 Shutdown: 8001
> >> Demo1 HTTP: 8081
> >> Demo1 AJP Listener: 8101
> >>
> >> Demo2 Shutdown: 8002
> >> Demo2 HTTP: 8082
> >> Demo2 AJP Listeer: 8102
> >>
> >> Demo3 Shutdown: 8003
> >> Demo3 HTTP: 8083
> >> Demo3 AJP Listern: 8103
> >>
> >> Restart each instance (check the catalina.out for errors)
> >>
> >> Modify your workers.properties file to relect the new AJP listen ports
> >>
> >> Restart Apache
> >>
> >> -----Original Message-----
> >> From: Dan Barron [mailto:[EMAIL PROTECTED]
> >> Sent: Wednesday, March 30, 2005 3:48 PM
> >> To: Tomcat Users List; Tomcat Users List
> >> Subject: Re: Apache as front-end for several tomcat
> >>
> >> 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 <[EMAIL PROTECTED]>
> >>>>> Reply-To: "Tomcat Users List" <[email protected]>
> >>>>> To: [email protected]
> >>>>> 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: [EMAIL PROTECTED]
> >>>>> For additional commands, e-mail:  
> >>>>> [EMAIL PROTECTED]
> >>>>
> >>>>
> >>>>
> >>>> -------------------------------------------------------------------- 
> >>>> -
> >>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>>
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to