Re: graceful setting in workers2.properties

2003-10-15 Thread Klaus Wienert
Try to disable the channel by setting disabled to 1. Then you could
gracefully switch the the sessions from one tomcat to the other. At jkstatus
you could see, that gracefull will be enabled.


Klaus

[channel.socket:localhost:7010]
info=Ajp13 forwarding over socket
tomcatId=jvm2
lb_factor=1
group=lb
debug=3
graceful=1
disabled=1

- Original Message - 
From: "Kelly Kleinfelder" <[EMAIL PROTECTED]>
To: "'Tomcat Users List'" <[EMAIL PROTECTED]>
Sent: Tuesday, October 14, 2003 7:51 PM
Subject: graceful setting in workers2.properties


> I'm using Tomcat 4.1.27 and Apache 2.0.47 built with the worker mpm and
> mod_jk2 build from the 2.0.2 connectors source.
>
> I'm trying to use the graceful setting in workers2.properties to take one
of
> the workers out of service, but it doesn't seem to be working. I'm not
sure
> if the lb_value should be changing to reflect the use of graceful, but
it's
> my suspicion that this is part of the problem.
>
> Thanks,
> Kelly
>
> Here's the output from my jkstatus:
>
>   id name lb_factor lb_value route errorState graceful epCount
errorTime
>   2 localhost:7009 10 10 jvm1 N N 0 0
>   3 localhost:7010 1 1 jvm2 N N 0 0
>
>
> Here's my workers2.properties:
>
> [logger]
> level=DEBUG
>
> [config:]
> file=${serverRoot}/conf/workers2.properties
> debug=0
> debugEnv=0
>
> [uriMap:]
> info=Maps the requests. Options: debug
> debug=0
>
> Alternate file logger
> [logger.file:0]
> level=DEBUG
> file=${serverRoot}/logs/jk2.log
>
> [shm:]
> info=Scoreboard. Required for reconfiguration and status with multiprocess
> serve
> rs
> file=${serverRoot}/logs/jk2.shm
> size=100
> debug=0
> disabled=0
>
> [workerEnv:]
> info=Global server options
> timing=1
> debug=0
> # Default Native Logger (apache2 or win32 )
> # can be overriden to a file logger, useful
> # when tracing win32 related issues
> #logger=logger.file:0
>
> [lb:lb]
> info=Default load balancer.
> debug=3
> stickySession=1
>
> [lb:lb_1]
> info=A second load balancer.
> debug=0
>
> [channel.socket:localhost:7009]
> info=Ajp13 forwarding over socket
> tomcatId=jvm1
> lb_factor=10
> group=lb
> debug=3
>
> [channel.socket:localhost:7010]
> info=Ajp13 forwarding over socket
> tomcatId=jvm2
> lb_factor=1
> group=lb
> debug=3
> graceful=1
>
> [channel.jni:jni]
> info=The jni channel, used if tomcat is started inprocess
>
> [status:]
> info=Status worker, displays runtime informations
>
> [uri:/examples]
> info=Example webapp in the default context.
> context=/examples
> debug=0
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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



Re: shared memory problem in Tomcat 4.1.24/Apache 2.0.47/mod_jk2 connection

2003-10-22 Thread Klaus Wienert
Try the following:

# workers2.properties
[shm]
file=/var/log/httpd/jk2.shm
size=1048576

[channel.socket:localhost:8009]
tomcatId=tomcat1

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

[status:status]

[uri:/examples/*]
group=ajp13:localhost:8009

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

--

# jk2.properties
# no entries here

--

In server.xml add jvmRoute in Engine-Tag like this:





Klaus

- Original Message - 
From: "Mario Juric" <[EMAIL PROTECTED]>
To: "Tomcat User" <[EMAIL PROTECTED]>
Sent: Wednesday, October 22, 2003 8:20 AM
Subject: shared memory problem in Tomcat 4.1.24/Apache 2.0.47/mod_jk2
connection


> I need some help in solving the following problem.
>
>
>
> I am trying to establish a simple Tomcat 4.1.24/Apache 2.0.47/mod_jk2
> connection using the standard Tomcat examples webapp. The browser waits
> forever when I try to access http://localhost/examples/. I also get the
the
> following errors two times in my /var/lo/httpd/error_log:
>
>
>
> [error] jk2_init() Can't find child XXX in scoreboard
>
> [error] mod_jk child init 1 -2
>
>
>
> Similar problem descriptions I found in the Tomcat User mailing archive
> indicate that this may have something to do with the shared memory file
> (shm). I have setup up read/write permission for this file.
>
>
>
> Note that http://localhost/ (Apache default page) and
> http://localhost:8009/examples/ (Tomcat examples) work as expected.
>
>
>
> My OS is Mandrake Linux 9.1 and I use the following setup files:
>
>
>
> # workers2.properties
>
>
>
> [shm]
>
> file=/var/log/httpd/jk2.shm
>
> size=1048576
>
>
>
> [channel.socket:localhost:8009]
>
> tomcatId=localhost:8009
>
> port=8009
>
> host=127.0.0.1
>
>
>
> [ajp13:localhost:8009]
>
> channel=channel.socket:localhost:8009
>
>
>
> [uri:/examples/*]
>
> worker=ajp13:localhost:8009
>
>
>
> # jk2.properties
>
>
>
> handler.list=request,container,channelSocket
>
>
>
> channelSocket.port=8009
>
>
>
> shm.file=/var/log/httpd/jk2.shm
>
>


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



Re: shared memory problem in Tomcat 4.1.24/Apache 2.0.47/mod_jk2 connection

2003-10-23 Thread Klaus Wienert
I could not find any mistake. It should work fine.

The connection is not in errorState and the scoreBoard seems to work.

Sorry, no idea


Klaus

- Original Message - 
From: "Mario Juric" <[EMAIL PROTECTED]>
To: "'Tomcat Users List'" <[EMAIL PROTECTED]>
Sent: Thursday, October 23, 2003 9:04 AM
Subject: RE: shared memory problem in Tomcat 4.1.24/Apache 2.0.47/mod_jk2
connection


Sorry,

It looks as if html attachements are not accepted by the list server. I try
to attach it as a zip-file.


-Original Message-
From: Mario Juric [mailto:[EMAIL PROTECTED]
Sent: 23. oktober 2003 08:59
To: 'Tomcat Users List'
Subject: RE: shared memory problem in Tomcat 4.1.24/Apache 2.0.47/mod_jk2
connection

I still have the same problem. This time I attached the status HTML page. It
may provide a clue to the source of the problem. I thank you for the help.

Cheers
Mario

-Original Message-
From: Klaus Wienert [mailto:[EMAIL PROTECTED]
Sent: 22. oktober 2003 18:18
To: Tomcat Users List
Cc: [EMAIL PROTECTED]
Subject: Re: shared memory problem in Tomcat 4.1.24/Apache 2.0.47/mod_jk2
connection

Try the following:

# workers2.properties
[shm]
file=/var/log/httpd/jk2.shm
size=1048576

[channel.socket:localhost:8009]
tomcatId=tomcat1

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

[status:status]

[uri:/examples/*]
group=ajp13:localhost:8009

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

--

# jk2.properties
# no entries here

--

In server.xml add jvmRoute in Engine-Tag like this:





Klaus

- Original Message - 
From: "Mario Juric" <[EMAIL PROTECTED]>
To: "Tomcat User" <[EMAIL PROTECTED]>
Sent: Wednesday, October 22, 2003 8:20 AM
Subject: shared memory problem in Tomcat 4.1.24/Apache 2.0.47/mod_jk2
connection


> I need some help in solving the following problem.
>
>
>
> I am trying to establish a simple Tomcat 4.1.24/Apache 2.0.47/mod_jk2
> connection using the standard Tomcat examples webapp. The browser waits
> forever when I try to access http://localhost/examples/. I also get the
the
> following errors two times in my /var/lo/httpd/error_log:
>
>
>
> [error] jk2_init() Can't find child XXX in scoreboard
>
> [error] mod_jk child init 1 -2
>
>
>
> Similar problem descriptions I found in the Tomcat User mailing archive
> indicate that this may have something to do with the shared memory file
> (shm). I have setup up read/write permission for this file.
>
>
>
> Note that http://localhost/ (Apache default page) and
> http://localhost:8009/examples/ (Tomcat examples) work as expected.
>
>
>
> My OS is Mandrake Linux 9.1 and I use the following setup files:
>
>
>
> # workers2.properties
>
>
>
> [shm]
>
> file=/var/log/httpd/jk2.shm
>
> size=1048576
>
>
>
> [channel.socket:localhost:8009]
>
> tomcatId=localhost:8009
>
> port=8009
>
> host=127.0.0.1
>
>
>
> [ajp13:localhost:8009]
>
> channel=channel.socket:localhost:8009
>
>
>
> [uri:/examples/*]
>
> worker=ajp13:localhost:8009
>
>
>
> # jk2.properties
>
>
>
> handler.list=request,container,channelSocket
>
>
>
> channelSocket.port=8009
>
>
>
> shm.file=/var/log/httpd/jk2.shm
>
>


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








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


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



Re: Session affinity doesn't work

2003-10-25 Thread Klaus Wienert
add tomcatId to the channles

# tomcat1
[channel.socket:localhost:11009]
port=11009
host=localhost
type=ajp13
lb_factor=100
tomcatId=tomcat1

# tomcat2
[channel.socket:localhost:12009]
port=12009
host=localhost
type=ajp13
lb_factor=100
tomcatId=tomcat2


and modify jvmRoute for tomcat2 to

   


Klaus

- Original Message - 
From: "Dinh Nguyen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, October 25, 2003 7:00 AM
Subject: Session affinity doesn't work


Hi all,
I have downloaded these following packages and installed them on my
machine (Win 2K):
Apache 2.0.47
Tomcat 2.0.47
Jk2_mod connector 2.0.43.

I have 2 instances of tomcat (tomcat1, tomcat2 on the same host) on my
machine on a load balancing environment. The load balancing works well
with one exception: the session affinity doesn't work as expected.
Everytime I refresh my browser, it gives me a different session id. If
anyone experimented this problem, please help me.
These are my settings and modifications to apache and tomcat.

Apache httpd.conf
==
LoadModule jk2_module modules/mod_jk2.dll
==


Apache workers2.properties (entire content)
==
[logger]
level=DEBUG

[config:]
#file=${serverRoot}/conf/workers2.properties
#file=c:/Apache2/conf/workers2.properties
file=conf/workers2.properties
debug=0
debugEnv=0


[shm:]
info=Scoreboard. Required for reconfiguration and status with
multiprocess servers
#file=${serverRoot}/logs/jk2.shm
file=logs/jk2.shm
size=100
debug=0
disabled=0

[workerEnv:]
info=Global server options
timing=1
debug=0
# Default Native Logger (apache2 or win32 )
# can be overriden to a file logger, useful
# when tracing win32 related issues
#logger=logger.file:0

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

# tomcat1
[channel.socket:localhost:11009]
port=11009
host=localhost
type=ajp13
lb_factor=100

# tomcat2
[channel.socket:localhost:12009]
port=12009
host=localhost
type=ajp13
lb_factor=100

[uri:/jkstatus/*]
info=Display status information and checks the config file for changes.
#group=status:

[uri:/*.jsp]
info=Extension mapping
==


Tomcat1 server.xml
==
1. Comment out Coyote HTTP/1.1 Connector at port 8080
2. Change  to 
3. Change 
   to
   
(notice: I DID rename the misspelling from jmvRoute to jvmRoute in the
orginal release)

4. Change Coyote/JK2 AJP 1.3 Connector to listen at 11009
5. No change for jk2.properties
==


Tomcat2 server.xml
==
The same with Tomcat1, but with different port numbers (12005 for
server, 12009 for Coyote/JK2 AJP 1.3 Connector)
==

At the ROOT directory of each tomcat instance, I create a jsp file with
a single command "request.getSession().getId()"

Then I start tomcat1, tomcat2, apache (in order). Everything is OK. No
error reported on the screen.

The only bad thing is that with every request, this page returns a
different session id (they are suffixed with .tomcat1 and .tomcat2), if
the session affinity works correctly, they must be the same, right? Is
there anything wrong with my configuration?

If anyone have solution, please share it to me. I appreciate it.

Dinh.





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

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



Re: Session affinity doesn't work

2003-10-27 Thread Klaus Wienert
I post my working configuration set:

For every Tomcat I added a jvmRoute like this:



And this is my workers2.properties:

## Define the shared memory file
[shm]
ver=1
info=Scoreboard. Required for reconfiguration and status with multiprocess
servers
disabled=0
file=${serverRoot}/logs/jk2.shm
size=100

## Define the communication channels
[channel.socket:localhost:9009]
ver=34
graceful=1
disabled=0
tomcatId=apps1
lb_factor=10

[channel.socket:apps2.domain1.tld:9009]
ver=35
graceful=1
disabled=0
tomcatId=apps2
lb_factor=10

[channel.socket:apps3.domain2.tld:9009]
ver=39
graceful=1
disabled=0
tomcatId=apps3
lb_factor=20

[channel.socket:apps4.domain2.tld:9009]
ver=7
graceful=1
disabled=0
tomcatId=apps4
lb_factor=20

## Define workers
# Define AJP13 workers
[ajp13:localhost:9009]
ver=2
disabled=0
info=apps1 - local
channel=channel.socket:localhost:9009
group=lb1

[ajp13:apps2.domain1.tld:9009]
ver=4
disabled=0
info=apps2 - remote
channel=channel.socket:apps2.domain1.tld:9009
group=lb1

[ajp13:apps3.domain2.tld:9009]
ver=4
disabled=0
info=apps3 - remote
channel=channel.socket:apps3.domain2.tld:9009
group=lb1

[ajp13:apps4.domain2.tld:9009]
ver=4
disabled=0
info=apps4 - remote
channel=channel.socket:apps4.domain2.tld:9009
group=lb1

# Define Load Balancer worker
[lb:lb1]
ver=2
disabled=0
info=First load balancer

# Define Load Balancer worker
[lb:lb2]
ver=2
disabled=0
info=Second load balancer
worker=ajp13:localhost:9009
worker=ajp13:apps2.domain1.tld:9009

# Define Status worker
[status:status]
ver=2
disabled=0

## Define mappings
[uri:/xyz1/*]
ver=4
disabled=0
group=lb1
#group=ajp13:localhost:9009

[uri:/xyz2/*]
ver=6
disabled=0
group=lb1
#group=ajp13:localhost:9009

[uri:/xyz3/*]
ver=2
disabled=0
group=ajp13:localhost:9009

[uri:/xyz4/*]
ver=4
disabled=0
#group=ajp13:localhost:9009
group=lb2

[uri:/jkstatus/*]
ver=2
disabled=0
info=Display status information and checks the config file for changes.
group=status:status




Thats all


Klaus


- Original Message - 
From: "Dinh Nguyen" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Monday, October 27, 2003 2:55 AM
Subject: RE: Session affinity doesn't work


This is my workers2.properties. I attached it to my last mail but the
mail server removed it. Sorry for that.

==
[logger]
level=DEBUG

[config:]
#file=${serverRoot}/conf/workers2.properties
#file=c:/Apache2/conf/workers2.properties
file=conf/workers2.properties
debug=0
debugEnv=0


[shm:]
info=Scoreboard. Required for reconfiguration and status with
multiprocess servers
#file=${serverRoot}/logs/jk2.shm
file=logs/jk2.shm
size=100
debug=0
disabled=0

[workerEnv:]
info=Global server options
timing=1
debug=0
# Default Native Logger (apache2 or win32 )
# can be overriden to a file logger, useful
# when tracing win32 related issues
#logger=logger.file:0

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

# tomcat1
[channel.socket:localhost:11009]
port=11009
host=localhost
type=ajp13
lb_factor=100
#tomcatId=tomcat1 : make load balancing not work

# tomcat2
[channel.socket:localhost:12009]
port=12009
host=localhost
type=ajp13
lb_factor=100
#tomcatId=tomcat2 : make load balancing not work

# tomcat3
#[channel.socket:psdwdinhnguyen:13009]
#port=13009
#host=psdwdinhnguyen
#type=ajp13
#lb_factor=100


[uri:/jkstatus/*]
info=Display status information and checks the config file for changes.
#group=status:

[uri:/*.jsp]
info=Extension mapping

==
-Original Message-
From: Dinh Nguyen
Sent: Monday, October 27, 2003 8:50 AM
To: Tomcat Users List
Subject: RE: Session affinity doesn't work


Hi Klaus,
The jvmRoute of the second tomcat instance is "tomcat2", I forgot to
said that in my first email. About the tomcatId, I modified my settings
as you said but now the load balancing no longer works. Only tomcat2
responses to my request.

Thank you anyway. Anyone have another idea? Thanks.
Dinh.

PS: The attachments are my setting files for your reference. server1.xml
is server.xml for tomcat1 and server2.xml is server.xml for tomcat2


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


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



Howto compile mod_jk for windows systems for Apache and mod_jk2 for Apache2!

2003-11-27 Thread Klaus Wienert
Its not as simple as I thought, but I have done it.

0. This is a short, short, very short howto

1. Prerequisites
Microsoft Visual C++ 6.0
Apache 1.3 or Apache 2
Ant (http://ant.apache.org/)
JkAnt
(http://www.apache.org/dist/jakarta/tomcat-4/v4.1.29/src/jakarta-tomcat-conn
ectors-4.1.29-src.zip or CVS in jk/jkant)

2. MOD_JK
2.1. copy jkant.jar to jk/build/lib/jkant.jar

2.2. get mod_jk-1.2.5
(http://www.apache.org/dist/jakarta/tomcat-connectors/jk/source/jakarta-tomc
at-connectors-jk-1.2.5-src.zip)

2.3. create jk/build.properties and run ant on jk/native/build.xml

#build.properties
#apache2.home=C:/Apache2
apache13.home=C:/Apache
apr.home=${apache2.home}
apr.include=${apr.home}/include
apr-util.include=${apr.home}/include
apr.lib=${apr.home}/lib
apr-util.lib=${apr.home}/lib
apache2.lib=${apache2.home}/lib
so.debug=false
so.optimize=true
so.profile=false
mssdk.home=c:/Programme/Microsoft Visual Studio/VC98
build.compiler.base=${mssdk.home}
build.compiler.cc=${mssdk.home}/bin/cl
build.compiler.ld=${mssdk.home}/bin/link

2.4. if you see warnings in your logs

Loaded DSO X:/path/mod_jk.dll uses plain Apache 1.3 API, this module might
crash under EAPI! (please recompile it with -DEAPI)

add to build.xml at target apache13



2.5. you can find mod_jk.dll in jk/build/jk/apache13

3. MOD_JK2
3.1. copy jkant.jar to jk/build/lib/jkant.jar

3.2. get mod_jk-1.2.5
(http://www.apache.org/dist/jakarta/tomcat-connectors/jk2/source/jakarta-tom
cat-connectors-jk2-2.0.2-src.zip)

3.3. create jk/build.properties and run ant on jk/native2/build.xml

#build.properties
apache2.home=C:/Apache2
#apache13.home=C:/Apache
apr.home=${apache2.home}
apr.include=${apr.home}/include
apr-util.include=${apr.home}/include
apr.lib=${apr.home}/lib
apr-util.lib=${apr.home}/lib
apache2.lib=${apache2.home}/lib
so.debug=false
so.optimize=true
so.profile=false
mssdk.home=c:/Programme/Microsoft Visual Studio/VC98
build.compiler.base=${mssdk.home}
build.compiler.cc=${mssdk.home}/bin/cl
build.compiler.ld=${mssdk.home}/bin/link

3.4. if you see compile errors

file:X:/path/jk/native2/build.xml:138: Execute failed: java.io.IOException:
CreateProcess: "c:\Programme\Microsoft Visual Studio\VC98\bin\rc" -r -fo ...

change in target init.win32.mc



to



3.5. you can find mod_jk.dll in jk/build/jk2/apache2


Klaus Wienert


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