Re: Apache Accessing Tomcat Issue

2013-03-30 Thread Chris Arnold
On 29.03.2013 18:02, Chris Arnold wrote:
http://share.domain.com and get the required results (which is 
http://share.domain.com/share)

Let's stick to mod_jk for the moment. I think you are close.

OK

Here is the modified virtualhost file:
 VirtualHost *:80
 ServerName share.domain.com
 
 #RewriteEngine On
#RewriteCond %{REQUEST_URI} !^/share/
 #RewriteCond %{HTTPS} on
 #RewriteRule ^/. http://share.domain.com/share/ [P]
 JkMount /share|/* worker1
 RedirectMatch ^/$ http://share.domain.com/share/
 
 ErrorLog /var/log/apache2/domain.com-error_log
 CustomLog /var/log/apache2/domain.com-access_log combined
 
 /VirtualHost

OK, one thing I forgot, sorry:

this config uses a load balancer worker which even if there's only one
Tomcat instance involved allows a bit more of control. For this to work
you need to replace the name worker1 in the above JkMount with balancer:

JkMount /share|/* balancer

because that's the name of the load balancer worker in your
workers.properties.

If you don't want to use the balancer, then add to workers.properties
the line

worker.list=worker1

and optionally remove all lines that start with

worker.balancer

and the line

worker.list=balancer

But you can also keep them if you later want to test the load balancer
worker.

Here is the new workers.properties file:
..
# the final value for y will be value\something

# Define two status worker:
# - jk-status for read-only use
 # - jk-manager for read/write use
 worker.list=jk-status
 worker.list=jk-status.type=status
 worker.jk-status.read_only=true
 
 worker.list=jk-manager
 worker.list=worker1
 worker.jk-manager.type=status


Not that good, but probably will work nevertheless ;)

Give it a try (with!

I dont understand the With! part. Is that part of the apache restart command to 
force?

If it doesn't work, increase the JkLogLevel to debug and post the JK log
file contents (and the Apache error log and access log entries for your
test requests).

Well, now apache does not start. Gives this error:
error in reading worker properties from /opt/path to/worker.properties
Configuration failed
Seems it doesn't like something about the worker.properties file. Due to that i 
will post the complete workers.properties file (it is writeable):

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the License); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an AS IS BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Note that the distributed version of this file requires modification
# before it is usable.
#
# Reference documentation: 
http://tomcat.apache.org/connectors-doc/reference/workers.html
#
# As a general note, the characters $( and ) are used internally to define
# macros. Do not use them in your own configuration!!!
#
# Whenever you see a set of lines such as:
# x=value
# y=$(x)\something
#
# the final value for y will be value\something

# Define two status worker:
# - jk-status for read-only use
# - jk-manager for read/write use
worker.list=jk-status
worker.jk-status.type=status
worker.jk-status.read_only=true

worker.list=jk-manager
worker.list=worker1
worker.jk-manager.type=status

# We define a load balancer worker
# with name balancer
worker.list=balancer
worker.balancer.type=lb
# error_escalation_time: seconds, default = recover_time/2 (=30)
# Determines, how fast a detected error should switch from
# local error state to global error state
# Since: 1.2.28
worker.balancer.error_escalation_time=0

# - max_reply_timeouts: number, default=0
#   If there are to many reply timeouts, a worker
#   is put into the error state, i.e. it will become
#   unavailable for all sessions residing on the respective
#   Tomcat. The number of tolerated reply timeouts is
#   configured with max_reply_timeouts. The number of
#   timeouts occuring is divided by 2 once a minute and the
#   resulting counter is compared against max_reply_timeouts.
#   If you set max_reply_timeouts to N and the errors are
#   occuring equally distributed over time, you will
#   tolerate N/2 errors per minute. If they occur in a burst
#   you will tolerate N errors.
#   Since: 1.2.24
worker.balancer.max_reply_timeouts=10



# Now we add members to the load balancer
# First member is node1, most
# attributes are inherited from the
# template worker.template.
worker.balancer.balance_workers=worker1

Re: Apache Accessing Tomcat Issue

2013-03-30 Thread Rainer Jung
On 30.03.2013 12:43, Chris Arnold wrote:
 Here is the modified virtualhost file:
  VirtualHost *:80
  ServerName share.domain.com
  
  #RewriteEngine On
 #RewriteCond %{REQUEST_URI} !^/share/
  #RewriteCond %{HTTPS} on
  #RewriteRule ^/. http://share.domain.com/share/ [P]
  JkMount /share|/* worker1

As mentioned I suggest to use balancer instead of worker1 here.

  RedirectMatch ^/$ http://share.domain.com/share/
  
  ErrorLog /var/log/apache2/domain.com-error_log
  CustomLog /var/log/apache2/domain.com-access_log combined
  
  /VirtualHost
 
 OK, one thing I forgot, sorry:
 
 this config uses a load balancer worker which even if there's only one
 Tomcat instance involved allows a bit more of control. For this to work
 you need to replace the name worker1 in the above JkMount with balancer:
 
 JkMount /share|/* balancer

See above.

 Give it a try (with!
 
 I dont understand the With! part. Is that part of the apache restart command 
 to force?

Me neither, somehow part f the text got deleted. Probably just wanted to
say with the above adjustments).

 If it doesn't work, increase the JkLogLevel to debug and post the JK log
 file contents (and the Apache error log and access log entries for your
 test requests).
 
 Well, now apache does not start. Gives this error:
 error in reading worker properties from /opt/path to/worker.properties

Is the path in the error the correct one?

 Configuration failed
 Seems it doesn't like something about the worker.properties file. Due to that 
 i will post the complete workers.properties file (it is writeable):

What's in the JK log?


The following param doesn't exist in your old version:

 # error_escalation_time: seconds, default = recover_time/2 (=30)
 # Determines, how fast a detected error should switch from
 # local error state to global error state
 # Since: 1.2.28
 worker.balancer.error_escalation_time=0

That following port likely is wrong. you need to configure the AJP port
of Tomcat, something like 8009 or whataver you have chosen in
server.xml. Make sure the AJP port in server.xml is not commented out.

 worker.worker1.port=8080

The following param doesn't exist in your old version:

 # - socket_connect_timeout: milliseconds, default=0
 #   Since: 1.2.27
 worker.template.socket_connect_timeout=5000

The following params don't exist in your old version:

 # - ping_mode: Character, default=none
 #   When should we use cping/cpong connection probing?
 #   C = directly after establishing a new connection
 #   P = directly before sending each request
 #   I = in regular intervals for idle connections
 #   using the watchdog thread
 #   A = all of the above
 #   Since: 1.2.27
 worker.template.ping_mode=A
 
 # - ping_timeout: milliseconds, default=1
 #   Wait timeout for cpong after cping
 #   Can be overwritten for modes C and P
 #   Using connect_timeout and prepost_timeout.
 #   Since: 1.2.27
 worker.template.ping_timeout=1

The following param doesn't exist in your old version:

 # - reply_timeout: milliseconds, default=0
 #   Any pause longer than this timeout during waiting
 #   for a part of the reply will abort handling the request
 #   in mod_jk. The request will proceed running in
 #   Tomcat, but the web server resources will be freed
 #   and an error is send to the client.
 #   For individual requests, the timeout can be overwritten
 #   by the Apache environment variable JK_REPLY_TIMEOUT.
 #   JK_REPLY_TIMEOUT since: 1.2.27
 worker.template.reply_timeout=30

Regards,

Rainer


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Apache Accessing Tomcat Issue

2013-03-30 Thread Chris Arnold
On 30.03.2013 12:43, Chris Arnold wrote

The following param doesn't exist in your old version:

 # error_escalation_time: seconds, default = recover_time/2 (=30)
 # Determines, how fast a detected error should switch from
 # local error state to global error state
 # Since: 1.2.28
 worker.balancer.error_escalation_time=0

The following were not in the original post as i snipped these out in order to 
post only what i thought was important. They have always existed in the file 
since i downloaded the one you pointed me too.

That following port likely is wrong. you need to configure the AJP port
of Tomcat, something like 8009 or whataver you have chosen in
server.xml. Make sure the AJP port in server.xml is not commented out.

 worker.worker1.port=8080

Yes, i changed this to 8009 as stade in the server xml

The following param doesn't exist in your old version:

 # - socket_connect_timeout: milliseconds, default=0
 #   Since: 1.2.27
 worker.template.socket_connect_timeout=5000

See above and ended up having to comment this out as it is not supported in the 
version of mod_jk i am using.

The following params don't exist in your old version:

 # - ping_mode: Character, default=none
 #   When should we use cping/cpong connection probing?
 #   C = directly after establishing a new connection
 #   P = directly before sending each request
 #   I = in regular intervals for idle connections
 #   using the watchdog thread
 #   A = all of the above
 #   Since: 1.2.27
 worker.template.ping_mode=A
 
 # - ping_timeout: milliseconds, default=1
 #   Wait timeout for cpong after cping
 #   Can be overwritten for modes C and P
 #   Using connect_timeout and prepost_timeout.
 #   Since: 1.2.27
 worker.template.ping_timeout=1

See above and ended up having to comment this out as it is not supported in the 
version of mod_jk i am using.

The following param doesn't exist in your old version:

 # - reply_timeout: milliseconds, default=0
 #   Any pause longer than this timeout during waiting
 #   for a part of the reply will abort handling the request
 #   in mod_jk. The request will proceed running in
 #   Tomcat, but the web server resources will be freed
 #   and an error is send to the client.
 #   For individual requests, the timeout can be overwritten
 #   by the Apache environment variable JK_REPLY_TIMEOUT.
 #   JK_REPLY_TIMEOUT since: 1.2.27
 worker.template.reply_timeout=30

See above and ended up having to comment this out as it is not supported in the 
version of mod_jk i am using.
Apache finally started after commenting those out and changing the port. And i 
can now access http://share.domain.com
Ranier, thank you for your time and instruction. Shall i send you some paypal 
monies?


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Multiple domains accessing same Tomcat content

2013-03-30 Thread Chris Arnold
I thought i would understand how to config a 2nd domain to access the same 
content after configuring for the first domain but that proved wrong. I have 
multiple domains that need to access the same content. For example, 
http://share.domain1.com should result in http://share.domain1.com/share and 
http://share.domain2.com should result in http://share.domain2.com/share. 
Thanks to Ranier, i have 1 working config accessing http://share.domain.com. 
Now, how do i add a 2nd domain so they will type http://share.domain2.com and 
get http://share.domain2.com/share?
Here is the workers.properties file configured for domain2:

worker.properties:

# Define two status worker:
# - jk-status for read-only use
# - jk-manager for read/write use
worker.list=jk-status
worker.jk-status.type=status
worker.jk-status.read_only=true

worker.list=jk-manager
worker.list=worker1
worker.list=worker2
worker.jk-manager.type=status

# We define a load balancer worker
# with name balancer
worker.list=balancer
worker.balancer.type=lb
# error_escalation_time: seconds, default = recover_time/2 (=30)
# Determines, how fast a detected error should switch from
# local error state to global error state
# Since: 1.2.28
#worker.balancer.error_escalation_time=0

# - max_reply_timeouts: number, default=0
#   If there are to many reply timeouts, a worker
#   is put into the error state, i.e. it will become
#   unavailable for all sessions residing on the respective
#   Tomcat. The number of tolerated reply timeouts is
#   configured with max_reply_timeouts. The number of
#   timeouts occuring is divided by 2 once a minute and the
#   resulting counter is compared against max_reply_timeouts.
#   If you set max_reply_timeouts to N and the errors are
#   occuring equally distributed over time, you will
#   tolerate N/2 errors per minute. If they occur in a burst
#   you will tolerate N errors.
#   Since: 1.2.24
worker.balancer.max_reply_timeouts=10



# Now we add members to the load balancer
# First member is node1, most
# attributes are inherited from the
# template worker.template.
worker.balancer.balance_workers=worker1
worker.worker1.reference=worker.template
worker.worker1.host=localhost
worker.worker1.port=8009
# Activation allows to configure
# whether this node should actually be used
# A: active (use node fully)
# D: disabled (only use, if sticky session needs this node)
# S: stopped (do not use)
#   Since: 1.2.19
worker.worker1.activation=A

# Second member is node2, most
# attributes are inherited from the
# template worker.template.
worker.balancer.balance_workers=worker2
worker.worker2.reference=worker.template
worker.worker2.host=localhost
worker.worker2.port=8009
# Activation allows to configure
# whether this node should actually be used
# A: active (use node fully)
# D: disabled (only use, if sticky session needs this node)
# S: stopped (do not use)
#   Since: 1.2.19
worker.worker2.activation=A

# Finally we put the parameters
# which should apply to all our ajp13
# workers into the referenced template
# - Type is ajp13
worker.template.type=ajp13

# - socket_connect_timeout: milliseconds, default=0
#   Since: 1.2.27
#worker.template.socket_connect_timeout=5000//not supported in the version of 
mod_jk running 1.2.26

# - socket_keepalive: boolean, default=false
#   Should we send TCP keepalive packets
#   when connection is idle (socket option)?
worker.template.socket_keepalive=true

# - ping_mode: Character, default=none
#   When should we use cping/cpong connection probing?
#   C = directly after establishing a new connection
#   P = directly before sending each request
#   I = in regular intervals for idle connections
#   using the watchdog thread
#   A = all of the above
#   Since: 1.2.27
#worker.template.ping_mode=A//not supported in the version of mod_jk running 
1.2.26

# - ping_timeout: milliseconds, default=1
#   Wait timeout for cpong after cping
#   Can be overwritten for modes C and P
#   Using connect_timeout and prepost_timeout.
#   Since: 1.2.27
#worker.template.ping_timeout=1//not supported in the version of mod_jk 
running 1.2.26

# - connection_pool_minsize: number, default=connection_pool_size
#   Lower pool size when shrinking pool due
#   to idle connections
#   We want all connections to be closed when
#   idle for a long time in order to prevent
#   firewall problems.
#   Since: 1.2.16
worker.template.connection_pool_minsize=0

# - connection_pool_timeout: seconds, default=0
#   Idle time, before a connection is eligible
#   for being closed (pool shrinking).
#   This should be the same value as connectionTimeout
#   in the Tomcat AJP connector, but there it is
#   milliseconds, here seconds.
worker.template.connection_pool_timeout=600

# - reply_timeout: milliseconds, default=0
#   Any pause longer than this timeout during waiting
#   for a part of the reply will abort handling the request
#   in mod_jk. The request will proceed running in
#   Tomcat, but the web server resources will be freed