On 29.03.2013 18:02, Chris Arnold wrote:
> This thread is getting kinda messy so i am going to snip a bunch of stuff and 
> answer your latest info.

Good.

>> So mod_proxy is loaded but you don't want to use it to access alfresco,
>> instead just mod_jk, right? Then don't use any ReWriteRule with the [P}
>> flag or any Proxy... directive.
> 
> No, if this can be done with mod_proxy, i would prefer to do that. I have 
> been unable to get mod_proxy working so users type 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.

> 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/
> 
> <IfModule mod_jk.c>
> 
>     # The following line makes apache aware of the location of
>     # the /jsp-examples context
>     #Alias /share "/opt/alfresco/tomcat/webapps/share"
>     #<Directory "/opt/alfresco/tomcat/webapps/share">
>       #Options Indexes FollowSymLinks
>       #allow from all
>     #</Directory>
> 
>     # The following line mounts all JSP files and the /servlet/ uri to tomcat
>     #JkMount /servlets-examples/servlet/* ajp13
>     #JkMount /share/*.jsp ajp13
> 
>     # The following line prohibits users from directly accessing WEB-INF
>     #<Location "/share/WEB-INF/">
>       #AllowOverride None
>       #deny from all
>     #</Location>
> 
>     # if not specified, the global error log is used
>     ErrorLog /var/log/apache2/domain.com-error_log
>     CustomLog /var/log/apache2/domain.com-access_log combined
> 
> </IfModule>
> 
> </VirtualHost>

Looks good to me, you can remove the IfModule tags. They don't contain
anything mod_jk specific any more and in fact if mod_jk is not loaded
you'd want the whole thing to bomb at startup and not just ignore mod_jk
config.

You've chosen the worker name worker1. Fine.

>> At this step:
> 
>> - do not try to serve static content from Apache, first get this to work
>> before adding the additional complexity.
> 
>> - do not try to make the webapp /share/ directly available under the top
>> level directory. It is OK to redirect the a request for
>> http://share.domain.com/ to http://share.domain.com/share/ and proceed
>>from there as above, but it is harder to remove the "share" URI path
>> component from each request. If you really need to do this, then use
>> mod_proxy, not mod_jk.
> 
> Doing the above, does that take care of what you stated here?

Looks good to me.

> 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.jk-status.type=status
> worker.jk-status.read_only=true
> 
> worker.list=jk-manager
> 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=8080
> # 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=node2
> #worker.node2.reference=worker.template
> #worker.node2.host=localhost
> #worker.node2.port=8209
> # 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.node2.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
> 
> # - 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
> 
> # - ping_timeout: milliseconds, default=10000
> #   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=10000
> 
> # - 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
> #   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=300000
> 
> # - recovery_options: number, default=0
> #   Bit mask to configure, if a request, which was send
> #   to a backend successfully, should be retried on another backend
> #   in case there's a problem with the response.
> #   Value "3" disables retries, whenever a part of the request was
> #   successfully send to the backend.
> worker.template.recovery_options=3

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.

>> JkShmFile /var/log/alfresco/shm
> 
>> has not worked. Check whether the directory /var/log/alfresco exists and
>> is writable.
> 
> Does exist and is writeable. Those errors were from the veru beginning and 
> have not had any errors since then

OK

>> Are you using a relatively recent version of mod_jk (1.2.37)? Which
>> version of Apache are you using?
> 
> 1.2.26 which came with the SLES11 distribution

Not that good, but probably will work nevertheless ;)

Give it a try (with!

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

Regards,

Rainer

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

Reply via email to