Re: mod_jk2, virtual hosts, JkUriSet

2002-09-23 Thread Dmitry Letin

Hi,

I compared revision 1.52 of jk/native2/server/apache2/mod_jk2.c to my 
current version.

I currently use the following code to distingquish between different 
virtual hosts:

static int jk2_translate(request_rec *r)
{
...

char vhost_port_buf[1024];
char *vhost_port;
   
...

if (r-server-is_virtual) {
  snprintf(vhost_port_buf, sizeof(vhost_port_buf), %s:%u,
   r-server-server_hostname, r-server-port);
  vhost_port = vhost_port_buf;
}
else vhost_port = NULL;

uriEnv = workerEnv-uriMap-mapUri(env, 
workerEnv-uriMap,vhost_port,r-uri );

...

}


This code allows to distinguish between different hosts when the server 
name is the same
and only port number is different.

In workers2.properties I now use:

[uri:host1.net:80]
info=host1.net hostname definition.

[uri:host2.net:80]
info=host2.net hostname definition.

#Now you can make all the mappings

[uri:host1.net:80/*.jsp]
info=host1.net extension mapping.
worker=ajp13:localhost:8009

[uri:host2.net:80/*.jsp]
info=host2.net extension mapping.
worker=ajp13:localhost:8013


I have checked-out revision 1.52 from CVS. Though it tells in history:

revision 1.52
date: 2002/09/22 09:35:46;  author: mturk;  state: Exp;  lines: +2 -2
Cannot use the hostname:server_port cause the port is 0 for all
host:80 requests. Also is_virtual is used for separating default and
virtual hosts. In case of default server host the hostname provided
to uriMap _MUST_ be NULL to be able to map the default uri:/


I do not see the fix this it in this revision.

Dmitry


Mladen Turk wrote:


 Could you guys thest against the current CVS.

  -Original Message-
  From: Dom [mailto:[EMAIL PROTECTED] ]
 
  [uri:/host1.net/*.jsp]
  info=host1.net default context.
  group=lb
  debug=0
 
  [uri:/host2.net/*.jsp]
  info=host2.net default context.
  group=lb
  debug=0
 

 This is wrong!!!
 All the host definition _must_ not start with the forward slash.
 So... HOSTNAME/URI (this is how we figure out what is the host and what
 is the uri).

 Correct one would be:

 [uri:host1.net]
 info=host1.net hostname definition.

 [uri:host2.net]
 info=host2.net hostname definition.

 #Now you can make all the mappings

 [uri:host1.net/*.jsp]
 info=host1.net extension mapping.

 [uri:host2.net/*.jsp]
 info=host2.net extension mapping.



 MT.





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




Re: mod_jk2, virtual hosts, JkUriSet

2002-09-23 Thread Eugene Gluzberg

Is this something that should be a patch to the CVS version?

could you submit a context diff plz...

Dmitry Letin wrote:
 Hi,
 
 static int jk2_translate(request_rec *r)
 {
...
 
char vhost_port_buf[1024];
char *vhost_port;
  ...
 
if (r-server-is_virtual) {
  snprintf(vhost_port_buf, sizeof(vhost_port_buf), %s:%u,
   r-server-server_hostname, r-server-port);
  vhost_port = vhost_port_buf;
}
else vhost_port = NULL;
 
uriEnv = workerEnv-uriMap-mapUri(env, 
 workerEnv-uriMap,vhost_port,r-uri );
 
...
 
 }
 
 


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




Re: mod_jk2, virtual hosts, JkUriSet

2002-09-23 Thread Eugene Gluzberg

How do I specify the location of workers2.properties for apache 1.3?

Dom wrote:
 You're right, it was a typo error as I had changed the real virtual hosts
 name !
 
 Dom
 - Original Message -
 From: Mladen Turk [EMAIL PROTECTED]
 To: 'Tomcat Users List' [EMAIL PROTECTED]
 Cc: Dom [EMAIL PROTECTED]; Dmitry Letin [EMAIL PROTECTED]
 Sent: Sunday, September 22, 2002 12:05 PM
 Subject: RE: mod_jk2, virtual hosts, JkUriSet
 
 
 
Could you guys thest against the current CVS.


-Original Message-
From: Dom [mailto:[EMAIL PROTECTED]]

[uri:/host1.net/*.jsp]
info=host1.net default context.
group=lb
debug=0

[uri:/host2.net/*.jsp]
info=host2.net default context.
group=lb
debug=0


This is wrong!!!
All the host definition _must_ not start with the forward slash.
So... HOSTNAME/URI (this is how we figure out what is the host and what
is the uri).

Correct one would be:

[uri:host1.net]
info=host1.net hostname definition.

[uri:host2.net]
info=host2.net hostname definition.

#Now you can make all the mappings

[uri:host1.net/*.jsp]
info=host1.net extension mapping.

[uri:host2.net/*.jsp]
info=host2.net extension mapping.



MT.



 
 
 
 --
 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]




Re: mod_jk2, virtual hosts, JkUriSet

2002-09-23 Thread Dmitry Letin

This this the patch from revision 1.49 of
jk/native2/server/apache2/mod_jk2.c
to my current version.

It works for me so far for proper virtual host mapping with server:port 
syntax.

The latest version in CVS at this moment is 1.52,
but there are not many changes from 1.49.

Dmitry

 -Original Message-
 From: Eugene Gluzberg [mailto:[EMAIL PROTECTED]]
 Sent: Monday, September 23, 2002 12:00 PM
 To: Tomcat Users List
 Subject: Re: mod_jk2, virtual hosts, JkUriSet
 
 Is this something that should be a patch to the CVS version?
 
 could you submit a context diff plz...
 
 Dmitry Letin wrote:
 
Hi,

static int jk2_translate(request_rec *r)
{
   ...

   char vhost_port_buf[1024];
   char *vhost_port;
 ...

   if (r-server-is_virtual) {
 snprintf(vhost_port_buf, sizeof(vhost_port_buf), %s:%u,
  r-server-server_hostname, r-server-port);
 vhost_port = vhost_port_buf;
   }
   else vhost_port = NULL;

   uriEnv = workerEnv-uriMap-mapUri(env,
workerEnv-uriMap,vhost_port,r-uri );

   ...

}


 



631a632,633
 char vhost_port_buf[1024];
 char *vhost_port;
680c682,689
 uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,r-uri );
---
 if (r-server-is_virtual) {
   snprintf(vhost_port_buf, sizeof(vhost_port_buf), %s:%u, 
r-server-server_hostname, r-server-port);
   vhost_port = vhost_port_buf;
 }
 else vhost_port = NULL;
 
 uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,vhost_port,r-uri );



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


RE: mod_jk2, virtual hosts, JkUriSet

2002-09-23 Thread Dmitry Letin

They fixed it in a different way already in release 1.53. Also changes were made to 
jk_uriMap.c
So we just need to try latest version from CVS I guess.

-Original Message-
From: Eugene Gluzberg [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 23, 2002 1:43 PM
To: Dmitry Letin
Subject: Re: mod_jk2, virtual hosts, JkUriSet

Did you have a chance to submit this patch to tomcat-dev list? Perhaps
they will be able to put it in.

Dmitry Letin wrote:
 This this the patch from revision 1.49 of
 jk/native2/server/apache2/mod_jk2.c
 to my current version.

 It works for me so far for proper virtual host mapping with server:port
 syntax.

 The latest version in CVS at this moment is 1.52,
 but there are not many changes from 1.49.

 Dmitry

 -Original Message-
 From: Eugene Gluzberg [mailto:[EMAIL PROTECTED]]
 Sent: Monday, September 23, 2002 12:00 PM
 To: Tomcat Users List
 Subject: Re: mod_jk2, virtual hosts, JkUriSet

 Is this something that should be a patch to the CVS version?

 could you submit a context diff plz...

 Dmitry Letin wrote:

 Hi,

 static int jk2_translate(request_rec *r)
 {
   ...

   char vhost_port_buf[1024];
   char *vhost_port;
 ...

   if (r-server-is_virtual) {
 snprintf(vhost_port_buf, sizeof(vhost_port_buf), %s:%u,
  r-server-server_hostname, r-server-port);
 vhost_port = vhost_port_buf;
   }
   else vhost_port = NULL;

   uriEnv = workerEnv-uriMap-mapUri(env,
 workerEnv-uriMap,vhost_port,r-uri );

   ...

 }





 

 631a632,633

char vhost_port_buf[1024];
char *vhost_port;

 680c682,689
  uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,r-uri );
 ---

if (r-server-is_virtual) {
  snprintf(vhost_port_buf, sizeof(vhost_port_buf), %s:%u,
   r-server-server_hostname, r-server-port);
  vhost_port = vhost_port_buf;
}
else vhost_port = NULL;

uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,vhost_port,r-uri );


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




Re: mod_jk2, virtual hosts, JkUriSet

2002-09-23 Thread Eugene Gluzberg

Answered my own question:

JkSet config.file /etc/httpd/conf/workers2.properties

Eugene Gluzberg wrote:
 How do I specify the location of workers2.properties for apache 1.3?
 
 Dom wrote:
 
 You're right, it was a typo error as I had changed the real virtual hosts
 name !

 Dom
 - Original Message -
 From: Mladen Turk [EMAIL PROTECTED]
 To: 'Tomcat Users List' [EMAIL PROTECTED]
 Cc: Dom [EMAIL PROTECTED]; Dmitry Letin [EMAIL PROTECTED]
 Sent: Sunday, September 22, 2002 12:05 PM
 Subject: RE: mod_jk2, virtual hosts, JkUriSet



 Could you guys thest against the current CVS.


 -Original Message-
 From: Dom [mailto:[EMAIL PROTECTED]]

 [uri:/host1.net/*.jsp]
 info=host1.net default context.
 group=lb
 debug=0

 [uri:/host2.net/*.jsp]
 info=host2.net default context.
 group=lb
 debug=0


 This is wrong!!!
 All the host definition _must_ not start with the forward slash.
 So... HOSTNAME/URI (this is how we figure out what is the host and what
 is the uri).

 Correct one would be:

 [uri:host1.net]
 info=host1.net hostname definition.

 [uri:host2.net]
 info=host2.net hostname definition.

 #Now you can make all the mappings

 [uri:host1.net/*.jsp]
 info=host1.net extension mapping.

 [uri:host2.net/*.jsp]
 info=host2.net extension mapping.



 MT.






 -- 
 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]
 
 
 


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




Re: mod_jk2, virtual hosts, JkUriSet

2002-09-23 Thread Dom

Hi

I don't specify it anywhere, neither with 2.0.40 nor 1.3.26 !

I suppose mod_jk2 looks for a conf/workers2.properties, then after having
read it, if it finds a :

[config:]
file=anotherplace/myworkers.properties

in it, loads this last one as the real properties file

Could someone confirm or not ???

Dom

- Original Message -
From: Eugene Gluzberg [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Monday, September 23, 2002 6:11 PM
Subject: Re: mod_jk2, virtual hosts, JkUriSet


 How do I specify the location of workers2.properties for apache 1.3?

 Dom wrote:
  You're right, it was a typo error as I had changed the real virtual
hosts
  name !
 
  Dom
  - Original Message -
  From: Mladen Turk [EMAIL PROTECTED]
  To: 'Tomcat Users List' [EMAIL PROTECTED]
  Cc: Dom [EMAIL PROTECTED]; Dmitry Letin [EMAIL PROTECTED]
  Sent: Sunday, September 22, 2002 12:05 PM
  Subject: RE: mod_jk2, virtual hosts, JkUriSet
 
 
 
 Could you guys thest against the current CVS.
 
 
 -Original Message-
 From: Dom [mailto:[EMAIL PROTECTED]]
 
 [uri:/host1.net/*.jsp]
 info=host1.net default context.
 group=lb
 debug=0
 
 [uri:/host2.net/*.jsp]
 info=host2.net default context.
 group=lb
 debug=0
 
 
 This is wrong!!!
 All the host definition _must_ not start with the forward slash.
 So... HOSTNAME/URI (this is how we figure out what is the host and what
 is the uri).
 
 Correct one would be:
 
 [uri:host1.net]
 info=host1.net hostname definition.
 
 [uri:host2.net]
 info=host2.net hostname definition.
 
 #Now you can make all the mappings
 
 [uri:host1.net/*.jsp]
 info=host1.net extension mapping.
 
 [uri:host2.net/*.jsp]
 info=host2.net extension mapping.
 
 
 
 MT.
 
 
 
 
 
 
  --
  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]





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




RE: mod_jk2, virtual hosts, JkUriSet

2002-09-22 Thread Mladen Turk


Could you guys thest against the current CVS.

 -Original Message-
 From: Dom [mailto:[EMAIL PROTECTED]] 
 
 [uri:/host1.net/*.jsp]
 info=host1.net default context.
 group=lb
 debug=0
 
 [uri:/host2.net/*.jsp]
 info=host2.net default context.
 group=lb
 debug=0
 

This is wrong!!!
All the host definition _must_ not start with the forward slash.
So... HOSTNAME/URI (this is how we figure out what is the host and what
is the uri).

Correct one would be:

[uri:host1.net]
info=host1.net hostname definition.

[uri:host2.net]
info=host2.net hostname definition.

#Now you can make all the mappings

[uri:host1.net/*.jsp]
info=host1.net extension mapping.

[uri:host2.net/*.jsp]
info=host2.net extension mapping.



MT.


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




Re: mod_jk2, virtual hosts, JkUriSet

2002-09-22 Thread Dom

You're right, it was a typo error as I had changed the real virtual hosts
name !

Dom
- Original Message -
From: Mladen Turk [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Cc: Dom [EMAIL PROTECTED]; Dmitry Letin [EMAIL PROTECTED]
Sent: Sunday, September 22, 2002 12:05 PM
Subject: RE: mod_jk2, virtual hosts, JkUriSet



 Could you guys thest against the current CVS.

  -Original Message-
  From: Dom [mailto:[EMAIL PROTECTED]]
 
  [uri:/host1.net/*.jsp]
  info=host1.net default context.
  group=lb
  debug=0
 
  [uri:/host2.net/*.jsp]
  info=host2.net default context.
  group=lb
  debug=0
 

 This is wrong!!!
 All the host definition _must_ not start with the forward slash.
 So... HOSTNAME/URI (this is how we figure out what is the host and what
 is the uri).

 Correct one would be:

 [uri:host1.net]
 info=host1.net hostname definition.

 [uri:host2.net]
 info=host2.net hostname definition.

 #Now you can make all the mappings

 [uri:host1.net/*.jsp]
 info=host1.net extension mapping.

 [uri:host2.net/*.jsp]
 info=host2.net extension mapping.



 MT.





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




Re: mod_jk2, virtual hosts, JkUriSet

2002-09-21 Thread Dom

Hi jk2 freaks

I've applied Dmitry patch on jakarta-tomcat-connectors-4.1.11-src, and now
virtual hosts are working without using JkUriSet.  (JkUriSet was not
avalaible with Apache 1.3)

I now can use Apache 2.0.40 or Apache 1.3.26 + TOMCAT 4.1.11 and virtual
hosts using only workers2.properties and jk2.properties.

Next step, using unix sockets

Dom

- Original Message -
From: Dmitry Letin [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Saturday, September 21, 2002 3:43 AM
Subject: Re: mod_jk2, virtual hosts, JkUriSet


 I finally found the bug (or whatever it is) that caused problems:

 in source file jk/native2/server/apache2/mod_jk2.c
 in line 680 (I have revision 1.49) that reads:

 uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,r-uri);

 NULL should be replaced to r-server-server_hostname (without the
quotes of course)

 This NULL - was the reason for invalid handling of virtual hosts.
 I have not tested this a lot yet, but virtual hosts are dispached properly
now :-) :-)

 This fix is for apache2 only.
 I actually typed manually the stuff above - could not do copy/paste - hope
I made no typos

 Recompile mod_jk2.so after this change - and all works

 Dmitry





 Hello all,
 I'm having the same problem, and I've been banging my head against it on
and
 off for about a week with no more success than anyone else...
Essentially,
 we're all trying to map the root of different virtual hosts to a different
 context within tomcat, right?  I started looking elsewhere and found that
 Resin's apache module utilizes the ServerName directive within a
 VirtualHost block to select different web apps...  If it's a
make-or-break
 deal, you might want to look there.  Another workaround possibility that
I'm
 toying with now is to use mod_rewrite within apache to redirect *.jsp
 requests from http://www.vhost1.com to http://www.vhost1.com/vh1/ and map
 the /vh1/*.jsp uri to the proper context.  It just seems virtual host
 support via mod_jk2 is not possible without duct tape and bubble gum,
which
 is a shame because the unix socket feature is fantastic...

 Ah, for the good old days of JServ/JSSI...


 - Original Message -
 From: Dmitry Letin [EMAIL PROTECTED]
 To: Tomcat Users List [EMAIL PROTECTED]
 Sent: Thursday, September 19, 2002 6:46 PM
 Subject: RE: mod_jk2, virtual hosts, JkUriSet


  Hi Robert,
 
  In my config files I of course use real domains.
  I did try to use only workers2.properties files for configuration.
  It seems that virtual host part is ignored, so that these are the same
 when
  jk2 selects worker:
 
 
 
  # 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:80/*.jsp] - not working as well
  [uri:www.vhost2.com/*.jsp]
  worker=ajp13:localhost:8013
 
 
  My problem comes from the fact that the virtual host part in uri seems
to
 be ignored
  when jk2 selects a worker, and only url path is cheched by jk2 code.
 Because that part is the same
  it is dispached to the same tomcat instance.
 
  I do have proper entries in my /etc/hosts file (I'm on Linux) and I did
 try this as well
 
  [uri:142.54.3.10:80]
  alias=www.vhost1.com:80
 
  It did not help.
 
  I promise to write a how-to on this if I manage to solve this problem
:-)
  But I have doubts I can solve it :-(
 
 
  Dmitry
 
 
 
 
  -Original Message-
  From: Robert L Sowders [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, September 19, 2002 6:32 PM
  To: Tomcat Users List
  Subject: Re: mod_jk2, virtual hosts, JkUriSet
 
  Forgot to mention,
 
  Here's a snip from the default workers2.properties file from the src
 
  [uri:127.0.0.1:8003]
  info=Example virtual host. Make sure myVirtualHost is in /etc/hosts to
  test it
  alias=myVirtualHost:8003
 
  On a windows machine the hosts file is in c:\WinNT\system32\drivers\etc
  You'll also have to define the connector in the server.xml file.
 
 
 
 
 
 
  Robert L Sowders [EMAIL PROTECTED]
  09/19/2002 02:48 PM
  Please respond to Tomcat Users List
 
 
  To: Tomcat Users List [EMAIL PROTECTED]
  cc:
  Subject:Re: mod_jk2, virtual hosts, JkUriSet
 
  H,
 
  looks like you got some funny domains for those VirtualHosts as well as
  some nonstandard JkUriSet statements.  You probably have a problem with
  one or both.
 
  Others have been successful.
  http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg66171.html
 
  Make your virtual hosts as fully qualified domains and make your
JkUriSet
  commands like the example.  Leave the port selection up to the
  workers2.properties file.
 
  Regardless of how you do it, after you are successful a nice step by
step
  How To would be appreciated by all.
 
  rls
 
 
 
 
 
  Dmitry Letin [EMAIL PROTECTED]
  09/19/2002 01:24 PM
  Please respond to Tomcat Users List

Re: mod_jk2, virtual hosts, JkUriSet

2002-09-21 Thread Dmitry Letin

Developers have already added this fix:
 
http://www.mail-archive.com/tomcat-dev%40jakarta.apache.org/msg33556.html
 
That was really fast.
 
Dmitry

- Original Message -
From: Robert L Sowders [mailto:[EMAIL PROTECTED]] 
Sent: Сб 21/09/2002 2:16 
To: Tomcat Users List 
CC: Dmitry Letin 
Subject: Re: mod_jk2, virtual hosts, JkUriSet



Hello,

I'm glad you got it working.  Have you posted a bug at
http://www.mail-archive.com/tomcat-dev%40jakarta.apache.org/ I'm sure the
developers of JK2 would be interested in your patch?

You might have already, their web site has not been updating for awhile
now.

rls





RE: mod_jk2, virtual hosts, JkUriSet

2002-09-21 Thread Short, Dave

Dmitry,

It looks like the code the developers added was different from your original
code.

Here's your code:

uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,r-uri);
 
NULL should be replaced to r-server-server_hostname (without the
quotes of course)


and here's their code:

  -uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,r-uri
);
  +uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,
  +r-server-is_virtual ? r-server-server_hostname :
NULL,
  +r-uri );
   
Looks like they added a check for a virtual host before executing your code.
Have you had a chance to test this?


-Original Message-
From: Dmitry Letin [mailto:[EMAIL PROTECTED]]
Sent: September 21, 2002 8:50 AM
To: [EMAIL PROTECTED]
Subject: Re: mod_jk2, virtual hosts, JkUriSet


Developers have already added this fix:
 
http://www.mail-archive.com/tomcat-dev%40jakarta.apache.org/msg33556.html
 
That was really fast.
 
Dmitry

- Original Message -
From: Robert L Sowders [mailto:[EMAIL PROTECTED]] 
Sent: Сб 21/09/2002 2:16 
To: Tomcat Users List 
CC: Dmitry Letin 
Subject: Re: mod_jk2, virtual hosts, JkUriSet



Hello,

I'm glad you got it working.  Have you posted a bug at
http://www.mail-archive.com/tomcat-dev%40jakarta.apache.org/ I'm
sure the
developers of JK2 would be interested in your patch?

You might have already, their web site has not been updating for
awhile
now.

rls



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




RE: mod_jk2, virtual hosts, JkUriSet

2002-09-21 Thread Short, Dave

Would you mind posting your Apache 2.0.40 httpd.conf and workers.properties
files, Tomcat 4.1.11 server.xml and jk2.properties files?

I'm still not able get this thing working.  All I want to do is have two
Apache virtual hosts pointing to one Tomcat 4.1.10 instance.

This is driving me crazy...

-Original Message-
From: Dom [mailto:[EMAIL PROTECTED]]
Sent: September 21, 2002 2:02 AM
To: Tomcat Users List
Subject: Re: mod_jk2, virtual hosts, JkUriSet


Hi jk2 freaks

I've applied Dmitry patch on jakarta-tomcat-connectors-4.1.11-src, and now
virtual hosts are working without using JkUriSet.  (JkUriSet was not
avalaible with Apache 1.3)

I now can use Apache 2.0.40 or Apache 1.3.26 + TOMCAT 4.1.11 and virtual
hosts using only workers2.properties and jk2.properties.

Next step, using unix sockets

Dom

- Original Message -
From: Dmitry Letin [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Saturday, September 21, 2002 3:43 AM
Subject: Re: mod_jk2, virtual hosts, JkUriSet


 I finally found the bug (or whatever it is) that caused problems:

 in source file jk/native2/server/apache2/mod_jk2.c
 in line 680 (I have revision 1.49) that reads:

 uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,r-uri);

 NULL should be replaced to r-server-server_hostname (without the
quotes of course)

 This NULL - was the reason for invalid handling of virtual hosts.
 I have not tested this a lot yet, but virtual hosts are dispached properly
now :-) :-)

 This fix is for apache2 only.
 I actually typed manually the stuff above - could not do copy/paste - hope
I made no typos

 Recompile mod_jk2.so after this change - and all works

 Dmitry





 Hello all,
 I'm having the same problem, and I've been banging my head against it on
and
 off for about a week with no more success than anyone else...
Essentially,
 we're all trying to map the root of different virtual hosts to a different
 context within tomcat, right?  I started looking elsewhere and found that
 Resin's apache module utilizes the ServerName directive within a
 VirtualHost block to select different web apps...  If it's a
make-or-break
 deal, you might want to look there.  Another workaround possibility that
I'm
 toying with now is to use mod_rewrite within apache to redirect *.jsp
 requests from http://www.vhost1.com to http://www.vhost1.com/vh1/ and map
 the /vh1/*.jsp uri to the proper context.  It just seems virtual host
 support via mod_jk2 is not possible without duct tape and bubble gum,
which
 is a shame because the unix socket feature is fantastic...

 Ah, for the good old days of JServ/JSSI...


 - Original Message -
 From: Dmitry Letin [EMAIL PROTECTED]
 To: Tomcat Users List [EMAIL PROTECTED]
 Sent: Thursday, September 19, 2002 6:46 PM
 Subject: RE: mod_jk2, virtual hosts, JkUriSet


  Hi Robert,
 
  In my config files I of course use real domains.
  I did try to use only workers2.properties files for configuration.
  It seems that virtual host part is ignored, so that these are the same
 when
  jk2 selects worker:
 
 
 
  # 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:80/*.jsp] - not working as well
  [uri:www.vhost2.com/*.jsp]
  worker=ajp13:localhost:8013
 
 
  My problem comes from the fact that the virtual host part in uri seems
to
 be ignored
  when jk2 selects a worker, and only url path is cheched by jk2 code.
 Because that part is the same
  it is dispached to the same tomcat instance.
 
  I do have proper entries in my /etc/hosts file (I'm on Linux) and I did
 try this as well
 
  [uri:142.54.3.10:80]
  alias=www.vhost1.com:80
 
  It did not help.
 
  I promise to write a how-to on this if I manage to solve this problem
:-)
  But I have doubts I can solve it :-(
 
 
  Dmitry
 
 
 
 
  -Original Message-
  From: Robert L Sowders [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, September 19, 2002 6:32 PM
  To: Tomcat Users List
  Subject: Re: mod_jk2, virtual hosts, JkUriSet
 
  Forgot to mention,
 
  Here's a snip from the default workers2.properties file from the src
 
  [uri:127.0.0.1:8003]
  info=Example virtual host. Make sure myVirtualHost is in /etc/hosts to
  test it
  alias=myVirtualHost:8003
 
  On a windows machine the hosts file is in c:\WinNT\system32\drivers\etc
  You'll also have to define the connector in the server.xml file.
 
 
 
 
 
 
  Robert L Sowders [EMAIL PROTECTED]
  09/19/2002 02:48 PM
  Please respond to Tomcat Users List
 
 
  To: Tomcat Users List [EMAIL PROTECTED]
  cc:
  Subject:Re: mod_jk2, virtual hosts, JkUriSet
 
  H,
 
  looks like you got some funny domains for those VirtualHosts as well as
  some nonstandard JkUriSet statements.  You probably have a problem with
  one or both.
 
  Others have been successful.
  http

RE: mod_jk2, virtual hosts, JkUriSet

2002-09-21 Thread Dmitry Letin

Hi Dave,
 
As I understand from the jk2 source code, the main apache server (that is not a 
virtual host)
is reffered to in mod_jk2 code as NULL (for uri mapping purposes). 
Following this logic the check is right. 
I did not have this check in my fix because all my
hosts in apache httpd.conf are virtual.
 
I have not tested anything yet - it is a weekend after all
 
Dmitry

From: Short, Dave [mailto:[EMAIL PROTECTED]] 
Sent: Сб 21/09/2002 1:01 
To: 'Tomcat Users List' 
CC: 
Subject: RE: mod_jk2, virtual hosts, JkUriSet



Dmitry,

It looks like the code the developers added was different from your original
code.

Here's your code:

uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,r-uri);

NULL should be replaced to r-server-server_hostname (without the
quotes of course)


and here's their code:

  -uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,r-uri
);
  +uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,
  +r-server-is_virtual ? r-server-server_hostname :
NULL,
  +r-uri );
  
Looks like they added a check for a virtual host before executing your code.
Have you had a chance to test this?


-Original Message-
From: Dmitry Letin [mailto:[EMAIL PROTECTED]]
Sent: September 21, 2002 8:50 AM
To: [EMAIL PROTECTED]
Subject: Re: mod_jk2, virtual hosts, JkUriSet


Developers have already added this fix:

http://www.mail-archive.com/tomcat-dev%40jakarta.apache.org/msg33556.html

That was really fast.

Dmitry

- Original Message -
From: Robert L Sowders [mailto:[EMAIL PROTECTED]]
Sent: Сб 21/09/2002 2:16
To: Tomcat Users List
CC: Dmitry Letin
Subject: Re: mod_jk2, virtual hosts, JkUriSet
   
   

Hello,
   
I'm glad you got it working.  Have you posted a bug at
http://www.mail-archive.com/tomcat-dev%40jakarta.apache.org/ I'm
sure the
developers of JK2 would be interested in your patch?
   
You might have already, their web site has not been updating for
awhile
now.
   
rls
   


--
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]


Re: mod_jk2, virtual hosts, JkUriSet

2002-09-21 Thread Dom

Hi Dave

RH 7.3, Apache 2.0.40, TC 4.1.11, j2sdk1.4.1 fcs

-  httpd.conf ( I use a vhosts.conf) :

Nothing special, the regular :

NameVirtualHost 10.0.0.11:80
VirtualHost 10.0.0.11:80
ServerName host1.net
...
VirtualHost 10.0.0.11:80
ServerName host2.net
...

- workers2.properties (complete for 2 v.hosts, only managing jsp's using lb
load balancer)

[shm]
file=${serverRoot}/logs/shm.file
size=1048576

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

# Example socket channel, override port and host.
[channel.socket:localhost:8009]
port=8009
lb_factor=1
group=lb
host=10.0.0.11
disabled=0

# define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009

[uri:/host1.net/*.jsp]
info=host1.net default context.
group=lb
debug=0

[uri:/host2.net/*.jsp]
info=host2.net default context.
group=lb
debug=0

# Map /jkstatus to the status worker.
# define the worker
[status:status]

# Uri mapping
[uri:/jkstatus/*]
worker=status:status


- jk2.properties

Stock : all lines commented

- server.xml

Stock, only added v. hosts

Host name=host1.net
...
Host name=host2.net
...

And, of course, the patch from Dmitry, or the
http://www.mail-archive.com/tomcat-dev%40jakarta.apache.org/msg33556.html
one before compiling the connectors, both are working fine.

My configure :
./configure --with-apxs=/usr/local/apache/bin/apxs --with-apxs2=/usr/local/a
pache2/bin/apxs --with-tomcat41=/usr/local/jakarta-tomcat-4.1.11-LE-jdk14

Hope it will help you

Dom

- Original Message -
From: Short, Dave [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Saturday, September 21, 2002 10:30 PM
Subject: RE: mod_jk2, virtual hosts, JkUriSet


 Would you mind posting your Apache 2.0.40 httpd.conf and
workers.properties
 files, Tomcat 4.1.11 server.xml and jk2.properties files?

 I'm still not able get this thing working.  All I want to do is have two
 Apache virtual hosts pointing to one Tomcat 4.1.10 instance.

 This is driving me crazy...

 -Original Message-
 From: Dom [mailto:[EMAIL PROTECTED]]
 Sent: September 21, 2002 2:02 AM
 To: Tomcat Users List
 Subject: Re: mod_jk2, virtual hosts, JkUriSet


 Hi jk2 freaks

 I've applied Dmitry patch on jakarta-tomcat-connectors-4.1.11-src, and now
 virtual hosts are working without using JkUriSet.  (JkUriSet was not
 avalaible with Apache 1.3)

 I now can use Apache 2.0.40 or Apache 1.3.26 + TOMCAT 4.1.11 and virtual
 hosts using only workers2.properties and jk2.properties.

 Next step, using unix sockets

 Dom

 - Original Message -
 From: Dmitry Letin [EMAIL PROTECTED]
 To: Tomcat Users List [EMAIL PROTECTED]
 Sent: Saturday, September 21, 2002 3:43 AM
 Subject: Re: mod_jk2, virtual hosts, JkUriSet


  I finally found the bug (or whatever it is) that caused problems:
 
  in source file jk/native2/server/apache2/mod_jk2.c
  in line 680 (I have revision 1.49) that reads:
 
  uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,r-uri);
 
  NULL should be replaced to r-server-server_hostname (without the
 quotes of course)
 
  This NULL - was the reason for invalid handling of virtual hosts.
  I have not tested this a lot yet, but virtual hosts are dispached
properly
 now :-) :-)
 
  This fix is for apache2 only.
  I actually typed manually the stuff above - could not do copy/paste -
hope
 I made no typos
 
  Recompile mod_jk2.so after this change - and all works
 
  Dmitry
 
 
 
 
 
  Hello all,
  I'm having the same problem, and I've been banging my head against it on
 and
  off for about a week with no more success than anyone else...
 Essentially,
  we're all trying to map the root of different virtual hosts to a
different
  context within tomcat, right?  I started looking elsewhere and found
that
  Resin's apache module utilizes the ServerName directive within a
  VirtualHost block to select different web apps...  If it's a
 make-or-break
  deal, you might want to look there.  Another workaround possibility that
 I'm
  toying with now is to use mod_rewrite within apache to redirect *.jsp
  requests from http://www.vhost1.com to http://www.vhost1.com/vh1/ and
map
  the /vh1/*.jsp uri to the proper context.  It just seems virtual host
  support via mod_jk2 is not possible without duct tape and bubble gum,
 which
  is a shame because the unix socket feature is fantastic...
 
  Ah, for the good old days of JServ/JSSI...
 
 
  - Original Message -
  From: Dmitry Letin [EMAIL PROTECTED]
  To: Tomcat Users List [EMAIL PROTECTED]
  Sent: Thursday, September 19, 2002 6:46 PM
  Subject: RE: mod_jk2, virtual hosts, JkUriSet
 
 
   Hi Robert,
  
   In my config files I of course use real domains.
   I did try to use only workers2.properties files for configuration.
   It seems that virtual host part is ignored, so that these are the same
  when
   jk2 selects worker:
  
  
  
   # 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

Re: mod_jk2, virtual hosts, JkUriSet

2002-09-20 Thread Dom

Hi

I'm using JkUriSet statements as in
http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg66171.html
with my RH7.3,  j2sdk1.4.1 fcs, Apache 2.0.40 and TC 4.1.10 with virtual
hosts and they works fine.

By the way, is there a way to compile mod_jk2 for Apache 1.3.26 ? The make
builds the build/jk2/apache13 but not mod_jk2.so : looking for APR libs.

Dom
- Original Message -
From: Robert L Sowders [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Thursday, September 19, 2002 11:48 PM
Subject: Re: mod_jk2, virtual hosts, JkUriSet


 H,

 looks like you got some funny domains for those VirtualHosts as well as
 some nonstandard JkUriSet statements.  You probably have a problem with
 one or both.

 Others have been successful.
 http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg66171.html

 Make your virtual hosts as fully qualified domains and make your JkUriSet
 commands like the example.  Leave the port selection up to the
 workers2.properties file.

 Regardless of how you do it, after you are successful a nice step by step
 How To would be appreciated by all.

 rls





 Dmitry Letin [EMAIL PROTECTED]
 09/19/2002 01:24 PM
 Please respond to Tomcat Users List


 To: [EMAIL PROTECTED]
 cc:
 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]





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




RE: mod_jk2, virtual hosts, JkUriSet

2002-09-20 Thread Turner, John


There's a mod_jk2.so on my website for Apache 1.3.26:

http://www.johnturner.com/howto

I haven't had a chance to test it, so caveat emptor.

John

 -Original Message-
 From: Dom [mailto:[EMAIL PROTECTED]]
 Sent: Friday, September 20, 2002 1:35 PM
 To: Tomcat Users List
 Subject: Re: mod_jk2, virtual hosts, JkUriSet
 
 
 Hi
 
 I'm using JkUriSet statements as in
 http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg
 66171.html
 with my RH7.3,  j2sdk1.4.1 fcs, Apache 2.0.40 and TC 4.1.10 
 with virtual
 hosts and they works fine.
 
 By the way, is there a way to compile mod_jk2 for Apache 
 1.3.26 ? The make
 builds the build/jk2/apache13 but not mod_jk2.so : looking 
 for APR libs.
 
 Dom
 - Original Message -
 From: Robert L Sowders [EMAIL PROTECTED]
 To: Tomcat Users List [EMAIL PROTECTED]
 Sent: Thursday, September 19, 2002 11:48 PM
 Subject: Re: mod_jk2, virtual hosts, JkUriSet
 
 
  H,
 
  looks like you got some funny domains for those 
 VirtualHosts as well as
  some nonstandard JkUriSet statements.  You probably have a 
 problem with
  one or both.
 
  Others have been successful.
  
 http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg
 66171.html
 
  Make your virtual hosts as fully qualified domains and make 
 your JkUriSet
  commands like the example.  Leave the port selection up to the
  workers2.properties file.
 
  Regardless of how you do it, after you are successful a 
 nice step by step
  How To would be appreciated by all.
 
  rls
 
 
 
 
 
  Dmitry Letin [EMAIL PROTECTED]
  09/19/2002 01:24 PM
  Please respond to Tomcat Users List
 
 
  To: [EMAIL PROTECTED]
  cc:
  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]
 
 
 
 
 
 --
 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]




Re: mod_jk2, virtual hosts, JkUriSet

2002-09-20 Thread Dom

Hi John

Your website shows mod_jk2.so for Apache 1.3.26, TC 4.1.10 and RH 7.2, but
not RH 7.3 !

Dom
- Original Message -
From: Turner, John [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Friday, September 20, 2002 7:37 PM
Subject: RE: mod_jk2, virtual hosts, JkUriSet



 There's a mod_jk2.so on my website for Apache 1.3.26:

 http://www.johnturner.com/howto

 I haven't had a chance to test it, so caveat emptor.

 John

  -Original Message-
  From: Dom [mailto:[EMAIL PROTECTED]]
  Sent: Friday, September 20, 2002 1:35 PM
  To: Tomcat Users List
  Subject: Re: mod_jk2, virtual hosts, JkUriSet
 
 
  Hi
 
  I'm using JkUriSet statements as in
  http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg
  66171.html
  with my RH7.3,  j2sdk1.4.1 fcs, Apache 2.0.40 and TC 4.1.10
  with virtual
  hosts and they works fine.
 
  By the way, is there a way to compile mod_jk2 for Apache
  1.3.26 ? The make
  builds the build/jk2/apache13 but not mod_jk2.so : looking
  for APR libs.
 
  Dom
  - Original Message -
  From: Robert L Sowders [EMAIL PROTECTED]
  To: Tomcat Users List [EMAIL PROTECTED]
  Sent: Thursday, September 19, 2002 11:48 PM
  Subject: Re: mod_jk2, virtual hosts, JkUriSet
 
 
   H,
  
   looks like you got some funny domains for those
  VirtualHosts as well as
   some nonstandard JkUriSet statements.  You probably have a
  problem with
   one or both.
  
   Others have been successful.
  
  http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg
  66171.html
  
   Make your virtual hosts as fully qualified domains and make
  your JkUriSet
   commands like the example.  Leave the port selection up to the
   workers2.properties file.
  
   Regardless of how you do it, after you are successful a
  nice step by step
   How To would be appreciated by all.
  
   rls
  
  
  
  
  
   Dmitry Letin [EMAIL PROTECTED]
   09/19/2002 01:24 PM
   Please respond to Tomcat Users List
  
  
   To: [EMAIL PROTECTED]
   cc:
   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]
  
  
  
 
 
  --
  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]





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




RE: mod_jk2, virtual hosts, JkUriSet

2002-09-20 Thread Turner, John


I highly doubt it makes any difference.  Isn't it worth downloading and
trying it?  If it works, let me (us) know.

John

 -Original Message-
 From: Dom [mailto:[EMAIL PROTECTED]]
 Sent: Friday, September 20, 2002 2:08 PM
 To: Tomcat Users List
 Subject: Re: mod_jk2, virtual hosts, JkUriSet
 
 
 Hi John
 
 Your website shows mod_jk2.so for Apache 1.3.26, TC 4.1.10 
 and RH 7.2, but
 not RH 7.3 !
 
 Dom
 - Original Message -
 From: Turner, John [EMAIL PROTECTED]
 To: 'Tomcat Users List' [EMAIL PROTECTED]
 Sent: Friday, September 20, 2002 7:37 PM
 Subject: RE: mod_jk2, virtual hosts, JkUriSet
 
 
 
  There's a mod_jk2.so on my website for Apache 1.3.26:
 
  http://www.johnturner.com/howto
 
  I haven't had a chance to test it, so caveat emptor.
 
  John
 

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




RE: mod_jk2, virtual hosts, JkUriSet

2002-09-20 Thread Dmitry Letin

Hi Dom, 
did you actually put this verbatim into httpd.conf: JkUriSet worker ajp13?

Do you try to connect to the same tomcat from different virtual hosts 
or each virtual host connects to a separate tomcat instance?

Dmitry

-Original Message-
From: Dom [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 20, 2002 1:35 PM
To: Tomcat Users List
Subject: Re: mod_jk2, virtual hosts, JkUriSet

Hi

I'm using JkUriSet statements as in
http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg66171.html
with my RH7.3,  j2sdk1.4.1 fcs, Apache 2.0.40 and TC 4.1.10 with virtual
hosts and they works fine.

By the way, is there a way to compile mod_jk2 for Apache 1.3.26 ? The make
builds the build/jk2/apache13 but not mod_jk2.so : looking for APR libs.

Dom
- Original Message -
From: Robert L Sowders [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Thursday, September 19, 2002 11:48 PM
Subject: Re: mod_jk2, virtual hosts, JkUriSet


 H,

 looks like you got some funny domains for those VirtualHosts as well as
 some nonstandard JkUriSet statements.  You probably have a problem with
 one or both.

 Others have been successful.
 http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg66171.html

 Make your virtual hosts as fully qualified domains and make your JkUriSet
 commands like the example.  Leave the port selection up to the
 workers2.properties file.

 Regardless of how you do it, after you are successful a nice step by step
 How To would be appreciated by all.

 rls





 Dmitry Letin [EMAIL PROTECTED]
 09/19/2002 01:24 PM
 Please respond to Tomcat Users List


 To: [EMAIL PROTECTED]
 cc:
 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]




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




mod_jk2, virtual hosts, JkUriSet directive

2002-09-20 Thread Dmitry Letin

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 of 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.


Also 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 anybody knows how to use this directive properly?

I tried to use it - but it did not work as I expected.
What should be specified in place of worker and ajp13?


Thanks,
Dmitry Letin


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




Re: mod_jk2, virtual hosts, JkUriSet

2002-09-20 Thread Matt Sales

Hello all,
I'm having the same problem, and I've been banging my head against it on and
off for about a week with no more success than anyone else...  Essentially,
we're all trying to map the root of different virtual hosts to a different
context within tomcat, right?  I started looking elsewhere and found that
Resin's apache module utilizes the ServerName directive within a
VirtualHost block to select different web apps...  If it's a make-or-break
deal, you might want to look there.  Another workaround possibility that I'm
toying with now is to use mod_rewrite within apache to redirect *.jsp
requests from http://www.vhost1.com to http://www.vhost1.com/vh1/ and map
the /vh1/*.jsp uri to the proper context.  It just seems virtual host
support via mod_jk2 is not possible without duct tape and bubble gum, which
is a shame because the unix socket feature is fantastic...

Ah, for the good old days of JServ/JSSI...


- Original Message -
From: Dmitry Letin [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Thursday, September 19, 2002 6:46 PM
Subject: RE: mod_jk2, virtual hosts, JkUriSet


 Hi Robert,

 In my config files I of course use real domains.
 I did try to use only workers2.properties files for configuration.
 It seems that virtual host part is ignored, so that these are the same
when
 jk2 selects worker:



 # 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:80/*.jsp] - not working as well
 [uri:www.vhost2.com/*.jsp]
 worker=ajp13:localhost:8013


 My problem comes from the fact that the virtual host part in uri seems to
be ignored
 when jk2 selects a worker, and only url path is cheched by jk2 code.
Because that part is the same
 it is dispached to the same tomcat instance.

 I do have proper entries in my /etc/hosts file (I'm on Linux) and I did
try this as well

 [uri:142.54.3.10:80]
 alias=www.vhost1.com:80

 It did not help.

 I promise to write a how-to on this if I manage to solve this problem :-)
 But I have doubts I can solve it :-(


 Dmitry




 -Original Message-
 From: Robert L Sowders [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, September 19, 2002 6:32 PM
 To: Tomcat Users List
 Subject: Re: mod_jk2, virtual hosts, JkUriSet

 Forgot to mention,

 Here's a snip from the default workers2.properties file from the src

 [uri:127.0.0.1:8003]
 info=Example virtual host. Make sure myVirtualHost is in /etc/hosts to
 test it
 alias=myVirtualHost:8003

 On a windows machine the hosts file is in c:\WinNT\system32\drivers\etc
 You'll also have to define the connector in the server.xml file.






 Robert L Sowders [EMAIL PROTECTED]
 09/19/2002 02:48 PM
 Please respond to Tomcat Users List


 To: Tomcat Users List [EMAIL PROTECTED]
 cc:
 Subject:Re: mod_jk2, virtual hosts, JkUriSet

 H,

 looks like you got some funny domains for those VirtualHosts as well as
 some nonstandard JkUriSet statements.  You probably have a problem with
 one or both.

 Others have been successful.
 http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg66171.html

 Make your virtual hosts as fully qualified domains and make your JkUriSet
 commands like the example.  Leave the port selection up to the
 workers2.properties file.

 Regardless of how you do it, after you are successful a nice step by step
 How To would be appreciated by all.

 rls





 Dmitry Letin [EMAIL PROTECTED]
 09/19/2002 01:24 PM
 Please respond to Tomcat Users List


 To: [EMAIL PROTECTED]
 cc:
 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

RE: mod_jk2, virtual hosts, JkUriSet

2002-09-20 Thread Dmitry Letin

Yes, I guess it'll work to use mod_rewrite to map to different contexts in tomcat, but 
it will be limited only to a single tomcat or to a cluster of tomcat instances with 
exactly the same distributable webapps installed on each tomcat in the cluster.

I wonder what developers of jk2 think about this problem.

I have not tried Resin yet.

Dmitry


-Original Message-
From: Matt Sales [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 20, 2002 10:45 AM
To: Tomcat Users List
Subject: Re: mod_jk2, virtual hosts, JkUriSet

Hello all,
I'm having the same problem, and I've been banging my head against it on and
off for about a week with no more success than anyone else...  Essentially,
we're all trying to map the root of different virtual hosts to a different
context within tomcat, right?  I started looking elsewhere and found that
Resin's apache module utilizes the ServerName directive within a
VirtualHost block to select different web apps...  If it's a make-or-break
deal, you might want to look there.  Another workaround possibility that I'm
toying with now is to use mod_rewrite within apache to redirect *.jsp
requests from http://www.vhost1.com to http://www.vhost1.com/vh1/ and map
the /vh1/*.jsp uri to the proper context.  It just seems virtual host
support via mod_jk2 is not possible without duct tape and bubble gum, which
is a shame because the unix socket feature is fantastic...

Ah, for the good old days of JServ/JSSI...


- Original Message -
From: Dmitry Letin [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Thursday, September 19, 2002 6:46 PM
Subject: RE: mod_jk2, virtual hosts, JkUriSet


 Hi Robert,

 In my config files I of course use real domains.
 I did try to use only workers2.properties files for configuration.
 It seems that virtual host part is ignored, so that these are the same
when
 jk2 selects worker:



 # 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:80/*.jsp] - not working as well
 [uri:www.vhost2.com/*.jsp]
 worker=ajp13:localhost:8013


 My problem comes from the fact that the virtual host part in uri seems to
be ignored
 when jk2 selects a worker, and only url path is cheched by jk2 code.
Because that part is the same
 it is dispached to the same tomcat instance.

 I do have proper entries in my /etc/hosts file (I'm on Linux) and I did
try this as well

 [uri:142.54.3.10:80]
 alias=www.vhost1.com:80

 It did not help.

 I promise to write a how-to on this if I manage to solve this problem :-)
 But I have doubts I can solve it :-(


 Dmitry




 -Original Message-
 From: Robert L Sowders [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, September 19, 2002 6:32 PM
 To: Tomcat Users List
 Subject: Re: mod_jk2, virtual hosts, JkUriSet

 Forgot to mention,

 Here's a snip from the default workers2.properties file from the src

 [uri:127.0.0.1:8003]
 info=Example virtual host. Make sure myVirtualHost is in /etc/hosts to
 test it
 alias=myVirtualHost:8003

 On a windows machine the hosts file is in c:\WinNT\system32\drivers\etc
 You'll also have to define the connector in the server.xml file.






 Robert L Sowders [EMAIL PROTECTED]
 09/19/2002 02:48 PM
 Please respond to Tomcat Users List


 To: Tomcat Users List [EMAIL PROTECTED]
 cc:
 Subject:Re: mod_jk2, virtual hosts, JkUriSet

 H,

 looks like you got some funny domains for those VirtualHosts as well as
 some nonstandard JkUriSet statements.  You probably have a problem with
 one or both.

 Others have been successful.
 http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg66171.html

 Make your virtual hosts as fully qualified domains and make your JkUriSet
 commands like the example.  Leave the port selection up to the
 workers2.properties file.

 Regardless of how you do it, after you are successful a nice step by step
 How To would be appreciated by all.

 rls





 Dmitry Letin [EMAIL PROTECTED]
 09/19/2002 01:24 PM
 Please respond to Tomcat Users List


 To: [EMAIL PROTECTED]
 cc:
 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

Re: mod_jk2, virtual hosts, JkUriSet

2002-09-20 Thread Dom

I've downloaded and tried it using SuperSnoop.jsp in one of my virtual host

Funny result : see the attached html doc

With Apache 2.0.40  my compiled mod_jk2.so, the result was ok

Dom
- Original Message -
From: Turner, John [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Friday, September 20, 2002 8:13 PM
Subject: RE: mod_jk2, virtual hosts, JkUriSet



 I highly doubt it makes any difference.  Isn't it worth downloading and
 trying it?  If it works, let me (us) know.

 John

  -Original Message-
  From: Dom [mailto:[EMAIL PROTECTED]]
  Sent: Friday, September 20, 2002 2:08 PM
  To: Tomcat Users List
  Subject: Re: mod_jk2, virtual hosts, JkUriSet
 
 
  Hi John
 
  Your website shows mod_jk2.so for Apache 1.3.26, TC 4.1.10
  and RH 7.2, but
  not RH 7.3 !
 
  Dom
  - Original Message -
  From: Turner, John [EMAIL PROTECTED]
  To: 'Tomcat Users List' [EMAIL PROTECTED]
  Sent: Friday, September 20, 2002 7:37 PM
  Subject: RE: mod_jk2, virtual hosts, JkUriSet
 
 
  
   There's a mod_jk2.so on my website for Apache 1.3.26:
  
   http://www.johnturner.com/howto
  
   I haven't had a chance to test it, so caveat emptor.
  
   John
  

 --
 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]


Re: mod_jk2, virtual hosts, JkUriSet

2002-09-20 Thread Dom

Same tomcat from different virtual hosts in same Apache

httpd.conf :
VirtualHost ixemel.net
...
Location /examples
   JkUriSet worker ajp13
   /Location
/VirtualHost

I also tried :

workers2.properties :

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

# Example socket channel, override port and host.
[channel.socket:localhost:8009]
port=8009
lb_factor=1
group=lb
host=10.0.0.11
disabled=0

# define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009

[uri:/ixemel.net]
info=ixemel.net default context.
group=lb
debug=0

httpd.conf :

 JkUriSet worker lb

Works fine too


Dom
- Original Message -
From: Dmitry Letin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: Dom [EMAIL PROTECTED]
Sent: Friday, September 20, 2002 8:51 PM
Subject: RE: mod_jk2, virtual hosts, JkUriSet


Hi Dom,
did you actually put this verbatim into httpd.conf: JkUriSet worker ajp13?

Do you try to connect to the same tomcat from different virtual hosts
or each virtual host connects to a separate tomcat instance?

Dmitry

-Original Message-
From: Dom [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 20, 2002 1:35 PM
To: Tomcat Users List
Subject: Re: mod_jk2, virtual hosts, JkUriSet

Hi

I'm using JkUriSet statements as in
http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg66171.html
with my RH7.3,  j2sdk1.4.1 fcs, Apache 2.0.40 and TC 4.1.10 with virtual
hosts and they works fine.

By the way, is there a way to compile mod_jk2 for Apache 1.3.26 ? The make
builds the build/jk2/apache13 but not mod_jk2.so : looking for APR libs.

Dom
- Original Message -
From: Robert L Sowders [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Thursday, September 19, 2002 11:48 PM
Subject: Re: mod_jk2, virtual hosts, JkUriSet


 H,

 looks like you got some funny domains for those VirtualHosts as well as
 some nonstandard JkUriSet statements.  You probably have a problem with
 one or both.

 Others have been successful.
 http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg66171.html

 Make your virtual hosts as fully qualified domains and make your JkUriSet
 commands like the example.  Leave the port selection up to the
 workers2.properties file.

 Regardless of how you do it, after you are successful a nice step by step
 How To would be appreciated by all.

 rls





 Dmitry Letin [EMAIL PROTECTED]
 09/19/2002 01:24 PM
 Please respond to Tomcat Users List


 To: [EMAIL PROTECTED]
 cc:
 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]




--
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]




Re: mod_jk2, virtual hosts, JkUriSet

2002-09-20 Thread Dom

Sorry

I had forgoten LoadModule jk2_module ...

But once corrected, I've got

[warn] Loaded DSO libexec/mod_jk2.so uses plain Apache 1.3 API, this module
might crash under EAPI! (please recompile it with -DEAPI)
Create config for main host
Syntax error on line 139 of /usr/local/apache/conf/vhosts.conf:
Invalid command 'JkUriSet', perhaps mis-spelled or defined by a module not
included in the server configuration
/etc/init.d/httpd start: httpd ssl could not be started

Dom

- Original Message -
From: Turner, John [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Friday, September 20, 2002 8:13 PM
Subject: RE: mod_jk2, virtual hosts, JkUriSet



 I highly doubt it makes any difference.  Isn't it worth downloading and
 trying it?  If it works, let me (us) know.

 John

  -Original Message-
  From: Dom [mailto:[EMAIL PROTECTED]]
  Sent: Friday, September 20, 2002 2:08 PM
  To: Tomcat Users List
  Subject: Re: mod_jk2, virtual hosts, JkUriSet
 
 
  Hi John
 
  Your website shows mod_jk2.so for Apache 1.3.26, TC 4.1.10
  and RH 7.2, but
  not RH 7.3 !
 
  Dom
  - Original Message -
  From: Turner, John [EMAIL PROTECTED]
  To: 'Tomcat Users List' [EMAIL PROTECTED]
  Sent: Friday, September 20, 2002 7:37 PM
  Subject: RE: mod_jk2, virtual hosts, JkUriSet
 
 
  
   There's a mod_jk2.so on my website for Apache 1.3.26:
  
   http://www.johnturner.com/howto
  
   I haven't had a chance to test it, so caveat emptor.
  
   John
  

 --
 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]




Re: mod_jk2, virtual hosts, JkUriSet

2002-09-20 Thread Dom

about
httpd.conf :
VirtualHost ixemel.net
...
Location /examples
   JkUriSet worker ajp13
   /Location
/VirtualHost

In my case, it is

VirtualHost ixemel.net
...
Location /examples
   JkUriSet worker ajp13:localhost:8009
   /Location
/VirtualHost

- Original Message -
From: Dom [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Friday, September 20, 2002 11:29 PM
Subject: Re: mod_jk2, virtual hosts, JkUriSet


 Same tomcat from different virtual hosts in same Apache

 httpd.conf :
 VirtualHost ixemel.net
 ...
 Location /examples
JkUriSet worker ajp13
/Location
 /VirtualHost

 I also tried :

 workers2.properties :

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

 # Example socket channel, override port and host.
 [channel.socket:localhost:8009]
 port=8009
 lb_factor=1
 group=lb
 host=10.0.0.11
 disabled=0

 # define the worker
 [ajp13:localhost:8009]
 channel=channel.socket:localhost:8009

 [uri:/ixemel.net]
 info=ixemel.net default context.
 group=lb
 debug=0

 httpd.conf :

  JkUriSet worker lb

 Works fine too


 Dom
 - Original Message -
 From: Dmitry Letin [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Cc: Dom [EMAIL PROTECTED]
 Sent: Friday, September 20, 2002 8:51 PM
 Subject: RE: mod_jk2, virtual hosts, JkUriSet


 Hi Dom,
 did you actually put this verbatim into httpd.conf: JkUriSet worker
ajp13?

 Do you try to connect to the same tomcat from different virtual hosts
 or each virtual host connects to a separate tomcat instance?

 Dmitry

 -Original Message-
 From: Dom [mailto:[EMAIL PROTECTED]]
 Sent: Friday, September 20, 2002 1:35 PM
 To: Tomcat Users List
 Subject: Re: mod_jk2, virtual hosts, JkUriSet

 Hi

 I'm using JkUriSet statements as in
 http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg66171.html
 with my RH7.3,  j2sdk1.4.1 fcs, Apache 2.0.40 and TC 4.1.10 with virtual
 hosts and they works fine.

 By the way, is there a way to compile mod_jk2 for Apache 1.3.26 ? The make
 builds the build/jk2/apache13 but not mod_jk2.so : looking for APR libs.

 Dom
 - Original Message -
 From: Robert L Sowders [EMAIL PROTECTED]
 To: Tomcat Users List [EMAIL PROTECTED]
 Sent: Thursday, September 19, 2002 11:48 PM
 Subject: Re: mod_jk2, virtual hosts, JkUriSet


  H,
 
  looks like you got some funny domains for those VirtualHosts as well as
  some nonstandard JkUriSet statements.  You probably have a problem with
  one or both.
 
  Others have been successful.
  http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg66171.html
 
  Make your virtual hosts as fully qualified domains and make your
JkUriSet
  commands like the example.  Leave the port selection up to the
  workers2.properties file.
 
  Regardless of how you do it, after you are successful a nice step by
step
  How To would be appreciated by all.
 
  rls
 
 
 
 
 
  Dmitry Letin [EMAIL PROTECTED]
  09/19/2002 01:24 PM
  Please respond to Tomcat Users List
 
 
  To: [EMAIL PROTECTED]
  cc:
  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

Re: mod_jk2, virtual hosts, JkUriSet

2002-09-20 Thread Dmitry Letin

I finally found the bug (or whatever it is) that caused problems:
 
in source file jk/native2/server/apache2/mod_jk2.c
in line 680 (I have revision 1.49) that reads:
 
uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,r-uri);
 
NULL should be replaced to r-server-server_hostname (without the quotes of 
course)
 
This NULL - was the reason for invalid handling of virtual hosts.
I have not tested this a lot yet, but virtual hosts are dispached properly now :-) :-)
 
This fix is for apache2 only.
I actually typed manually the stuff above - could not do copy/paste - hope I made no 
typos
 
Recompile mod_jk2.so after this change - and all works
 
Dmitry
 
 

 

Hello all, 
I'm having the same problem, and I've been banging my head against it on and 
off for about a week with no more success than anyone else...  Essentially, 
we're all trying to map the root of different virtual hosts to a different 
context within tomcat, right?  I started looking elsewhere and found that 
Resin's apache module utilizes the ServerName directive within a 
VirtualHost block to select different web apps...  If it's a make-or-break 
deal, you might want to look there.  Another workaround possibility that I'm 
toying with now is to use mod_rewrite within apache to redirect *.jsp 
requests from http://www.vhost1.com to http://www.vhost1.com/vh1/ and map 
the /vh1/*.jsp uri to the proper context.  It just seems virtual host 
support via mod_jk2 is not possible without duct tape and bubble gum, which 
is a shame because the unix socket feature is fantastic... 

Ah, for the good old days of JServ/JSSI... 


- Original Message - 
From: Dmitry Letin [EMAIL PROTECTED] 
To: Tomcat Users List [EMAIL PROTECTED] 
Sent: Thursday, September 19, 2002 6:46 PM 
Subject: RE: mod_jk2, virtual hosts, JkUriSet 


 Hi Robert, 
 
 In my config files I of course use real domains. 
 I did try to use only workers2.properties files for configuration. 
 It seems that virtual host part is ignored, so that these are the same 
when 
 jk2 selects worker: 
 
 
 
 # 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:80/*.jsp] - not working as well 
 [uri:www.vhost2.com/*.jsp] 
 worker=ajp13:localhost:8013 
 
 
 My problem comes from the fact that the virtual host part in uri seems to 
be ignored 
 when jk2 selects a worker, and only url path is cheched by jk2 code. 
Because that part is the same 
 it is dispached to the same tomcat instance. 
 
 I do have proper entries in my /etc/hosts file (I'm on Linux) and I did 
try this as well 
 
 [uri:142.54.3.10:80] 
 alias=www.vhost1.com:80 
 
 It did not help. 
 
 I promise to write a how-to on this if I manage to solve this problem :-) 
 But I have doubts I can solve it :-( 
 
 
 Dmitry 
 
 
 
 
 -Original Message- 
 From: Robert L Sowders [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, September 19, 2002 6:32 PM 
 To: Tomcat Users List 
 Subject: Re: mod_jk2, virtual hosts, JkUriSet 
 
 Forgot to mention, 
 
 Here's a snip from the default workers2.properties file from the src 
 
 [uri:127.0.0.1:8003] 
 info=Example virtual host. Make sure myVirtualHost is in /etc/hosts to 
 test it 
 alias=myVirtualHost:8003 
 
 On a windows machine the hosts file is in c:\WinNT\system32\drivers\etc 
 You'll also have to define the connector in the server.xml file. 
 
 
 
 
 
 
 Robert L Sowders [EMAIL PROTECTED] 
 09/19/2002 02:48 PM 
 Please respond to Tomcat Users List 
 
 
 To: Tomcat Users List [EMAIL PROTECTED] 
 cc: 
 Subject:Re: mod_jk2, virtual hosts, JkUriSet 
 
 H, 
 
 looks like you got some funny domains for those VirtualHosts as well as 
 some nonstandard JkUriSet statements.  You probably have a problem with 
 one or both. 
 
 Others have been successful. 
 http://www.mail-archive.com/tomcat-user@jakarta.apache.org

Re: mod_jk2, virtual hosts, JkUriSet

2002-09-20 Thread Atif Shahab


I just set jk2 + apache2 + tomcat4 + virtualhosts using unixsockets

*** httpd.conf

VirtualHost xxx.xxx.xxx.xxx
  ServerAdmin [EMAIL PROTECTED]
  DocumentRoot /document/root/htdocs
  ServerName virtualhost1.mycompany.com
  ErrorLog /document/root/logs/error_log
  CustomLog /document/rootlogs/access_log common
  ScriptAlias /cgi-bin/ /document/root/cgi-bin/
  Location /jsp
 JKUriSet worker ajp13:unixsocket
  /Location
/VirtualHost

## This allows me to have both cgi's and jsp's for a virtualhost

** workers2.properties

[shm]
file=/path/to/shm.file
size=1048576

# Example unixsocket channel.
[channel.un:unixsocket]
file=/path/to/jk2.socket

# define the worker
[ajp13:unixsocket]
channel=channel.un:unixsocket

[status:status]

# Uri mapping
[uri:/examples/*]
worker=ajp13:unixsocket

[uri:/jsp/*]
worker=ajp13:unixsocket

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

** server.xml

  Host className=org.apache.catalina.core.StandardHost
appBase=/path/to/jsp autoDeploy=true
configClass=org.apache.catalina.startup.ContextConfig
contextClass=org.apache.catalina.core.StandardContext debug=0
deployXML=true
errorReportValveClass=org.apache.catalina.valves.ErrorReportValve
liveDeploy=true
mapperClass=org.apache.catalina.core.StandardHostMapper
name=virtualhost1.mycompany.com unpackWARs=false
Context className=org.apache.catalina.core.StandardContext
cachingAllowed=true
charsetMapperClass=org.apache.catalina.util.CharsetMapper cookies=true
crossContext=false debug=0 docBase=/path/to/jsp
mapperClass=org.apache.catalina.core.StandardContextMapper path=/jsp
privileged=false reloadable=false swallowOutput=false
useNaming=true wrapperClass=org.apache.catalina.core.StandardWrapper
  Logger className=org.apache.catalina.logger.FileLogger
debug=0 directory=logs prefix=virtualhost1_log. suffix=.txt
timestamp=true verbosity=1/
/Context

  /Host


My virtual hosting seems to be working.  I'm struggling with deploying
oreilly's cos.jar.  I've placed the jar files in all possible places but
it seems that tomcat is unable to find it at the time of compilation.
Unjarring the file and placing the class files in
/path/to/jsp/WEB-INF/classes doesn't help either.  And log files aren't
exactly that helpful.

On Fri, 20 Sep 2002, Dmitry Letin wrote:

 I finally found the bug (or whatever it is) that caused problems:

 in source file jk/native2/server/apache2/mod_jk2.c
 in line 680 (I have revision 1.49) that reads:

 uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,r-uri);

 NULL should be replaced to r-server-server_hostname (without the quotes of 
course)

 This NULL - was the reason for invalid handling of virtual hosts.
 I have not tested this a lot yet, but virtual hosts are dispached properly now :-) 
:-)

 This fix is for apache2 only.
 I actually typed manually the stuff above - could not do copy/paste - hope I made no 
typos

 Recompile mod_jk2.so after this change - and all works

 Dmitry





   Hello all,
   I'm having the same problem, and I've been banging my head against it on and
   off for about a week with no more success than anyone else...  Essentially,
   we're all trying to map the root of different virtual hosts to a different
   context within tomcat, right?  I started looking elsewhere and found that
   Resin's apache module utilizes the ServerName directive within a
   VirtualHost block to select different web apps...  If it's a make-or-break
   deal, you might want to look there.  Another workaround possibility that I'm
   toying with now is to use mod_rewrite within apache to redirect *.jsp
   requests from http://www.vhost1.com to http://www.vhost1.com/vh1/ and map
   the /vh1/*.jsp uri to the proper context.  It just seems virtual host
   support via mod_jk2 is not possible without duct tape and bubble gum, which
   is a shame because the unix socket feature is fantastic...

   Ah, for the good old days of JServ/JSSI...


   - Original Message -
   From: Dmitry Letin [EMAIL PROTECTED]
   To: Tomcat Users List [EMAIL PROTECTED]
   Sent: Thursday, September 19, 2002 6:46 PM
   Subject: RE: mod_jk2, virtual hosts, JkUriSet


Hi Robert,
   
In my config files I of course use real domains.
I did try to use only workers2.properties files for configuration.
It seems that virtual host part is ignored, so that these are the same
   when
jk2 selects worker:
   
   
   
# 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:80/*.jsp] - not working as well
[uri:www.vhost2.com/*.jsp]
worker=ajp13:localhost:8013
   
   
My problem comes from the fact that the virtual host

FW: mod_jk2, virtual hosts, JkUriSet

2002-09-20 Thread Short, Dave

 Mod_jk2.zip 
 

-Original Message-
From: Short, Dave
To: 'Dmitry Letin '
Sent: 9/21/02 12:56 AM
Subject: RE: mod_jk2, virtual hosts, JkUriSet


I have not tried Dmitry's change yet, but attached is the W2K, Tomcat
4.1.10 and Apache 2.0.40 version (compiled tonight 09/20/2002).  For
those on the other side of the world, give it a try.  I'll do the same
tomorrow.

-Original Message-
From: Dmitry Letin
To: Tomcat Users List
Sent: 9/20/02 9:43 PM
Subject: Re: mod_jk2, virtual hosts, JkUriSet

I finally found the bug (or whatever it is) that caused problems:
 
in source file jk/native2/server/apache2/mod_jk2.c
in line 680 (I have revision 1.49) that reads:
 
uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,r-uri);
 
NULL should be replaced to r-server-server_hostname (without the
quotes of course)
 
This NULL - was the reason for invalid handling of virtual hosts.
I have not tested this a lot yet, but virtual hosts are dispached
properly now :-) :-)
 
This fix is for apache2 only.
I actually typed manually the stuff above - could not do copy/paste -
hope I made no typos
 
Recompile mod_jk2.so after this change - and all works
 
Dmitry
 
 

 

Hello all, 
I'm having the same problem, and I've been banging my head against it on
and 
off for about a week with no more success than anyone else...
Essentially, 
we're all trying to map the root of different virtual hosts to a
different 
context within tomcat, right?  I started looking elsewhere and found
that 
Resin's apache module utilizes the ServerName directive within a 
VirtualHost block to select different web apps...  If it's a
make-or-break 
deal, you might want to look there.  Another workaround possibility that
I'm 
toying with now is to use mod_rewrite within apache to redirect *.jsp 
requests from http://www.vhost1.com http://www.vhost1.com  to
http://www.vhost1.com/vh1/ http://www.vhost1.com/vh1/  and map 
the /vh1/*.jsp uri to the proper context.  It just seems virtual host 
support via mod_jk2 is not possible without duct tape and bubble gum,
which 
is a shame because the unix socket feature is fantastic... 

Ah, for the good old days of JServ/JSSI... 


- Original Message - 
From: Dmitry Letin [EMAIL PROTECTED] 
To: Tomcat Users List [EMAIL PROTECTED] 
Sent: Thursday, September 19, 2002 6:46 PM 
Subject: RE: mod_jk2, virtual hosts, JkUriSet 


 Hi Robert, 
 
 In my config files I of course use real domains. 
 I did try to use only workers2.properties files for configuration. 
 It seems that virtual host part is ignored, so that these are the same

when 
 jk2 selects worker: 
 
 
 
 # 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:80/*.jsp] - not working as well 
 [uri:www.vhost2.com/*.jsp] 
 worker=ajp13:localhost:8013 
 
 
 My problem comes from the fact that the virtual host part in uri seems
to 
be ignored 
 when jk2 selects a worker, and only url path is cheched by jk2 code. 
Because that part is the same 
 it is dispached to the same tomcat instance. 
 
 I do have proper entries in my /etc/hosts file (I'm on Linux) and I
did 
try this as well 
 
 [uri:142.54.3.10:80] 
 alias=www.vhost1.com:80 
 
 It did not help. 
 
 I promise to write a how-to on this if I manage to solve this problem
:-) 
 But I have doubts I can solve it :-( 
 
 
 Dmitry 
 
 
 
 
 -Original Message- 
 From: Robert L Sowders [mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] ] 
 Sent: Thursday, September 19, 2002 6:32 PM 
 To: Tomcat Users List 
 Subject: Re: mod_jk2, virtual hosts, JkUriSet 
 
 Forgot to mention, 
 
 Here's a snip from the default workers2.properties file from the src 
 
 [uri:127.0.0.1:8003] 
 info=Example virtual host. Make sure myVirtualHost is in /etc/hosts to

 test it 
 alias=myVirtualHost:8003 
 
 On a windows machine the hosts file is in
c:\WinNT\system32\drivers\etc 
 You'll also have to define the connector in the server.xml file. 
 
 
 
 
 
 
 Robert L Sowders [EMAIL PROTECTED] 
 09/19/2002 02:48 PM 
 Please respond to Tomcat Users List 
 
 
 To: Tomcat Users List [EMAIL PROTECTED] 
 cc: 
 Subject:Re: mod_jk2, virtual hosts, JkUriSet 
 
 H, 
 
 looks like you got some funny domains for those VirtualHosts as well
as 
 some nonstandard JkUriSet statements.  You probably have a problem
with 
 one or both. 
 
 Others have been successful. 

http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg66171.html
http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg66171.htm
l  
 
 Make your virtual hosts as fully qualified domains and make your
JkUriSet 
 commands like the example.  Leave the port selection up to the 
 workers2.properties file. 
 
 Regardless of how you do it, after you are successful a nice step by
step 
 How To would be appreciated by all

Re: mod_jk2, virtual hosts, JkUriSet

2002-09-20 Thread Robert L Sowders

Hello,

I'm glad you got it working.  Have you posted a bug at 
http://www.mail-archive.com/tomcat-dev%40jakarta.apache.org/ I'm sure the 
developers of JK2 would be interested in your patch?

You might have already, their web site has not been updating for awhile 
now.

rls




Dmitry Letin [EMAIL PROTECTED]
09/20/2002 06:43 PM
Please respond to Tomcat Users List

 
To: Tomcat Users List [EMAIL PROTECTED]
cc: 
Subject:Re: mod_jk2, virtual hosts, JkUriSet

I finally found the bug (or whatever it is) that caused problems:
 
in source file jk/native2/server/apache2/mod_jk2.c
in line 680 (I have revision 1.49) that reads:
 
uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,r-uri);
 
NULL should be replaced to r-server-server_hostname (without the 
quotes of course)
 
This NULL - was the reason for invalid handling of virtual hosts.
I have not tested this a lot yet, but virtual hosts are dispached properly 
now :-) :-)
 
This fix is for apache2 only.
I actually typed manually the stuff above - could not do copy/paste - hope 
I made no typos
 
Recompile mod_jk2.so after this change - and all works
 
Dmitry
 
 

 

 Hello all, 
 I'm having the same problem, and I've been banging my 
head against it on and 
 off for about a week with no more success than anyone 
else...  Essentially, 
 we're all trying to map the root of different virtual 
hosts to a different 
 context within tomcat, right?  I started looking 
elsewhere and found that 
 Resin's apache module utilizes the ServerName directive 
within a 
 VirtualHost block to select different web apps...  If 
it's a make-or-break 
 deal, you might want to look there.  Another workaround 
possibility that I'm 
 toying with now is to use mod_rewrite within apache to 
redirect *.jsp 
 requests from http://www.vhost1.com to http://www.vhost1.com/vh1/ and 
map 
 the /vh1/*.jsp uri to the proper context.  It just seems 
virtual host 
 support via mod_jk2 is not possible without duct tape and 
bubble gum, which 
 is a shame because the unix socket feature is 
fantastic... 

 Ah, for the good old days of JServ/JSSI... 


 - Original Message - 
 From: Dmitry Letin [EMAIL PROTECTED] 
 To: Tomcat Users List [EMAIL PROTECTED] 
 Sent: Thursday, September 19, 2002 6:46 PM 
 Subject: RE: mod_jk2, virtual hosts, JkUriSet 


  Hi Robert, 
  
  In my config files I of course use real domains. 
  I did try to use only workers2.properties files for 
configuration. 
  It seems that virtual host part is ignored, so that 
these are the same 
 when 
  jk2 selects worker: 
  
  
  
  # 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:80/*.jsp] - not working as well 
  [uri:www.vhost2.com/*.jsp] 
  worker=ajp13:localhost:8013 
  
  
  My problem comes from the fact that the virtual host 
part in uri seems to 
 be ignored 
  when jk2 selects a worker, and only url path is cheched 
by jk2 code. 
 Because that part is the same 
  it is dispached to the same tomcat instance. 
  
  I do have proper entries in my /etc/hosts file (I'm on 
Linux) and I did 
 try this as well 
  
  [uri:142.54.3.10:80] 
  alias=www.vhost1.com:80 
  
  It did not help. 
  
  I promise to write a how-to on this if I manage to 
solve this problem :-) 
  But I have doubts I can solve it :-( 
  
  
  Dmitry 
  
  
  
  
  -Original Message- 
  From: Robert L Sowders [mailto:[EMAIL PROTECTED]] 
  Sent: Thursday, September 19, 2002 6:32 PM 
  To: Tomcat Users List 
  Subject: Re: mod_jk2, virtual hosts, JkUriSet 
  
  Forgot to mention, 
  
  Here's a snip from the default workers2.properties file 
from the src

mod_jk2, virtual hosts, JkUriSet

2002-09-19 Thread Dmitry Letin

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]




RE: mod_jk2, virtual hosts, JkUriSet

2002-09-19 Thread Short, Dave

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]




Re: mod_jk2, virtual hosts, JkUriSet

2002-09-19 Thread Robert L Sowders

H,

looks like you got some funny domains for those VirtualHosts as well as 
some nonstandard JkUriSet statements.  You probably have a problem with 
one or both.

Others have been successful. 
http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg66171.html

Make your virtual hosts as fully qualified domains and make your JkUriSet 
commands like the example.  Leave the port selection up to the 
workers2.properties file.

Regardless of how you do it, after you are successful a nice step by step 
How To would be appreciated by all.

rls





Dmitry Letin [EMAIL PROTECTED]
09/19/2002 01:24 PM
Please respond to Tomcat Users List

 
To: [EMAIL PROTECTED]
cc: 
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]




RE: mod_jk2, virtual hosts, JkUriSet

2002-09-19 Thread Dmitry Letin

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=2
   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=2
   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

RE: mod_jk2, virtual hosts, JkUriSet

2002-09-19 Thread Dmitry Letin

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=2
   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=2
   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

Re: mod_jk2, virtual hosts, JkUriSet

2002-09-19 Thread Robert L Sowders

Forgot to mention,

Here's a snip from the default workers2.properties file from the src

[uri:127.0.0.1:8003]
info=Example virtual host. Make sure myVirtualHost is in /etc/hosts to 
test it
alias=myVirtualHost:8003

On a windows machine the hosts file is in c:\WinNT\system32\drivers\etc
You'll also have to define the connector in the server.xml file.






Robert L Sowders [EMAIL PROTECTED]
09/19/2002 02:48 PM
Please respond to Tomcat Users List

 
To: Tomcat Users List [EMAIL PROTECTED]
cc: 
Subject:Re: mod_jk2, virtual hosts, JkUriSet

H,

looks like you got some funny domains for those VirtualHosts as well as 
some nonstandard JkUriSet statements.  You probably have a problem with 
one or both.

Others have been successful. 
http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg66171.html

Make your virtual hosts as fully qualified domains and make your JkUriSet 
commands like the example.  Leave the port selection up to the 
workers2.properties file.

Regardless of how you do it, after you are successful a nice step by step 
How To would be appreciated by all.

rls





Dmitry Letin [EMAIL PROTECTED]
09/19/2002 01:24 PM
Please respond to Tomcat Users List

 
To: [EMAIL PROTECTED]
cc: 
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]





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




RE: mod_jk2, virtual hosts, JkUriSet

2002-09-19 Thread Short, Dave

Thanks, I'll give it a try and report back.

-Original Message-
From: Dmitry Letin [mailto:[EMAIL PROTECTED]]
Sent: September 19, 2002 3:31 PM
To: Tomcat Users List
Subject: RE: mod_jk2, virtual hosts, JkUriSet


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=2
   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=2
   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

RE: mod_jk2, virtual hosts, JkUriSet

2002-09-19 Thread Dmitry Letin

Hi Robert,

In my config files I of course use real domains.
I did try to use only workers2.properties files for configuration.
It seems that virtual host part is ignored, so that these are the same when
jk2 selects worker:



# 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:80/*.jsp] - not working as well
[uri:www.vhost2.com/*.jsp]
worker=ajp13:localhost:8013


My problem comes from the fact that the virtual host part in uri seems to be ignored
when jk2 selects a worker, and only url path is cheched by jk2 code. Because that part 
is the same
it is dispached to the same tomcat instance.

I do have proper entries in my /etc/hosts file (I'm on Linux) and I did try this as 
well

[uri:142.54.3.10:80]
alias=www.vhost1.com:80

It did not help.

I promise to write a how-to on this if I manage to solve this problem :-)
But I have doubts I can solve it :-(


Dmitry




-Original Message-
From: Robert L Sowders [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 19, 2002 6:32 PM
To: Tomcat Users List
Subject: Re: mod_jk2, virtual hosts, JkUriSet

Forgot to mention,

Here's a snip from the default workers2.properties file from the src

[uri:127.0.0.1:8003]
info=Example virtual host. Make sure myVirtualHost is in /etc/hosts to
test it
alias=myVirtualHost:8003

On a windows machine the hosts file is in c:\WinNT\system32\drivers\etc
You'll also have to define the connector in the server.xml file.






Robert L Sowders [EMAIL PROTECTED]
09/19/2002 02:48 PM
Please respond to Tomcat Users List


To: Tomcat Users List [EMAIL PROTECTED]
cc:
Subject:Re: mod_jk2, virtual hosts, JkUriSet

H,

looks like you got some funny domains for those VirtualHosts as well as
some nonstandard JkUriSet statements.  You probably have a problem with
one or both.

Others have been successful.
http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg66171.html

Make your virtual hosts as fully qualified domains and make your JkUriSet
commands like the example.  Leave the port selection up to the
workers2.properties file.

Regardless of how you do it, after you are successful a nice step by step
How To would be appreciated by all.

rls





Dmitry Letin [EMAIL PROTECTED]
09/19/2002 01:24 PM
Please respond to Tomcat Users List


To: [EMAIL PROTECTED]
cc:
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]





--
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]