tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oscar Serrano <ose...@andromedical.com>
Subject Apache2 with JK2 with Tomcat5 multiple sendings from Apache to Tomcat5
Date Fri, 16 Jan 2004 17:27:04 GMT
Hi:
I've installed withou problems an Apache talking to a Tomcat via the jk2 
connector.
Everything seems to work fine but sometimes I click on a link and I get no 
response. Then I take a look at the logs and I see a very strange thing.
Apache is sending the request to Tomcat many times. Here is the log of 
mod_jk.log:

First you can see what is a normal connection:

[Fri Jan 16 17:14:00 2004]  [jk_uri_worker_map.c (486)]: Into 
jk_uri_worker_map_t::map_uri_to_worker
[Fri Jan 16 17:14:00 2004]  [jk_uri_worker_map.c (500)]: Attempting to map 
URI '/jsp-examples/jsp2/simpletag/book.jsp'
[Fri Jan 16 17:14:00 2004]  [jk_uri_worker_map.c (524)]: 
jk_uri_worker_map_t::map_uri_to_worker, Found a context match worker_principal
[Fri Jan 16 17:14:00 2004]  [mod_jk.c (1717)]: Into handler r->proxyreq=0 
r->handler=jakarta-servlet r->notes=135484688 worker=worker_pr
[Fri Jan 16 17:14:00 2004]  [jk_worker.c (132)]: Into 
wc_get_worker_for_name worker_principal
[Fri Jan 16 17:14:00 2004]  [jk_worker.c (136)]: wc_get_worker_for_name, 
done  found a worker
[Fri Jan 16 17:14:00 2004]  [mod_jk.c (505)]: agsp=80 agsn=10.0.0.102 
hostn=10.0.0.102 shostn=www.androlinux.com cbsport=80 sport=80
[Fri Jan 16 17:14:00 2004]  [jk_ajp_common.c (1686)]: Into 
jk_worker_t::get_endpoint
[Fri Jan 16 17:14:00 2004]  [jk_ajp_common.c (1319)]: Into 
jk_endpoint_t::service
[Fri Jan 16 17:14:00 2004]  [jk_ajp_common.c (295)]: Into 
ajp_marshal_into_msgb
[Fri Jan 16 17:14:00 2004]  [jk_ajp_common.c (463)]: ajp_marshal_into_msgb 
- Done
[Fri Jan 16 17:14:00 2004]  [jk_connect.c (188)]: Into jk_open_socket
[Fri Jan 16 17:14:00 2004]  [jk_connect.c (195)]: jk_open_socket, try to 
connect socket = 10
[Fri Jan 16 17:14:00 2004]  [jk_connect.c (204)]: jk_open_socket, after 
connect ret = 0
[Fri Jan 16 17:14:00 2004]  [jk_connect.c (213)]: jk_open_socket, set 
TCP_NODELAY to on
[Fri Jan 16 17:14:00 2004]  [jk_connect.c (230)]: jk_open_socket, return, 
sd = 10
[Fri Jan 16 17:14:00 2004]  [jk_ajp_common.c (738)]: In 
jk_endpoint_t::ajp_connect_to_endpoint, connected sd = 10
[Fri Jan 16 17:14:00 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #474
[Fri Jan 16 17:14:00 2004]  [jk_ajp_common.c (1064)]: ajp_send_request 2: 
request body to send 0 - request body to resend 0
[Fri Jan 16 17:14:00 2004]  [jk_ajp_common.c (885)]: received from ajp13 #60
[Fri Jan 16 17:14:00 2004]  [jk_ajp_common.c (515)]: 
ajp_unmarshal_response: status = 200
[Fri Jan 16 17:14:00 2004]  [jk_ajp_common.c (521)]: 
ajp_unmarshal_response: Number of headers is = 2
[Fri Jan 16 17:14:00 2004]  [jk_ajp_common.c (575)]: 
ajp_unmarshal_response: Header[0] [Content-Type] = [text/html]
[Fri Jan 16 17:14:00 2004]  [jk_ajp_common.c (575)]: 
ajp_unmarshal_response: Header[1] [Content-Length] = [896]
[Fri Jan 16 17:14:00 2004]  [jk_ajp_common.c (885)]: received from ajp13 #900
[Fri Jan 16 17:14:00 2004]  [mod_jk.c (406)]: writing 896 (896) out of 896
[Fri Jan 16 17:14:00 2004]  [jk_ajp_common.c (885)]: received from ajp13 #2
[Fri Jan 16 17:14:00 2004]  [jk_ajp_common.c (1661)]: Into 
jk_endpoint_t::done, recycling connection


And this is a failed request:

[Fri Jan 16 17:14:07 2004]  [jk_uri_worker_map.c (486)]: Into 
jk_uri_worker_map_t::map_uri_to_worker
[Fri Jan 16 17:14:07 2004]  [jk_uri_worker_map.c (500)]: Attempting to map 
URI '/jsp-examples/jsp2/simpletag/book.jsp'
[Fri Jan 16 17:14:07 2004]  [jk_uri_worker_map.c (524)]: 
jk_uri_worker_map_t::map_uri_to_worker, Found a context match worker_principal
[Fri Jan 16 17:14:07 2004]  [mod_jk.c (1717)]: Into handler r->proxyreq=0 
r->handler=jakarta-servlet r->notes=135484688 worker=worker_pr
[Fri Jan 16 17:14:07 2004]  [jk_worker.c (132)]: Into 
wc_get_worker_for_name worker_principal
[Fri Jan 16 17:14:07 2004]  [jk_worker.c (136)]: wc_get_worker_for_name, 
done  found a worker
[Fri Jan 16 17:14:07 2004]  [mod_jk.c (505)]: agsp=80 agsn=10.0.0.102 
hostn=10.0.0.102 shostn=www.androlinux.com cbsport=80 sport=80
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (1686)]: Into 
jk_worker_t::get_endpoint
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (1730)]: In 
jk_endpoint_t::ajp_get_endpoint, time elapsed since last request = 7 seconds
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (1319)]: Into 
jk_endpoint_t::service
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (295)]: Into 
ajp_marshal_into_msgb
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (463)]: ajp_marshal_into_msgb 
- Done
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313
[Fri Jan 16 17:14:07 2004]  [jk_ajp_common.c (774)]: sending to ajp13 #313


And in the tomcat access_log I see many request like this:

10.0.0.23 - - [16/Jan/2004:17:14:07 +0100] "GET 
/jsp-examples/jsp2/simpletag/book.jsp HTTP/1.1" 200 89
10.0.0.23 - - [16/Jan/2004:17:14:07 +0100] "GET 
/jsp-examples/jsp2/simpletag/book.jsp HTTP/1.1" 200 89
10.0.0.23 - - [16/Jan/2004:17:14:07 +0100] "GET 
/jsp-examples/jsp2/simpletag/book.jsp HTTP/1.1" 200 89
10.0.0.23 - - [16/Jan/2004:17:14:07 +0100] "GET 
/jsp-examples/jsp2/simpletag/book.jsp HTTP/1.1" 200 89
[and so on until 100 or more request]

As I've said not always fails :-?


Here I put my configuration files:
___________________________________________________

workers.properties:


workers.tomcat_home=/opt/tomcat5
workers.java_home=/opt/jdk_nb/j2sdk1.4.2
ps=/
worker.list=worker_principal

worker.worker_principal.port=8009
worker.worker_principal.host=localhost
worker.worker_principal.type=ajp13
worker.worker_principal.lbfactor=100

______________________________________________________

server.xml

<!-- Example Server Configuration File -->
<!-- Note that component elements are nested corresponding to their
      parent-child relationships with each other -->

<!-- A "Server" is a singleton element that represents the entire JVM,
      which may contain one or more "Service" instances.  The Server
      listens for a shutdown command on the indicated port.

      Note:  A "Server" is not itself a "Container", so you may not
      define subcomponents such as "Valves" or "Loggers" at this level.
  -->

<Server port="8005" shutdown="SHUTDOWN" debug="0">


   <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
             debug="0"/>
   <Listener 
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
             debug="0"/>

   <!-- Global JNDI resources -->
   <GlobalNamingResources>

     <!-- Test entry for demonstration purposes -->
     <Environment name="simpleValue" type="java.lang.Integer" value="30"/>

     <!-- Editable user database that can also be used by
          UserDatabaseRealm to authenticate users -->
     <Resource name="UserDatabase" auth="Container"
               type="org.apache.catalina.UserDatabase"
        description="User database that can be updated and saved">
     </Resource>
     <ResourceParams name="UserDatabase">
       <parameter>
         <name>factory</name>
         <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
       </parameter>
       <parameter>
         <name>pathname</name>
         <value>conf/tomcat-users.xml</value>
       </parameter>
     </ResourceParams>

   </GlobalNamingResources>


   <Service name="Catalina">

     <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
     <Connector port="8080"
                maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
                enableLookups="false" redirectPort="8443" acceptCount="100"
                debug="0" connectionTimeout="20000"
                disableUploadTimeout="true" />

     <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
     <Connector port="8009"
                enableLookups="false" redirectPort="8443" debug="0"
                protocol="AJP/1.3" />

     <Engine name="Catalina" defaultHost="localhost" debug="0">
        <Logger className="org.apache.catalina.logger.FileLogger"
               prefix="catalina_log." suffix=".txt"
               timestamp="true"/>

        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
                  debug="0" resourceName="UserDatabase"/>

        <Host name="localhost" debug="0" appBase="webapps"
           unpackWARs="true" autoDeploy="true"
           xmlValidation="false" xmlNamespaceAware="false">

           <Valve className="org.apache.catalina.valves.AccessLogValve"
                  directory="logs"  prefix="localhost_access_log." 
suffix=".txt"
                  pattern="common" resolveHosts="false"/>

           <Logger className="org.apache.catalina.logger.FileLogger"
                  directory="logs"  prefix="localhost_log." suffix=".txt"
                  timestamp="true"/>
        </Host>
     </Engine>
   </Service>
</Server>


____________________


httpd.conf


# Cargamos el modulo JK
#
LoadModule jk_module modules/mod_jk.so
#
# Configuramos el mod_jk
#
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel debug


JkMount /jsp-examples/* worker_principal




____________


Any help?


Thank you very much.



Oscar Serrano
http://www.andromedical.com


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message