tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John C <jac_legend_...@hotmail.com>
Subject RE: Trouble connecting Tomcat 7.0 with Apache Server 2.2 (reposting question - hopefully this formats better)
Date Thu, 03 Mar 2011 13:53:45 GMT

I fixed my own problem. I changed the workers.properties file to this:
workers.tomcat_home=3DC:\Program Files (x86)\Apache Software Foundation\Tom=
cat 7.0workers.java_home=3DC:\Program Files (x86)\Java\jdk1.6.0_17ps=3D\wor=
ker.list=3Dmyworkerworker.myworker.port=3D8009worker.myworker.host=3Dlocalh=
ostworker.myworker.type=3Dajp13worker.myworker.lbfactor=3D1
And I changed the httpd.conf to this:
# My mod_jk settings#Load mod_jk moduleLoadModule jk_module modules/mod_jk.=
so#Where to find workers.propertiesJkWorkersFile conf/workers.properties#Wh=
ere to put jk logsJkLogFile logs/mod_jk.log#Set the jk log levelJkLogLevel =
debug# Select the log format#JkLogStampFormat =93[%a %b %d %H:%M:%S %Y]=93#=
JkOptions indicate to send SSL KEY SIZEJkOptions +ForwardKeySize +ForwardUR=
ICompat -ForwardDirectories#RequestLogFormat set the request format#JkReque=
stLogFormat =93%w %V %T=94# Send JSPs for context /ROOT to worker named =93=
myworker=94JkMount /*.jsp myworker# Send /ROOT to worker named =93myworker=
=94JkMount /* myworker
> From: jac_legend_sas@hotmail.com
> To: users@tomcat.apache.org
> Subject: Trouble connecting Tomcat 7.0 with Apache Server 2.2 (reposting =
question - hopefully this formats better)
> Date: Fri=2C 4 Mar 2011 02:29:15 +1300
>=20
>=20
> Reposting the same question I posted a minute ago due to weird formatting=
 issues. Hopefully this email fixes it.
> I am trying to
> connect Tomcat 7.0 and Apache Server 2.2 using Windows 7.0. I created a .=
jsp
> file to test if my setup was correct under "C:\Program Files (x86)\Apache
> Software Foundation\Tomcat 7.0\webapps\sitepoint\count.jsp". I can
> successfully load the count.jsp file by entering
> http://localhost:8080/sitepoint/count.jsp into Google Chrome=2C however w=
hen I
> enter http://localhost/sitepoint/count.jsp into Chrome I get an "Opps!
> This link appears to be broken." message. Therefore it appears to be an
> error in my configurations. Unfortunately I'm puzzled as to the problem a=
nd
> have been trying to look for a solution for the past 2 days without any l=
uck.
> Here are the details:
>=20
> =20
>=20
> Platform: Windows
> 7.0
>=20
> Tomcat: 7.0
>=20
> Apache Server:
> 2.2
>=20
> JDK: C:\Program
> Files (x86)\Java\jdk1.6.0_17
>=20
> Tomcat:
> C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0
>=20
> Apache:
> C:\Program Files (x86)\Apache Software Foundation\Apache2.2
>=20
> =20
>=20
> This is the
> process I went through.
>=20
> 1. Installed
> Apache Server and Tomcat
>=20
> 2. Downloaded the
> Apache Connector binaries: mod_jk-1.2.31-httpd-2.2.3.so. Renamed this to
> mod_jk.so and put it in the modules directory of Apache2.2.
>=20
> 3. Downloaded the
> source files for the same connector and extracted the workers.properties =
file
> and placed that into the conf directory of Apache2.2. I left this file
> unchanged=2C not sure if I am meant to alter it.
>=20
> 4. I then altered
> the httpd.conf configurations file inside the conf directory of Apache2.2=
 and
> added the following lines (not sure if /easywayserver/ should be used for=
 my
> example I described earlier) :
>=20
> =20
>=20
>       LoadModule jk_module modules/mod_jk.so
>=20
>       JkWorkersFile conf/workers.properties
>=20
>       JkLogFile "logs/mod_jk.log"
>=20
>       JkLogLevel error
>=20
>       JkMount /easywayserver loadbalancer
>=20
>       JkMount /easywayserver/* loadbalancer
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> 5. Restarted
> Apache server.
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> Here is a snipper
> of my log modjk.log
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> [Fri Mar 04
> 02:19:51.436 2011] [2276:6344] [info] jk_handler::mod_jk.c (2635): Could =
not
> find a worker for worker name=3Dloadbalancer
>=20
> =20
>=20
> [Fri Mar 04
> 02:19:55.658 2011] [2368:3752] [info] init_jk::mod_jk.c (3198): mod_jk/1.=
2.31
> (1026297) initialized
>=20
> =20
>=20
> [Fri Mar 04
> 02:19:55.658 2011] [2368:3752] [error] uri_worker_map_ext::jk_uri_worker_=
map.c
> (506): Could not find worker with name 'loadbalancer' in uri map post
> processing.
>=20
> =20
>=20
> [Fri Mar 04
> 02:19:55.658 2011] [2368:3752] [error] uri_worker_map_ext::jk_uri_worker_=
map.c
> (506): Could not find worker with name 'loadbalancer' in uri map post
> processing.
>=20
> =20
>=20
> [Fri Mar 04
> 02:19:55.737 2011] [5964:6660] [info] init_jk::mod_jk.c (3198): mod_jk/1.=
2.31
> (1026297) initialized
>=20
> =20
>=20
> [Fri Mar 04
> 02:19:55.737 2011] [5964:6660] [error] uri_worker_map_ext::jk_uri_worker_=
map.c
> (506): Could not find worker with name 'loadbalancer' in uri map post
> processing.
>=20
> =20
>=20
> [Fri Mar 04
> 02:19:55.737 2011] [5964:6660] [error] uri_worker_map_ext::jk_uri_worker_=
map.c
> (506): Could not find worker with name 'loadbalancer' in uri map post
> processing.
>=20
> =20
>=20
> [Fri Mar 04
> 02:19:55.782 2011] [5964:6660] [info] init_jk::mod_jk.c (3198): mod_jk/1.=
2.31
> (1026297) initialized
>=20
> =20
>=20
> [Fri Mar 04
> 02:19:55.782 2011] [5964:6660] [error] uri_worker_map_ext::jk_uri_worker_=
map.c
> (506): Could not find worker with name 'loadbalancer' in uri map post
> processing.
>=20
> =20
>=20
> [Fri Mar 04
> 02:19:55.782 2011] [5964:6660] [error] uri_worker_map_ext::jk_uri_worker_=
map.c
> (506): Could not find worker with name 'loadbalancer' in uri map post
> processing.
>=20
> =20
>=20
> =20
>=20
> Here is the
> workers.properties file
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> =3D=3D=3DStart of
> workers.properties=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> # Licensed to the
> Apache Software Foundation (ASF) under one or more
>=20
> =20
>=20
> # contributor
> license agreements.  See the NOTICE file
> distributed with
>=20
> =20
>=20
> # this work for
> additional information regarding copyright ownership.
>=20
> =20
>=20
> # The ASF
> licenses this file to You under the Apache License=2C Version 2.0
>=20
> =20
>=20
> # (the
> "License")=3B you may not use this file except in compliance with
>=20
> =20
>=20
> # the
> License.  You may obtain a copy of the
> License at
>=20
> =20
>=20
> #
>=20
> =20
>=20
> #     http://www.apache.org/licenses/LICENSE-2.0
>=20
> =20
>=20
> #
>=20
> =20
>=20
> # Unless required
> by applicable law or agreed to in writing=2C software
>=20
> =20
>=20
> # distributed under
> the License is distributed on an "AS IS" BASIS=2C
>=20
> =20
>=20
> # WITHOUT
> WARRANTIES OR CONDITIONS OF ANY KIND=2C either express or implied.
>=20
> =20
>=20
> # See the License
> for the specific language governing permissions and
>=20
> =20
>=20
> # limitations
> under the License.
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> # Note that the
> distributed version of this file requires modification
>=20
> =20
>=20
> # before it is
> usable.
>=20
> =20
>=20
> #
>=20
> =20
>=20
> # Reference
> documentation: http://tomcat.apache.org/connectors-doc/reference/workers.=
html
>=20
> =20
>=20
> #
>=20
> =20
>=20
> # As a general
> note=2C the characters $( and ) are used internally to define
>=20
> =20
>=20
> # macros. Do not
> use them in your own configuration!!!
>=20
> =20
>=20
> #
>=20
> =20
>=20
> # Whenever you
> see a set of lines such as:
>=20
> =20
>=20
> # x=3Dvalue
>=20
> =20
>=20
> #
> y=3D$(x)\something
>=20
> =20
>=20
> #
>=20
> =20
>=20
> # the final value
> for y will be value\something
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> # Define two
> status worker:
>=20
> =20
>=20
> # - jk-status for
> read-only use
>=20
> =20
>=20
> # - jk-manager
> for read/write use
>=20
> =20
>=20
> worker.list=3Djk-status
>=20
> =20
>=20
> worker.jk-status.type=3Dstatus
>=20
> =20
>=20
> worker.jk-status.read_only=3Dtrue
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> worker.list=3Djk-manager
>=20
> =20
>=20
> worker.jk-manager.type=3Dstatus
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> # We define a
> load balancer worker
>=20
> =20
>=20
> # with name
> "balancer"
>=20
> =20
>=20
> worker.list=3Dbalancer
>=20
> =20
>=20
> worker.balancer.type=3Dlb
>=20
> =20
>=20
> #
> error_escalation_time: seconds=2C default =3D recover_time/2 (=3D30)
>=20
> =20
>=20
> # Determines=2C how
> fast a detected error should switch from
>=20
> =20
>=20
> # local error
> state to global error state
>=20
> =20
>=20
> # Since: 1.2.28
>=20
> =20
>=20
> worker.balancer.error_escalation_time=3D0
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> # -
> max_reply_timeouts: number=2C default=3D0
>=20
> =20
>=20
> #   If there are to many reply timeouts=2C a
> worker
>=20
> =20
>=20
> #   is put into the error state=2C i.e. it will
> become
>=20
> =20
>=20
> #   unavailable for all sessions residing on the
> respective
>=20
> =20
>=20
> #   Tomcat. The number of tolerated reply
> timeouts is
>=20
> =20
>=20
> #   configured with max_reply_timeouts. The
> number of
>=20
> =20
>=20
> #   timeouts occuring is divided by 2 once a
> minute and the
>=20
> =20
>=20
> #   resulting counter is compared against max_reply_timeouts.
>=20
> =20
>=20
> #   If you set max_reply_timeouts to N and the
> errors are
>=20
> =20
>=20
> #   occuring equally distributed over time=2C you
> will
>=20
> =20
>=20
> #   tolerate N/2 errors per minute. If they
> occur in a burst
>=20
> =20
>=20
> #   you will tolerate N errors.
>=20
> =20
>=20
> #   Since: 1.2.24
>=20
> =20
>=20
> worker.balancer.max_reply_timeouts=3D10
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> # Now we add
> members to the load balancer
>=20
> =20
>=20
> # First member is
> "node1"=2C most
>=20
> =20
>=20
> # attributes are
> inherited from the
>=20
> =20
>=20
> # template
> "worker.template".
>=20
> =20
>=20
> worker.balancer.balance_workers=3Dnode1
>=20
> =20
>=20
> worker.node1.reference=3Dworker.template
>=20
> =20
>=20
> worker.node1.host=3Dlocalhost
>=20
> =20
>=20
> worker.node1.port=3D8109
>=20
> =20
>=20
> # Activation
> allows to configure
>=20
> =20
>=20
> # whether this
> node should actually be used
>=20
> =20
>=20
> # A: active (use
> node fully)
>=20
> =20
>=20
> # D: disabled
> (only use=2C if sticky session needs this node)
>=20
> =20
>=20
> # S: stopped (do
> not use)
>=20
> =20
>=20
> #   Since: 1.2.19
>=20
> =20
>=20
> worker.node1.activation=3DA
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> # Second member
> is "node2"=2C most
>=20
> =20
>=20
> # attributes are
> inherited from the
>=20
> =20
>=20
> # template
> "worker.template".
>=20
> =20
>=20
> worker.balancer.balance_workers=3Dnode2
>=20
> =20
>=20
> worker.node2.reference=3Dworker.template
>=20
> =20
>=20
> worker.node2.host=3Dlocalhost
>=20
> =20
>=20
> worker.node2.port=3D8209
>=20
> =20
>=20
> # Activation
> allows to configure
>=20
> =20
>=20
> # whether this
> node should actually be used
>=20
> =20
>=20
> # A: active (use
> node fully)
>=20
> =20
>=20
> # D: disabled
> (only use=2C if sticky session needs this node)
>=20
> =20
>=20
> # S: stopped (do
> not use)
>=20
> =20
>=20
> #   Since: 1.2.19
>=20
> =20
>=20
> worker.node2.activation=3DA
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> # Finally we put
> the parameters
>=20
> =20
>=20
> # which should
> apply to all our ajp13
>=20
> =20
>=20
> # workers into
> the referenced template
>=20
> =20
>=20
> # - Type is ajp13
>=20
> =20
>=20
> worker.template.type=3Dajp13
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> # -
> socket_connect_timeout: milliseconds=2C default=3D0
>=20
> =20
>=20
> #   Since: 1.2.27
>=20
> =20
>=20
> worker.template.socket_connect_timeout=3D5000
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> # -
> socket_keepalive: boolean=2C default=3Dfalse
>=20
> =20
>=20
> #   Should we send TCP keepalive packets
>=20
> =20
>=20
> #   when connection is idle (socket option)?
>=20
> =20
>=20
> worker.template.socket_keepalive=3Dtrue
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> # - ping_mode:
> Character=2C default=3Dnone
>=20
> =20
>=20
> #   When should we use cping/cpong connection
> probing?
>=20
> =20
>=20
> #   C =3D directly after establishing a new
> connection
>=20
> =20
>=20
> #   P =3D directly before sending each request
>=20
> =20
>=20
> #   I =3D in regular intervals for idle
> connections
>=20
> =20
>=20
> #       using the watchdog thread
>=20
> =20
>=20
> #   A =3D all of the above
>=20
> =20
>=20
> #   Since: 1.2.27
>=20
> =20
>=20
> worker.template.ping_mode=3DA
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> # - ping_timeout:
> milliseconds=2C default=3D10000
>=20
> =20
>=20
> #   Wait timeout for cpong after cping
>=20
> =20
>=20
> #   Can be overwritten for modes C and P
>=20
> =20
>=20
> #   Using connect_timeout and prepost_timeout.
>=20
> =20
>=20
> #   Since: 1.2.27
>=20
> =20
>=20
> worker.template.ping_timeout=3D10000
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> # -
> connection_pool_minsize: number=2C default=3Dconnection_pool_size
>=20
> =20
>=20
> #   Lower pool size when shrinking pool due
>=20
> =20
>=20
> #   to idle connections
>=20
> =20
>=20
> #   We want all connections to be closed when
>=20
> =20
>=20
> #   idle for a long time in order to prevent
>=20
> =20
>=20
> #   firewall problems.
>=20
> =20
>=20
> #   Since: 1.2.16
>=20
> =20
>=20
> worker.template.connection_pool_minsize=3D0
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> # -
> connection_pool_timeout: seconds=2C default=3D0
>=20
> =20
>=20
> #   Idle time=2C before a connection is eligible
>=20
> =20
>=20
> #   for being closed (pool shrinking).
>=20
> =20
>=20
> #   This should be the same value as
> connectionTimeout
>=20
> =20
>=20
> #   in the Tomcat AJP connector=2C but there it is
>=20
> =20
>=20
> #   milliseconds=2C here seconds.
>=20
> =20
>=20
> worker.template.connection_pool_timeout=3D600
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> # -
> reply_timeout: milliseconds=2C default=3D0
>=20
> =20
>=20
> #   Any pause longer than this timeout during
> waiting
>=20
> =20
>=20
> #   for a part of the reply will abort handling
> the request
>=20
> =20
>=20
> #   in mod_jk. The request will proceed running
> in
>=20
> =20
>=20
> #   Tomcat=2C but the web server resources will be
> freed
>=20
> =20
>=20
> #   and an error is send to the client.
>=20
> =20
>=20
> #   For individual requests=2C the timeout can be
> overwritten
>=20
> =20
>=20
> #   by the Apache environment variable JK_REPLY_TIMEOUT.
>=20
> =20
>=20
> #   JK_REPLY_TIMEOUT since: 1.2.27
>=20
> =20
>=20
> worker.template.reply_timeout=3D300000
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> # -
> recovery_options: number=2C default=3D0
>=20
> =20
>=20
> #   Bit mask to configure=2C if a request=2C which
> was send
>=20
> =20
>=20
> #   to a backend successfully=2C should be retried
> on another backend
>=20
> =20
>=20
> #   in case there's a problem with the response.
>=20
> =20
>=20
> #   Value "3" disables retries=2C
> whenever a part of the request was
>=20
> =20
>=20
> #   successfully send to the backend.
>=20
> =20
>=20
> worker.template.recovery_options=3D3
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> =3D=3D=3DEnd of
> workers.properties=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D 		 	   		 =20
 		 	   		  =

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message