Re: Verifying mod_jk is installed

2012-09-18 Thread André Warnier

John Rellis wrote:

Hey,

I would very much appreciate some help, flying blind at the moment.

I want to use mod_jk as a load balancer to two remote tomcat instances and
I am failing so I need to verify the steps.  I have installed mod_jk, I
will paste the mod_jk log to the end of the email.  Is there anything I can
do to verify that mod_jk is installed properly 


The log you supply below shows definitely that mod_jk is installed and working.
Whether it is configured properly for what you want to achieve is another issue.

Also, if it was not installed or loaded in Apache httpd, then any of your Jk* 
instruction lines in httpd.conf would trigger an error when you start Apache.



 Is jkstatus a URL I can

hit???  I put  *JkMount /jkmanager* jkstatus* in apache2.conf so I was
assuming I could hit host/jkmanager and there would be something there.
 instead i get

missing uri map for ip-xx-xx-xx-xx.us-west-2.compute.internal:/jkmanager


Many thanks for any tips! :)

*/etc/apache2/conf/workers.properties*

# Define worker names

worker.list=jkstatus, LoadBalancer

# Create virtual workers

worker.jkstatus.type=status

worker.LoadBalancer.type=lb

# Declare Tomcat server workers 1 through n

worker.worker1.type=ajp13

worker.worker1.host=tomcatone

worker.worker1.port=8009

worker.worker2.type=ajp13

worker.worker2.host=tomcattwo

worker.worker2.port=8009

# Associate real workers with virtual LoadBalancer worker
worker.LoadBalancer.balance_workers=worker1,worker2

*/etc/apache2/mods-enabled/jk.conf*

IfModule jk_module

JkWorkersFile /etc/apache2/conf/workers.properties

JkLogFile /var/log/apache2/mod_jk.log

JkLogLevel debug

JkShmFile /var/log/apache2/jk-runtime-status

# Since: 1.2.27
JkWatchdogInterval 60

/IfModule



*/etc/apache2/apache2.conf*
*
*

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
LockFile ${APACHE_LOCK_DIR}/accept.lock

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to Off to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5


## Server-Pool Size Regulation (MPM specific)
##

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
IfModule mpm_prefork_module
StartServers  5
MinSpareServers   5
MaxSpareServers  10
MaxClients  150
MaxRequestsPerChild   0
/IfModule

# worker MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
#  graceful restart. ThreadLimit can only be changed by stopping
#  and starting Apache.
# ThreadsPerChild: constant number of worker threads in each server process
# MaxClients: maximum number of simultaneous client connections
# MaxRequestsPerChild: maximum number of requests a server process serves
IfModule mpm_worker_module
StartServers  2
MinSpareThreads  25
MaxSpareThreads  75
ThreadLimit  64
ThreadsPerChild  25
MaxClients  150
MaxRequestsPerChild   0
/IfModule

# event MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxClients: maximum number of simultaneous client connections
# MaxRequestsPerChild: maximum number of requests a server process serves
IfModule mpm_event_module
StartServers  2
MinSpareThreads  25
MaxSpareThreads  75
ThreadLimit  64
ThreadsPerChild  25
MaxClients  150
MaxRequestsPerChild   0
/IfModule


# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# AccessFileName: The name of the file to look for in each directory
# 

Re: Verifying mod_jk is installed

2012-09-18 Thread John Rellis
André,

Thanks!  OK, so I put

JkMount /jkmanager/ jkstatus
JkMount /jkmanager/* jkstatus

Into apache2.conf and no success.  I did however put it
in sites-available/default

VirtualHost *:80
ServerAdmin webmaster@localhost

JkMount /jkmanager/ jkstatus
JkMount /jkmanager/* jkstatus
.

And I can now hit host/jkmanager/ and I get a UI.

Is this the expected behaviour???

Many thanks again!
John

On Tue, Sep 18, 2012 at 3:05 PM, André Warnier a...@ice-sa.com wrote:

 John Rellis wrote:

 Hey,

 I would very much appreciate some help, flying blind at the moment.

 I want to use mod_jk as a load balancer to two remote tomcat instances and
 I am failing so I need to verify the steps.  I have installed mod_jk, I
 will paste the mod_jk log to the end of the email.  Is there anything I
 can
 do to verify that mod_jk is installed properly


 The log you supply below shows definitely that mod_jk is installed and
 working.
 Whether it is configured properly for what you want to achieve is another
 issue.

 Also, if it was not installed or loaded in Apache httpd, then any of your
 Jk* instruction lines in httpd.conf would trigger an error when you start
 Apache.



  Is jkstatus a URL I can

 hit???  I put  *JkMount /jkmanager* jkstatus* in apache2.conf so I was

 assuming I could hit host/jkmanager and there would be something there.
  instead i get

 missing uri map for ip-xx-xx-xx-xx.us-west-2.**
 compute.internal:/jkmanager


 Many thanks for any tips! :)

 */etc/apache2/conf/workers.**properties*


 # Define worker names

 worker.list=jkstatus, LoadBalancer

 # Create virtual workers

 worker.jkstatus.type=status

 worker.LoadBalancer.type=lb

 # Declare Tomcat server workers 1 through n

 worker.worker1.type=ajp13

 worker.worker1.host=tomcatone

 worker.worker1.port=8009

 worker.worker2.type=ajp13

 worker.worker2.host=tomcattwo

 worker.worker2.port=8009

 # Associate real workers with virtual LoadBalancer worker
 worker.LoadBalancer.balance_**workers=worker1,worker2

 */etc/apache2/mods-enabled/jk.**conf*


 IfModule jk_module

 JkWorkersFile /etc/apache2/conf/workers.**properties

 JkLogFile /var/log/apache2/mod_jk.log

 JkLogLevel debug

 JkShmFile /var/log/apache2/jk-runtime-**status

 # Since: 1.2.27
 JkWatchdogInterval 60

 /IfModule



 */etc/apache2/apache2.conf*
 *

 *

 #
 # The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
 #
 LockFile ${APACHE_LOCK_DIR}/accept.lock

 #
 # PidFile: The file in which the server should record its process
 # identification number when it starts.
 # This needs to be set in /etc/apache2/envvars
 #
 PidFile ${APACHE_PID_FILE}

 #
 # Timeout: The number of seconds before receives and sends time out.
 #
 Timeout 300

 #
 # KeepAlive: Whether or not to allow persistent connections (more than
 # one request per connection). Set to Off to deactivate.
 #
 KeepAlive On

 #
 # MaxKeepAliveRequests: The maximum number of requests to allow
 # during a persistent connection. Set to 0 to allow an unlimited amount.
 # We recommend you leave this number high, for maximum performance.
 #
 MaxKeepAliveRequests 100

 #
 # KeepAliveTimeout: Number of seconds to wait for the next request from
 the
 # same client on the same connection.
 #
 KeepAliveTimeout 5


 ## Server-Pool Size Regulation (MPM specific)
 ##

 # prefork MPM
 # StartServers: number of server processes to start
 # MinSpareServers: minimum number of server processes which are kept spare
 # MaxSpareServers: maximum number of server processes which are kept spare
 # MaxClients: maximum number of server processes allowed to start
 # MaxRequestsPerChild: maximum number of requests a server process serves
 IfModule mpm_prefork_module
 StartServers  5
 MinSpareServers   5
 MaxSpareServers  10
 MaxClients  150
 MaxRequestsPerChild   0
 /IfModule

 # worker MPM
 # StartServers: initial number of server processes to start
 # MinSpareThreads: minimum number of worker threads which are kept spare
 # MaxSpareThreads: maximum number of worker threads which are kept spare
 # ThreadLimit: ThreadsPerChild can be changed to this maximum value
 during a
 #  graceful restart. ThreadLimit can only be changed by
 stopping
 #  and starting Apache.
 # ThreadsPerChild: constant number of worker threads in each server
 process
 # MaxClients: maximum number of simultaneous client connections
 # MaxRequestsPerChild: maximum number of requests a server process serves
 IfModule mpm_worker_module
 StartServers  2
 MinSpareThreads  25
 MaxSpareThreads  75
 ThreadLimit  64
 ThreadsPerChild  25
 MaxClients  150
 MaxRequestsPerChild   0
 /IfModule

 # event MPM
 # StartServers: initial number of server processes to start
 # MinSpareThreads: minimum number of worker threads which are kept spare
 # MaxSpareThreads: maximum number of worker 

Re: Verifying mod_jk is installed

2012-09-18 Thread André Warnier

John Rellis wrote:

André,

Thanks!  OK, so I put

JkMount /jkmanager/ jkstatus
JkMount /jkmanager/* jkstatus

Into apache2.conf and no success.  I did however put it
in sites-available/default

VirtualHost *:80
ServerAdmin webmaster@localhost

JkMount /jkmanager/ jkstatus
JkMount /jkmanager/* jkstatus
.

And I can now hit host/jkmanager/ and I get a UI.

Is this the expected behaviour???

Yes, but do not top-post.  Read 
http://en.wikipedia.org/wiki/Posting_style#Choosing_the_proper_posting_style


In reality there are several factors at work here.  We are getting into Apache VirtualHost 
logic, and the logic of inheritance of JkMount from the main Apache configuration to the 
virtual hosts.

To get a fuller explanation, see the online documentation and the JkMountCopy 
directive.

Briefly :
- for Apache httpd :
   - generally, whatever lives outside a VirtualHost section belongs to the main 
configuration, and basically acts as a default value for any VirtualHost, /unless/ it is 
superseded by a similar directive inside a VirtualHost section.
- for JkMount however : by default, a JkMount in the main httpd configuration is /not/ 
inherited by the VirtualHost sections, /unless/ you use the JkMountCopy instruction 
appropriately.


In addition, there is the logic determining which VirtualHost configuration is really 
handling your request.
The first defined VirtualHost in the Apache httpd configuration (from top to bottom) acts 
as the default VirtualHost.  That means that for any request where httpd cannot 
determine to which VirtualHost it is addressed (because the hostname of the request does 
not match any ServerName of a VirtualHost), Apache httpd will use this default virtual 
host configuration to process the request.


In your case, if you send a request to http://(ip address)/x, and none of your 
VirtualHost sections contains a serverName (ip address) matching exactly, then the 
request will be processed with the configuration of the default VirtualHost.

Which is what is happening here.

And the combination of all the above is why, when you put the JkMounts in the default 
VirtualHost configuration section, it works.


But it is not really supposed to work that way. Your http request should be properly 
addressed to a specific VirtualHost - by name - and this VirtualHost configuration should 
be so that it contains the appropriate JkMount directives (or a JkMountCopy directive, to 
inherit the JkMounts from the main configuration).


And I hope that you are not totally lost ater that. ;-)


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



Re: Verifying mod_jk is installed

2012-09-18 Thread John Rellis
On Tue, Sep 18, 2012 at 3:56 PM, André Warnier a...@ice-sa.com wrote:

 John Rellis wrote:

 André,

 Thanks!  OK, so I put

 JkMount /jkmanager/ jkstatus
 JkMount /jkmanager/* jkstatus

 Into apache2.conf and no success.  I did however put it
 in sites-available/default

 VirtualHost *:80
 ServerAdmin webmaster@localhost

 JkMount /jkmanager/ jkstatus
 JkMount /jkmanager/* jkstatus
 .

 And I can now hit host/jkmanager/ and I get a UI.

 Is this the expected behaviour???

  Yes, but do not top-post.  Read http://en.wikipedia.org/wiki/**
 Posting_style#Choosing_the_**proper_posting_stylehttp://en.wikipedia.org/wiki/Posting_style#Choosing_the_proper_posting_style

 In reality there are several factors at work here.  We are getting into
 Apache VirtualHost logic, and the logic of inheritance of JkMount from the
 main Apache configuration to the virtual hosts.
 To get a fuller explanation, see the online documentation and the
 JkMountCopy directive.

 Briefly :
 - for Apache httpd :
- generally, whatever lives outside a VirtualHost section belongs
 to the main configuration, and basically acts as a default value for any
 VirtualHost, /unless/ it is superseded by a similar directive inside a
 VirtualHost section.
 - for JkMount however : by default, a JkMount in the main httpd
 configuration is /not/ inherited by the VirtualHost sections, /unless/ you
 use the JkMountCopy instruction appropriately.

 In addition, there is the logic determining which VirtualHost
 configuration is really handling your request.
 The first defined VirtualHost in the Apache httpd configuration (from top
 to bottom) acts as the default VirtualHost.  That means that for any
 request where httpd cannot determine to which VirtualHost it is addressed
 (because the hostname of the request does not match any ServerName of a
 VirtualHost), Apache httpd will use this default virtual host configuration
 to process the request.

 In your case, if you send a request to http://(ip address)/x, and none
 of your VirtualHost sections contains a serverName (ip address) matching
 exactly, then the request will be processed with the configuration of the
 default VirtualHost.
 Which is what is happening here.

 And the combination of all the above is why, when you put the JkMounts in
 the default VirtualHost configuration section, it works.

 But it is not really supposed to work that way. Your http request should
 be properly addressed to a specific VirtualHost - by name - and this
 VirtualHost configuration should be so that it contains the appropriate
 JkMount directives (or a JkMountCopy directive, to inherit the JkMounts
 from the main configuration).

 And I hope that you are not totally lost ater that. ;-)



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




André,

Thanks very much for your help.

I put :

VirtualHost *:80
ServerAdmin webmaster@localhost
JkMount /ClusterApp/ LoadBalancer
JkMount /ClusterApp/* LoadBalancer
JkMount /jkmanager/ jkstatus
JkMount /jkmanager/* jkstatus

And it is now hitting my cluster after two days of agony s
 YEEES

Phew!  Your explanation is great, and with it, i put JkMountCopy in the
virtual host and the url mappings in apache2.conf and it works!  :)  Beer!

Thanks again.  Regarding top posting, apologies, I am using gmail and I
never noticed it was an issue on other lists but I of course respect the
decision of each individual list! :)

I'm not sure how to bottom post in gmail so I just put my reply after
yours, hope its ok!


Re: Verifying mod_jk is installed

2012-09-18 Thread David kerber

On 9/18/2012 11:46 AM, John Rellis wrote:

On Tue, Sep 18, 2012 at 3:56 PM, André Warniera...@ice-sa.com  wrote:


John Rellis wrote:


André,

Thanks!  OK, so I put

 JkMount /jkmanager/ jkstatus
 JkMount /jkmanager/* jkstatus

Into apache2.conf and no success.  I did however put it
in sites-available/default

VirtualHost *:80
 ServerAdmin webmaster@localhost

 JkMount /jkmanager/ jkstatus
 JkMount /jkmanager/* jkstatus
.

And I can now hit host/jkmanager/ and I get a UI.

Is this the expected behaviour???

  Yes, but do not top-post.  Read http://en.wikipedia.org/wiki/**

Posting_style#Choosing_the_**proper_posting_stylehttp://en.wikipedia.org/wiki/Posting_style#Choosing_the_proper_posting_style

In reality there are several factors at work here.  We are getting into
Apache VirtualHost logic, and the logic of inheritance of JkMount from the
main Apache configuration to the virtual hosts.
To get a fuller explanation, see the online documentation and the
JkMountCopy directive.

Briefly :
- for Apache httpd :
- generally, whatever lives outside aVirtualHost  section belongs
to the main configuration, and basically acts as a default value for any
VirtualHost, /unless/ it is superseded by a similar directive inside a
VirtualHost  section.
- for JkMount however : by default, a JkMount in the main httpd
configuration is /not/ inherited by the VirtualHost sections, /unless/ you
use the JkMountCopy instruction appropriately.

In addition, there is the logic determining which VirtualHost
configuration is really handling your request.
The first defined VirtualHost in the Apache httpd configuration (from top
to bottom) acts as the default VirtualHost.  That means that for any
request where httpd cannot determine to which VirtualHost it is addressed
(because the hostname of the request does not match any ServerName of a
VirtualHost), Apache httpd will use this default virtual host configuration
to process the request.

In your case, if you send a request to http://(ip address)/x, and none
of your VirtualHost sections contains a serverName (ip address) matching
exactly, then the request will be processed with the configuration of the
default VirtualHost.
Which is what is happening here.

And the combination of all the above is why, when you put the JkMounts in
the default VirtualHost configuration section, it works.

But it is not really supposed to work that way. Your http request should
be properly addressed to a specific VirtualHost - by name - and this
VirtualHost configuration should be so that it contains the appropriate
JkMount directives (or a JkMountCopy directive, to inherit the JkMounts
from the main configuration).

And I hope that you are not totally lost ater that. ;-)



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





André,

Thanks very much for your help.

I put :

VirtualHost *:80
 ServerAdmin webmaster@localhost
 JkMount /ClusterApp/ LoadBalancer
 JkMount /ClusterApp/* LoadBalancer
 JkMount /jkmanager/ jkstatus
 JkMount /jkmanager/* jkstatus

And it is now hitting my cluster after two days of agony s
  YEEES

Phew!  Your explanation is great, and with it, i put JkMountCopy in the
virtual host and the url mappings in apache2.conf and it works!  :)  Beer!

Thanks again.  Regarding top posting, apologies, I am using gmail and I
never noticed it was an issue on other lists but I of course respect the
decision of each individual list! :)

I'm not sure how to bottom post in gmail so I just put my reply after
yours, hope its ok!


That's exactly what bottom-posting is, so you did it just right.








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