The TOMCAT_1 Connector uses port 8009 of cource - copied from wrong place.

-----Original Message-----
From:   Dmitry Letin
Sent:   Thu 19/09/2002 6:25 PM
To:     Tomcat Users List
Cc:     
Subject:        RE: mod_jk2, virtual hosts, JkUriSet
Hi Dave,
I use something like this:

Relevent parts of config files.

***********************************************************

TOMCAT_1:

server.xml:

    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
               port="8013" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="10" debug="0" connectionTimeout="20000"
               useURIValidationHack="false"
               protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>


jk2.properties:

#---- jk2.properties

[logger]
level=ERROR

# list of needed handlers.
handler.list=apr,channelSocket,request

# Set the default port for the channelSocket
channelSocket.port=8009
channelSocket.maxPort=8009


#---- end of jk2.properties

***********************************************************

Tomcat_2:

server.xml:

    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
               port="8013" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="10" debug="0" connectionTimeout="20000"
               useURIValidationHack="false"
               protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>


jk2.properties:

#---- jk2.properties

[logger]
level=ERROR

# list of needed handlers.
handler.list=apr,channelSocket,request

# Set the default port for the channelSocket
channelSocket.port=8013
channelSocket.maxPort=8013

#---- end of jk2.properties

***********************************************************

httpd.conf (I use apache2 - for apache1.3 - you'll need AddModule mod_jk2.c as well):

LoadModule jk2_module modules/mod_jk2.so

***********************************************************

workers2.properties:

#
#---- workers2.properties
[logger]
level=INFO

# Alternate file logger
[logger.file:0]
level=INFO
file=/usr/local/apache2/logs/jk2.log

# Shared memory handling. Needs to be set.
[shm]
file=/usr/local/apache2/logs/jk2.shm
size=1048576

[workerEnv:]
info=Global server options
timing=1
debug=0
logger=logger.file:0

[lb:lb]
info=Default load balancer.
debug=0

[lb:lb_1]
info=Second load balancer.
debug=0

[lb:lb_2]
info=Third load balancer.
debug=0


# vhost1 socket channel, explicitly set port and host.
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1
debug=0
tomcatId=localhost:8009
group=lb_1

# vhost2 socket channel, explicitly set port and host.
[channel.socket:localhost:8013]
port=8013
host=127.0.0.1
debug=0
tomcatId=localhost:8013
group=lb_2


[ajp13:localhost:8009]
channel=channel.socket:localhost:8009

[ajp13:localhost:8013]
channel=channel.socket:localhost:8013


# Announce a "status" worker
[status:status]

[uri:/jkstatus/*]
worker=status:status

# The virtual host part seems to be ignored anyway
#[uri:www.vhost1.com:80/service/en/servlet/*]  might use port as well
[uri:www.vhost1.com/service/en/servlet/*]
worker=ajp13:localhost:8009

# The virtual host part seems to be ignored anyway
# [uri:www.vhost1.com:80/*.jsp] - not working as well
[uri:www.vhost1.com/*.jsp]
worker=ajp13:localhost:8009

# The virtual host part seems to be ignored anyway
[uri:www.vhost2.com/*.jsp]
worker=ajp13:localhost:8013


My problem comes from the fact that the "www.vhost2.com" seems to be egnored
when and only /*.jsp is cheched by jk2 code. Because that part is the same
it is dispached to the same tomcat instance.

Dmitry

-----Original Message-----
From:   Short, Dave [mailto:[EMAIL PROTECTED]]
Sent:   Thu 19/09/2002 5:30 PM
To:     'Tomcat Users List'
Cc:     
Subject:        RE: mod_jk2, virtual hosts, JkUriSet
Dmitry,

I'm having problems with this as well.  Although, it sounds like you have my
problems figured out (I'm not trying to go to two Tomcats from Apache
virtual hosts, I'm trying to go to just one Tomcat).  So, would you mind
posting your httpd.conf, workers.properties, server.xml and jk2.properties
files?

I'd appreciate it you wouldn't mind.

Thanks

-----Original Message-----
From: Dmitry Letin [mailto:[EMAIL PROTECTED]]
Sent: September 19, 2002 1:25 PM
To: [EMAIL PROTECTED]
Subject: mod_jk2, virtual hosts, JkUriSet


Hi,

Has anybody managed to successfully connect apache virtual hosts to
different
instances of tomcat using mod_jk2?

I spent several days looking at all available documentation, mail archives
and
a bit of source code but could not make a working solution.

I have no problem connecting to a single TomcatInstance. Problems start when
I need to connect to two separate instances.

I did check docs in
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/index.html
and found them not helpful.


For simplicity:
I need to connect /*.jsp from apache VirtualHost1 to TomcatInstance1 
and /*.jsp from apache VirtualHost2 to TomcatInstance2

I would greatly appreciate if somebody could send required fragments from 
a WORKING config files: httpd.conf, workers2.conf and jk2.properties.


>From jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c I found:

 * Example:
 *   <VirtualHost foo.com>
 *      <Location /examples>
 *         JkUriSet worker ajp13
 *      </Location>
 *   </VirtualHost>
 *
 * This is the best way to define a webapplication in apache. It is
 * scalable ( using apache native optimizations, you can have hundreds
 * of hosts and thousands of webapplications ), 'natural' to any
 * apache user.

Does it work properly at all? 

In my case I have:

<VirtualHost vh1>
     <Location /*.jsp>
        JkUriSet worker ajp13:localhost:8009
     </Location>
</VirtualHost>

<VirtualHost vh2>
     <Location /*.jsp>
        JkUriSet worker ajp13:localhost:8013
     </Location>
</VirtualHost>

But in the end all requests (even from vh1) are routed to worker
ajp13:localhost:8013
But I expected them to be routed to ajp13:localhost:8009

Looks like a bug to me.


Thanks,
Dmitry Letin



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

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





<<winmail.dat>>

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

Reply via email to