You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ryan McConigley <ry...@csse.uwa.edu.au> on 2004/06/23 09:20:08 UTC

Apache2, Tomcat5 and mod_jk2 configuration problems

	Greetings,

	I have a problem.  I am trying to get Tomcat (5.0.25), Apache (2.0.49) and 
mod_jk2 (2.0.4) all to talk to each other under RedHat 9.0.

	So far I can get Apache up and working on port 80 and Tomcat works fine on 
port 8080.  However, my users want to be able to use .jsp pages on their 
virtual hosts.

	I did have it working fine on the old machine we had (Redhat 7.3, Apache 
1.3, Tomcat 4 and mod_jk) but we upgraded and now its not working.

	One thing I have noticed is when Tomcat starts up there is the message:
INFO: APR not loaded, disabling jni components: java.io.IOException: 
java.lang.UnsatisfiedLinkError: /usr/local/httpd-2.0.49/modules/jkjni.so: 
/usr/local/httpd-2.0.49/modules/jkjni.so: undefined symbol: apr_md5_final
	
	I assumed I was getting this because Apache was not compilied in with apr 
support, so I recompiled it with --with-apr and --with-apr-util.  Apache 
still works, but when I tried to recompile mod_jk2 it tells me now that my 
apxs can not be found, even though prior it was finding it ok and its quite 
clearly in the location specified.

	I'm not sure if that is a critical error or not or how to overcome it.  I 
have been trying different compile options, but still not getting much luck.

	When you click on a .jsp page, all that happens is the browser just sits 
there continually loading.  In the tomcat logs you get a line which says 
"INFO: No next" and thats it.

	Can anyone shed some light on my problem, before I do physical harm to the 
box in question.  The configuration files are as follows:   Also, can I 
have .jsp files enabled for some virtual servers and not for others, or is 
it an all or nothing affair?

----------------------worker2.properties--------------------------------
# workers2.properties

# Shared memory handling. Needs to be set.
[shm]
info=Scoreboard.  Required for reconfiguration and status with multiprocess 
servers
file=/usr/local/tomcat/logs/jk2.shm
size=1048576
debug=0
disabled=0

#UNIX domain socket
[channel.un:/usr/local/tomcat/work/jk2.socket]
tomcatId=localhst:8009
debug=0

# define the worker
#[ajp13:/usr/local/tomcat/work/jk2.socket]
#chanel=channel.un:/usr/local/tomcat/work/jk2.socket
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009

# Announce a "status" worker
pstatus:status]
info=Status worker.  Displays runtime information.

[uri:/jkstatus/*]
group=status:status

# Uri mapping
[uri:/examples/*]

[uri:projects.csse.uwa.edu.au/*.jsp]
worker=ajp13:localhost:8009
[uri:perth-agentcity.csse.uwa.edu.au/*.jsp]
worker=ajp13:localhost:8009

----------------------------------------------------------------------------
---------------jk2_mod.conf (included in the apache.conf file)--------------
# Sample mod_jk2.conf  08-Feb-2004, located at:
# http://www.gknw.com/development/apache/docs/win32/mod_jk2/mod_jk2x.conf
#
# Load the mod_jk2 module
#
LoadModule jk2_module modules/mod_jk2.so

<IfModule mod_jk2.c>

     #-----------------------------------------------
     # Set the Apache2 logger level
     #-----------------------------------------------
     #
     JkSet2 logger level debug

     #-----------------------------------------------
     # Set the alternate log file
     #-----------------------------------------------
     #
     JkSet2 logger.file:0 file ${serverRoot}/logs/jk2.log
     JkSet2 logger.file:0 level debug

     #-----------------------------------------------
     # Set the scoreboard file
     #-----------------------------------------------
     #
     JkSet2 shm: file ${serverRoot}/logs/jk2.shm
     JkSet2 shm: size 1048576

     #-----------------------------------------------
     # Where to find the workers2.properties file
     #-----------------------------------------------
     #
     #JkSet config.file ${serverRoot}/conf/workers2.properties

     #-----------------------------------------------
     # Alternatively setup the workers here
     #-----------------------------------------------
     #
     JkSet2 channel.socket:localhost:8009 info "Ajp13 forwarding over socket"
     JkSet2 status: info "Status worker, displays runtime information"
     JkSet2 workerEnv: logger logger.file:0

     #-----------------------------------------------
     # Configure the /jkstatus handler
     #-----------------------------------------------
     #
     <Location "/jkstatus">
         JkUriSet group status:
         JkUriSet info "Map the /jkstatus handler to the Web server uri space"
     </Location>

     #-----------------------------------------------
     # Configure Tomcat Example Applications
     #-----------------------------------------------
     #
     <Location "/examples">
         JkUriSet group lb:lb
         JkUriSet info "Map the Tomcat examples to the Web server uri space"
     </Location>

     #-----------------------------------------------
     # Configure Tomcat Documentation
     #-----------------------------------------------
     #
     <Location "/tomcat-docs">
         JkUriSet group lb:lb
         JkUriSet info "Map the Tomcat docs to the Web server uri space"
     </Location>

</IfModule>

#
----------------------------------------------------------------------
--------------   jk2.properties   ------------------------------------
# jk2.properties
# Configured for chennel UNIX

# Set the desired handler list
handler.list=spr,requiest,chennelUnix

# UNIX Domain socket location
chennelUnix.file=/usr/local/tomcat/work/jk2.socket

# Dynamic library
serverRoot=/etc/httpd
apr.NativeSo=/usr/local/httpd/modules/jkjni.so
-------------------------------------------------------------------------------

----------------------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">


   <!-- Comment these entries out to disable JMX MBeans support -->
   <!-- You may also configure custom components (e.g. Valves/Realms) by
        including your own mbean-descriptor file(s), and setting the
        "descriptors" attribute to point to a ';' seperated list of paths
        (in the ClassLoader sense) of files to add to the default list.
        e.g. descriptors="/com/myfirm/mypackage/mbean-descriptor.xml"
   -->
   <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>

   <!-- A "Service" is a collection of one or more "Connectors" that share
        a single "Container" (and therefore the web applications visible
        within that Container).  Normally, that Container is an "Engine",
        but this is not required.

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

   <!-- Define the Tomcat Stand-Alone Service -->
   <Service name="Catalina">

     <!-- A "Connector" represents an endpoint by which requests are received
          and responses are returned.  Each Connector passes requests on to the
          associated "Container" (normally an Engine) for processing.

          By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
          You can also enable an SSL HTTP/1.1 Connector on port 8443 by
          following the instructions below and uncommenting the second 
Connector
          entry.  SSL support requires the following steps (see the SSL Config
          HOWTO in the Tomcat 5 documentation bundle for more detailed
          instructions):
          * If your JDK version 1.3 or prior, download and install JSSE 
1.0.2 or
            later, and put the JAR files into "$JAVA_HOME/jre/lib/ext".
          * Execute:
              %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA 
(Windows)
              $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA  (Unix)
            with a password value of "changeit" for both the certificate and
            the keystore itself.

          By default, DNS lookups are enabled when a web application calls
          request.getRemoteHost().  This can have an adverse impact on
          performance, so you can disable it by setting the
          "enableLookups" attribute to "false".  When DNS lookups are disabled,
          request.getRemoteHost() will return the String version of the
          IP address of the remote client.
     -->

     <!-- 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" />
     <!-- Note : To disable connection timeouts, set connectionTimeout value
      to 0 -->

         <!-- Note : To use gzip compression you could set the following 
properties :

                            compression="on"
                            compressionMinSize="2048"
                            noCompressionUserAgents="gozilla, traviata"
                            compressableMimeType="text/html,text/xml"
         -->

     <!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
     <!--
     <Connector port="8443"
                maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
                enableLookups="false" disableUploadTimeout="true"
                acceptCount="100" debug="0" scheme="https" secure="true"
                clientAuth="false" sslProtocol="TLS" />
     -->

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

     <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
     <!-- See proxy documentation for more information about using this. -->
     <!--
     <Connector port="8082"
                maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
                enableLookups="false"
                acceptCount="100" debug="0" connectionTimeout="20000"
                proxyPort="80" disableUploadTimeout="true" />
     -->

     <!-- An Engine represents the entry point (within Catalina) that processes
          every request.  The Engine implementation for Tomcat stand alone
          analyzes the HTTP headers included with the request, and passes them
          on to the appropriate Host (virtual host). -->

     <!-- You should set jvmRoute to support load-balancing via JK/JK2 ie :
     <Engine name="Standalone" defaultHost="localhost" debug="0" 
jvmRoute="jvm1">
     -->

     <!-- Define the top level container in our container hierarchy -->
     <Engine name="Catalina" defaultHost="localhost" debug="0">

       <!-- The request dumper valve dumps useful debugging information about
            the request headers and cookies that were received, and the 
response
            headers and cookies that were sent, for all requests received by
            this instance of Tomcat.  If you care only about requests to a
            particular virtual host, or a particular application, nest this
            element inside the corresponding <Host> or <Context> entry instead.

            For a similar mechanism that is portable to all Servlet 2.4
            containers, check out the "RequestDumperFilter" Filter in the
            example application (the source for this filter may be found in
            "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").

            Request dumping is disabled by default.  Uncomment the following
            element to enable it. -->
       <!--
       <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
       -->

       <!-- Global logger unless overridden at lower levels -->
       <Logger className="org.apache.catalina.logger.FileLogger"
               prefix="catalina_log." suffix=".txt"
               timestamp="true"/>

       <!-- Because this Realm is here, an instance will be shared globally -->

       <!-- This Realm uses the UserDatabase configured in the global JNDI
            resources under the key "UserDatabase".  Any edits
            that are performed against this UserDatabase are immediately
            available for use by the Realm.  -->
       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
                  debug="0" resourceName="UserDatabase"/>

       <!-- Comment out the old realm but leave here for now in case we
            need to go back quickly -->
       <!--
       <Realm className="org.apache.catalina.realm.MemoryRealm" />
       -->

       <!-- Replace the above Realm with one of the following to get a Realm
            stored in a database and accessed via JDBC -->

       <!--
       <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
              driverName="org.gjt.mm.mysql.Driver"
           connectionURL="jdbc:mysql://localhost/authority"
          connectionName="test" connectionPassword="test"
               userTable="users" userNameCol="user_name" 
userCredCol="user_pass"
           userRoleTable="user_roles" roleNameCol="role_name" />
       -->

       <!--
       <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
              driverName="oracle.jdbc.driver.OracleDriver"
           connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
          connectionName="scott" connectionPassword="tiger"
               userTable="users" userNameCol="user_name" 
userCredCol="user_pass"
           userRoleTable="user_roles" roleNameCol="role_name" />
       -->

       <!--
       <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
              driverName="sun.jdbc.odbc.JdbcOdbcDriver"
           connectionURL="jdbc:odbc:CATALINA"
               userTable="users" userNameCol="user_name" 
userCredCol="user_pass"
           userRoleTable="user_roles" roleNameCol="role_name" />
       -->

       <!-- Define the default virtual host
            Note: XML Schema validation will not work with Xerces 2.2.
        -->
       <Host name="localhost" debug="0" appBase="webapps"
        unpackWARs="true" autoDeploy="true"
        xmlValidation="false" xmlNamespaceAware="false">

         <!-- Defines a cluster for this node,
              By defining this element, means that every manager will be 
changed.
              So when running a cluster, only make sure that you have 
webapps in there
              that need to be clustered and remove the other ones.
              A cluster has the following parameters:

              className = the fully qualified name of the cluster class

              name = a descriptive name for your cluster, can be anything

              debug = the debug level, higher means more output

              mcastAddr = the multicast address, has to be the same for all 
the nodes

              mcastPort = the multicast port, has to be the same for all 
the nodes

              mcastBindAddr = bind the multicast socket to a specific address

              mcastTTL = the multicast TTL if you want to limit your broadcast

              mcastSoTimeout = the multicast readtimeout

              mcastFrequency = the number of milliseconds in between 
sending a "I'm alive" heartbeat

              mcastDropTime = the number a milliseconds before a node is 
considered "dead" if no heartbeat is received

              tcpThreadCount = the number of threads to handle incoming 
replication requests, optimal would be the same amount of threads as nodes

              tcpListenAddress = the listen address (bind address) for TCP 
cluster request on this host,
                                 in case of multiple ethernet cards.
                                 auto means that address becomes
                                 InetAddress.getLocalHost().getHostAddress()

              tcpListenPort = the tcp listen port

              tcpSelectorTimeout = the timeout (ms) for the 
Selector.select() method in case the OS
                                   has a wakup bug in java.nio. Set to 0 
for no timeout

              printToScreen = true means that managers will also print to 
std.out

              expireSessionsOnShutdown = true means that

              useDirtyFlag = true means that we only replicate a session 
after setAttribute,removeAttribute has been called.
                             false means to replicate the session after 
each request.
                             false means that replication would work for 
the following piece of code:
                             <%
                             HashMap map = 
(HashMap)session.getAttribute("map");
                             map.put("key","value");
                             %>
              replicationMode = can be either 'pooled', 'synchronous' or 
'asynchronous'.
                                * Pooled means that the replication happens 
using several sockets in a synchronous way. Ie, the data gets replicated, 
then the request return. This is the same as the 'synchronous' setting 
except it uses a pool of sockets, hence it is multithreaded. This is the 
fastest and safest configuration. To use this, also increase the nr of tcp 
threads that you have dealing with replication.
                                * Synchronous means that the thread that 
executes the request, is also the
                                thread the replicates the data to the other 
nodes, and will not return until all
                                nodes have received the information.
                                * Asynchronous means that there is a 
specific 'sender' thread for each cluster node,
                                so the request thread will queue the 
replication request into a "smart" queue,
                                and then return to the client.
                                The "smart" queue is a queue where when a 
session is added to the queue, and the same session
                                already exists in the queue from a previous 
request, that session will be replaced
                                in the queue instead of replicating two 
requests. This almost never happens, unless there is a
                                large network delay.
         -->
         <!--
             When configuring for clustering, you also add in a valve to 
catch all the requests
             coming in, at the end of the request, the session may or may 
not be replicated.
             A session is replicated if and only if all the conditions are met:
             1. useDirtyFlag is true or setAttribute or removeAttribute has 
been called AND
             2. a session exists (has been created)
             3. the request is not trapped by the "filter" attribute

             The filter attribute is to filter out requests that could not 
modify the session,
             hence we don't replicate the session after the end of this 
request.
             The filter is negative, ie, anything you put in the filter, 
you mean to filter out,
             ie, no replication will be done on requests that match one of 
the filters.
             The filter attribute is delimited by ;, so you can't escape 
out ; even if you wanted to.

             filter=".*\.gif;.*\.js;" means that we will not replicate the 
session after requests with the URI
             ending with .gif and .js are intercepted.
         -->

         <!--
         <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
                  managerClassName="org.apache.catalina.cluster.session.DeltaManager"
                  expireSessionsOnShutdown="false"
                  useDirtyFlag="true">

             <Membership
                 className="org.apache.catalina.cluster.mcast.McastService"
                 mcastAddr="228.0.0.4"
                 mcastPort="45564"
                 mcastFrequency="500"
                 mcastDropTime="3000"/>

             <Receiver
                 className="org.apache.catalina.cluster.tcp.ReplicationListener"
                 tcpListenAddress="auto"
                 tcpListenPort="4001"
                 tcpSelectorTimeout="100"
                 tcpThreadCount="6"/>

             <Sender
                 className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
                 replicationMode="pooled"/>

             <Valve 
className="org.apache.catalina.cluster.tcp.ReplicationValve"
                    filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
         </Cluster>
         -->



         <!-- Normally, users must authenticate themselves to each web app
              individually.  Uncomment the following entry if you would like
              a user to be authenticated the first time they encounter a
              resource protected by a security constraint, and then have that
              user identity maintained across *all* web applications contained
              in this virtual host. -->
         <!--
         <Valve className="org.apache.catalina.authenticator.SingleSignOn"
                    debug="0"/>
         -->

         <!-- Access log processes all requests for this virtual host.  By
              default, log files are created in the "logs" directory 
relative to
              $CATALINA_HOME.  If you wish, you can specify a different
              directory with the "directory" attribute.  Specify either a 
relative
              (to $CATALINA_HOME) or absolute path to the desired directory.
         -->
         <!--
         <Valve className="org.apache.catalina.valves.AccessLogValve"
                  directory="logs"  prefix="localhost_access_log." 
suffix=".txt"
                  pattern="common" resolveHosts="false"/>
         -->

         <!-- Logger shared by all Contexts related to this virtual host.  By
              default (when using FileLogger), log files are created in the 
"logs"
              directory relative to $CATALINA_HOME.  If you wish, you can 
specify
              a different directory with the "directory" 
attribute.  Specify either a
              relative (to $CATALINA_HOME) or absolute path to the desired
              directory.-->
         <Logger className="org.apache.catalina.logger.FileLogger"
                  directory="logs"  prefix="localhost_log." suffix=".txt"
             timestamp="true"/>

       </Host>

       <!-- perth-agentcity.csse.uwa.edu.au  -->
       <Host name="perth-agentcity.csse.uwa.edu.au" debug="1"
                 appBase="/home/projects/misc/perth-agentcity/public_html"
                 unpackWARs="true">
       <!--  <Alias>perth-agentcity.csse.uwa.edu.au</Alias>         -->

         <!--<Valve className="org.apache.catalina.authenticator.SingleSignOn"
                    debug="0"/>
          -->

         <Logger className="org.apache.catalina.logger.FileLogger"
                  directory="logs"  prefix="perth-agentlog." suffix=".txt"
                 timestamp="true"/> -->

         <!--  Root Context -->
         <Context path="" docBase="" debug="1"/>

       </Host>
     </Engine>
   </Service>
</Server>

-------------------------------------------------------------------------------
--
           Ryan McConigley - Systems Administrator                  _.-,
      Computer Science   University of Western Australia        .--'  '-._
        Tel: (+61 8) 6488 7082 - Fax: (+61 8) 6488 1089       _/`-  _      '.
Ryan[@]csse.uwa.edu.au - http://www.csse.uwa.edu.au/~ryan  '----'._`.----. \
                                                                      `     \;
  "You're just jealous because the voices are talking to me"                ;_\




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


Re: Apache2, Tomcat5 and mod_jk2 configuration problems

Posted by Ryan McConigley <ry...@csse.uwa.edu.au>.
At 12:16 PM 24/06/2004 +0800, you wrote:
>Hi Ryan,
>
>I should have asked this earlier, but are you using the RPM version of 
>Apache or compiling the source tarball ? I notice that your directory is 
>/usr/local, which indicates that you are probably using the source tarball 
>(for RH9 rpms, it would be /etc/httpd).
>
>If you are using the source tarball, there are a LOT of things that are 
>different. I believe you are missing a package, hence the gdbm error. I 
>cannot recall at the moment what the name of the package is -- can you do 
>a search on rpmfind ? Another thing: apxs is located inside 
>/usr/local/httpd-2.0.49 -- just do a "find /usr/local/httpd-2.0.49 -name 
>apxs" to locate it.
>
>Did you do a Minimal install for Red Hat ? You will need to ensure that 
>you have the necessary packages installed. See this for a short list : 
>http://cymulacrum.net/writings/tomcat5/c875.html#JK2_INTEGRATION_SETUP
>
>You probably don't need apr and apr-util because you installed Apache from 
>source.

         I just got it working.  I had installed it from source, was a 
library problem.  Just writing up my documentation at the moment.  I'll 
send you a copy of that when I'm done.

         Cheers,
                 Ryan.

--
           Ryan McConigley - Systems Administrator                  _.-,
      Computer Science   University of Western Australia        .--'  '-._
        Tel: (+61 8) 6488 7082 - Fax: (+61 8) 6488 1089       _/`-  _      '.
Ryan[@]csse.uwa.edu.au - http://www.csse.uwa.edu.au/~ryan  '----'._`.----. \
                                                                      `     \;
  "You're just jealous because the voices are talking to me"                ;_\




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


Re: Apache2, Tomcat5 and mod_jk2 configuration problems

Posted by Ryan McConigley <ry...@csse.uwa.edu.au>.
At 12:16 PM 24/06/2004 +0800, you wrote:
>Hi Ryan,
>
>I should have asked this earlier, but are you using the RPM version of 
>Apache or compiling the source tarball ? I notice that your directory is 
>/usr/local, which indicates that you are probably using the source tarball 
>(for RH9 rpms, it would be /etc/httpd).
>
>If you are using the source tarball, there are a LOT of things that are 
>different. I believe you are missing a package, hence the gdbm error. I 
>cannot recall at the moment what the name of the package is -- can you do 
>a search on rpmfind ? Another thing: apxs is located inside 
>/usr/local/httpd-2.0.49 -- just do a "find /usr/local/httpd-2.0.49 -name 
>apxs" to locate it.
>
>Did you do a Minimal install for Red Hat ? You will need to ensure that 
>you have the necessary packages installed. See this for a short list : 
>http://cymulacrum.net/writings/tomcat5/c875.html#JK2_INTEGRATION_SETUP
>
>You probably don't need apr and apr-util because you installed Apache from 
>source.

         As promised, here are my notes on installing mod_jk2 with Apache 
2.0.49 and Tomcat 5.0.25.  This is under RedHat 9.0 and the paths and 
things are a straight cut and paste from my system here, so may not match 
up for all accounts.  Key problem I had was the libraries, once that was 
figured out it was some minor typos in the configuration files, and then 
its all up and going now.

         Cheers,
                 Ryan.

         Notes -->

mod_jk2         (tomcat connector)

         Download mod_jk2

                 http://apache.ausgamers.com/jakarta/tomcat-connectors/jk2/source/jakarta-tomcat-connectors-jk2-2.0.4-src.tar.gz

         Check the 
http://apache.ausgamers.com/jakarta/tomcat-connectors/jk2/ page for 
information/status on mod_jk2

         Uncompress the archive
                 gzip -dc jakarta-tomcat-connectors-jk2-2.0.4-src.tar.gz | 
tar -xvf -

         Compile
                 cd to 
/usr/local/src/jakarta-tomcat-connectors-jk2-2.0.4-src/jk/native2

                 ./configure --with-apxs2=/usr/local/httpd/bin/apxs 
--with-apr-lib=/usr/lib --with-tomcat-41=/usr/local/tomcat 
--with-java-home=/usr/java/jdk --with-jni

                 edit ./server/apache2/Makefile
                         Find the block -->
                                 ifdef APR_LIBDIR_LA
                                 JK_LDFLAGS=-L${APACHE2_LIBDIR} -lcrypt
                                 else
                                 JK_LDFLAGS=-lcrypt ${APR_LIBS}
                                 endif

                         And change it to this:

                                 ifdef APR_LIBDIR_LA
                                 JK_LDFLAGS=-L${APACHE2_LIBDIR} -lcrypt
                                 else
                                 JK_LDFLAGS=-lcrypt ${APR_LIBS} 
JK_LDFLAGS=-lcrypt ${APR_LIBS} -L/usr/local/httpd-2.0.49/lib -laprutil-0 
-lgdbm -ldb-4.0 -lexpat
                                 endif

                 Note the extra LDFLAGS --> JK_LDFLAGS=-lcrypt ${APR_LIBS} 
-L/usr/local/httpd-2.0.49/lib -laprutil-0 -lgdbm -ldb-4.0 -lexpat


                 To know what flags to add, run
                                 apu-config --link-ld --libs
                         That will output something like
                                  -L/usr/lib -laprutil-0 -lgdbm -lexpat

                 Then check the version of apu-config.  I discovered that I 
had two versions.  One in
                         /usr/bin and another in /usr/local/httpd/bin/

                         /usr/bin/apu-config --link-ld --libs
                          -L/usr/lib -laprutil-0 -lgdbm -lexpat

                         /usr/local/httpd/bin/apu-config --link-ld --libs
                          -L/usr/local/httpd/bin -laprutil-0 -lgdbm 
-ldb-4.2 -lexpat

                 When I tried adding the "-ldb-4.2" flag it didn't like it, 
so I did a bit of a search and tried
                          -L/usr/local/httpd/bin -laprutil-0 -lgdbm 
-ldb-4.0 -lexpat
                 instead which worked.  (I think the path for db-4.2 may 
need to be added to my /etc/ld.so.conf file?)


                 cd ../build/jk2/apache2

         Run apxs
                 /usr/local/httpd/bin/apxs -n jk2 -i mod_jk2.so

         Should see something like:
                 [root@projects apache2]# /usr/local/httpd/bin/apxs -n jk2 
-i mod_jk2.so
                 /usr/local/httpd-2.0.49/build/instdso.sh 
SH_LIBTOOL='/usr/local/httpd-2.0.49/build/libtool' mod_jk2.so 
/usr/local/httpd-2.0.49/modules
                 /usr/local/httpd-2.0.49/build/libtool --mode=install cp 
mod_jk2.so /usr/local/httpd-2.0.49/modules/
                 cp mod_jk2.so /usr/local/httpd-2.0.49/modules/mod_jk2.so
                 Warning!  dlname not found in 
/usr/local/httpd-2.0.49/modules/mod_jk2.so.
                 Assuming installing a .so rather than a libtool archive.
                 chmod 755 /usr/local/httpd-2.0.49/modules/mod_jk2.so

         Copy the created share object modules to the apache module directory
                 cp libjkjni.so /usr/local/httpd/modules/jkjni.so
                 cp mod_jk2.so /usr/local/httpd/modules/
                 ************** - Notice the rename of libjkjni.so 
***************************
         -----------------------------------------------------------------------------------------

         Debugging tips.
                 Check the linked in libraries to make sure you get all you 
need

         Check the correct libraries were compilied in -->
                 ldd /usr/local/httpd/modules/jkjni.so
                         libcrypt.so.1 => /lib/libcrypt.so.1 (0x40046000)
                         libapr-0.so.0 => 
/usr/local/httpd-2.0.49/lib/libapr-0.so.0 (0x40074000)
                         libaprutil-0.so.0 => 
/usr/local/httpd-2.0.49/lib/libaprutil-0.so.0 (0x40097000)
                         libgdbm.so.2 => /usr/lib/libgdbm.so.2 (0x400ab000)
                         libdb-4.0.so => /lib/libdb-4.0.so (0x400b2000)
                         libexpat.so.0 => /usr/lib/libexpat.so.0 (0x4015a000)
                         libc.so.6 => /lib/i686/libc.so.6 (0x4017a000)
                         librt.so.1 => /lib/i686/librt.so.1 (0x402b4000)
                         libm.so.6 => /lib/i686/libm.so.6 (0x402c6000)
                         libnsl.so.1 => /lib/libnsl.so.1 (0x402e8000)
                         libpthread.so.0 => /lib/i686/libpthread.so.0 
(0x402fd000)
                         libdl.so.2 => /lib/libdl.so.2 (0x4034d000)
                         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

         To see what libraries are needed, run:
                 apu-config --link-ld --libs

         But beware, the apu-config in the default path, may not be the one 
used.

         --------------------------------------------------------------------------------------------- 

--
           Ryan McConigley - Systems Administrator                  _.-,
      Computer Science   University of Western Australia        .--'  '-._
        Tel: (+61 8) 6488 7082 - Fax: (+61 8) 6488 1089       _/`-  _      '.
Ryan[@]csse.uwa.edu.au - http://www.csse.uwa.edu.au/~ryan  '----'._`.----. \
                                                                      `     \;
  "You're just jealous because the voices are talking to me"                ;_\




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


Re: Apache2, Tomcat5 and mod_jk2 configuration problems

Posted by Chong Yu Meng <ch...@cymulacrum.net>.
Hi Ryan,

I should have asked this earlier, but are you using the RPM version of 
Apache or compiling the source tarball ? I notice that your directory is 
/usr/local, which indicates that you are probably using the source 
tarball (for RH9 rpms, it would be /etc/httpd).

If you are using the source tarball, there are a LOT of things that are 
different. I believe you are missing a package, hence the gdbm error. I 
cannot recall at the moment what the name of the package is -- can you 
do a search on rpmfind ? Another thing: apxs is located inside 
/usr/local/httpd-2.0.49 -- just do a "find /usr/local/httpd-2.0.49 -name 
apxs" to locate it.

Did you do a Minimal install for Red Hat ? You will need to ensure that 
you have the necessary packages installed. See this for a short list : 
http://cymulacrum.net/writings/tomcat5/c875.html#JK2_INTEGRATION_SETUP

You probably don't need apr and apr-util because you installed Apache 
from source.

Regards,
pascal chong


Ryan McConigley wrote:

> At 10:09 PM 23/06/2004 +0800, you wrote:
>
>> Hi Ryan,
>>
>> It sounds like an error similar to one Andrew Clute encountered on 
>> Red Hat Enterprise Linux 3 (apr_md5_final). I transcribed some of the 
>> steps he took here : http://cymulacrum.net/writings/tomcat5/a1375.html
>>
>> Can you test it first ? If it works, I would like to add a comment to 
>> the document that says that the steps apply to Red Hat 9 as well.
>>
>> Regards,
>> pascal chong
>
>
>         Thanks for that.  I gave that a whirl, putting in the extra 
> library and that solved the problem of the "undefined symbol 
> apr_md5_final" error, but now I'm getting the following error instead:
>
> INFO: APR not loaded, disabling jni components: java.io.IOException: 
> java.lang.UnsatisfiedLinkError: 
> /usr/local/httpd-2.0.49/modules/jkjni.so: 
> /usr/local/httpd-2.0.49/lib/libaprutil-0.so.0: undefined symbol: 
> gdbm_errno
>
>         Which would appear that that linked library isn't correct.
>
>         Any hints?
>
>
>
>
>> Ryan McConigley wrote:
>>
>>>
>>>     Greetings,
>>>
>>>     I have a problem.  I am trying to get Tomcat (5.0.25), Apache 
>>> (2.0.49) and mod_jk2 (2.0.4) all to talk to each other under RedHat 
>>> 9.0.
>>>
>>>     So far I can get Apache up and working on port 80 and Tomcat 
>>> works fine on port 8080.  However, my users want to be able to use 
>>> .jsp pages on their virtual hosts.
>>>
>>>     I did have it working fine on the old machine we had (Redhat 
>>> 7.3, Apache 1.3, Tomcat 4 and mod_jk) but we upgraded and now its 
>>> not working.
>>>
>>>     One thing I have noticed is when Tomcat starts up there is the 
>>> message:
>>> INFO: APR not loaded, disabling jni components: java.io.IOException: 
>>> java.lang.UnsatisfiedLinkError: 
>>> /usr/local/httpd-2.0.49/modules/jkjni.so: 
>>> /usr/local/httpd-2.0.49/modules/jkjni.so: undefined symbol: 
>>> apr_md5_final
>>>
>>>     I assumed I was getting this because Apache was not compilied in 
>>> with apr support, so I recompiled it with --with-apr and 
>>> --with-apr-util.  Apache still works, but when I tried to recompile 
>>> mod_jk2 it tells me now that my apxs can not be found, even though 
>>> prior it was finding it ok and its quite clearly in the location 
>>> specified.
>>>
>>>     I'm not sure if that is a critical error or not or how to 
>>> overcome it.  I have been trying different compile options, but 
>>> still not getting much luck.
>>>
>>>     When you click on a .jsp page, all that happens is the browser 
>>> just sits there continually loading.  In the tomcat logs you get a 
>>> line which says "INFO: No next" and thats it.
>>>
>>>     Can anyone shed some light on my problem, before I do physical 
>>> harm to the box in question.  The configuration files are as 
>>> follows:   Also, can I have .jsp files enabled for some virtual 
>>> servers and not for others, or is it an all or nothing affair?
>>
>
>         <*snip*>
> -- 
>           Ryan McConigley - Systems Administrator                  _.-,
>      Computer Science   University of Western Australia        .--'  '-._
>        Tel: (+61 8) 6488 7082 - Fax: (+61 8) 6488 1089       _/`-  
> _      '.
> Ryan[@]csse.uwa.edu.au - http://www.csse.uwa.edu.au/~ryan  
> '----'._`.----. \
>                                                                      
> `     \;
>  "You're just jealous because the voices are talking to 
> me"                ;_\
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>


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


Re: Apache2, Tomcat5 and mod_jk2 configuration problems

Posted by Ryan McConigley <ry...@csse.uwa.edu.au>.
At 10:09 PM 23/06/2004 +0800, you wrote:
>Hi Ryan,
>
>It sounds like an error similar to one Andrew Clute encountered on Red Hat 
>Enterprise Linux 3 (apr_md5_final). I transcribed some of the steps he 
>took here : http://cymulacrum.net/writings/tomcat5/a1375.html
>
>Can you test it first ? If it works, I would like to add a comment to the 
>document that says that the steps apply to Red Hat 9 as well.
>
>Regards,
>pascal chong

         Thanks for that.  I gave that a whirl, putting in the extra 
library and that solved the problem of the "undefined symbol apr_md5_final" 
error, but now I'm getting the following error instead:

INFO: APR not loaded, disabling jni components: java.io.IOException: 
java.lang.UnsatisfiedLinkError: /usr/local/httpd-2.0.49/modules/jkjni.so: 
/usr/local/httpd-2.0.49/lib/libaprutil-0.so.0: undefined symbol: gdbm_errno

         Which would appear that that linked library isn't correct.

         Any hints?




>Ryan McConigley wrote:
>
>>
>>     Greetings,
>>
>>     I have a problem.  I am trying to get Tomcat (5.0.25), Apache 
>> (2.0.49) and mod_jk2 (2.0.4) all to talk to each other under RedHat 9.0.
>>
>>     So far I can get Apache up and working on port 80 and Tomcat works 
>> fine on port 8080.  However, my users want to be able to use .jsp pages 
>> on their virtual hosts.
>>
>>     I did have it working fine on the old machine we had (Redhat 7.3, 
>> Apache 1.3, Tomcat 4 and mod_jk) but we upgraded and now its not working.
>>
>>     One thing I have noticed is when Tomcat starts up there is the message:
>>INFO: APR not loaded, disabling jni components: java.io.IOException: 
>>java.lang.UnsatisfiedLinkError: /usr/local/httpd-2.0.49/modules/jkjni.so: 
>>/usr/local/httpd-2.0.49/modules/jkjni.so: undefined symbol: apr_md5_final
>>
>>     I assumed I was getting this because Apache was not compilied in 
>> with apr support, so I recompiled it with --with-apr and 
>> --with-apr-util.  Apache still works, but when I tried to recompile 
>> mod_jk2 it tells me now that my apxs can not be found, even though prior 
>> it was finding it ok and its quite clearly in the location specified.
>>
>>     I'm not sure if that is a critical error or not or how to overcome 
>> it.  I have been trying different compile options, but still not getting 
>> much luck.
>>
>>     When you click on a .jsp page, all that happens is the browser just 
>> sits there continually loading.  In the tomcat logs you get a line which 
>> says "INFO: No next" and thats it.
>>
>>     Can anyone shed some light on my problem, before I do physical harm 
>> to the box in question.  The configuration files are as follows:   Also, 
>> can I have .jsp files enabled for some virtual servers and not for 
>> others, or is it an all or nothing affair?

         <*snip*>
--
           Ryan McConigley - Systems Administrator                  _.-,
      Computer Science   University of Western Australia        .--'  '-._
        Tel: (+61 8) 6488 7082 - Fax: (+61 8) 6488 1089       _/`-  _      '.
Ryan[@]csse.uwa.edu.au - http://www.csse.uwa.edu.au/~ryan  '----'._`.----. \
                                                                      `     \;
  "You're just jealous because the voices are talking to me"                ;_\




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


tomcat crash ... "unexpected exception"

Posted by ba...@bpo.be.
Hi,

I have serious problems with my web aplpication (based on Apache/Tomcat), I'm a system guy 
and I'd like at least to identify where the problem is situated: system, memory, db, 
application itself, etc., but I'm not related at all to JSP or Java stuff ...

Well, here is my situation :
Apache 2.0.49 (compiled --with-mpm=worker)
Tomcat 4.1.30
mod_jk 2.0.2
Java SDK 1.4.2_02

Apache is configured to serve all requests (static) except .jsp which are transmitted to
tomcat through mod_jk2.

Here below is a copy of the error in catalina.out. Before the "unexpected exception" you
see client transactions, labeled with "ITS*", meaning clients navigate through
menus in the app, etc., then you see the exception, then somebody (huh ... me) restart all 
the stuff and it continues with normal transactions ...

the error (sorry for length) :
---------------------------------------------------------------------
(... transactions ...)
[2004-06-16 22:33:51] ITY2(0) 20ms
[2004-06-16 22:33:51] ITS6(0) 82ms
[2004-06-16 22:33:51] ITHZ(0) 16ms
[2004-06-16 22:33:51] ITA3(0) 144ms
[2004-06-16 22:33:51] ITHZ(0) 6ms
[2004-06-16 22:33:51] ITS3(0) 260ms
[2004-06-16 22:33:51] ITS3(0) 169ms

An unexpected exception has been detected in native code outside the VMn.
Unexpected Signal : 11 occurred at PC=0xFFFFFFFF7EF499A4
Function=[Unknown. Nearest: madvise+0xC0]
Library=/usr/lib/64/libc.so.1

Current Java thread:
         at appweb.NativeCall.Call_C_tpcall(Native Method)
         at appweb.NativeCall.tp_call(NativeCall.java:58)
         at appweb.AppwebDispatcher$ObjectApartment.get_result(AppwebDispatcher.java:345)
         at appweb.AppwebDispatcher$ObjectApartment.run(AppwebDispatcher.java:306)

Dynamic libraries:
0x100000000     /aplication/java/bin/sparcv9/java
0xffffffff7f300000      /usr/lib/64/libthread.so.1
0xffffffff7f500000      /usr/lib/64/libdl.so.1
0xffffffff7ef00000      /usr/lib/64/libc.so.1
0xffffffff7d400000      /aplication/j2sdk1.4.2_04/jre/lib/sparcv9/server/libjvm.so
0xffffffff7d200000      /usr/lib/64/libCrun.so.1
0xffffffff7cf00000      /usr/lib/64/libsocket.so.1
0xffffffff7cd00000      /usr/lib/64/libnsl.so.1
0xffffffff7cb00000      /usr/lib/64/libm.so.1
0xffffffff7c900000      /usr/lib/64/libsched.so.1
0xffffffff7ed00000      /usr/lib/64/libw.so.1
0xffffffff7c500000      /usr/lib/64/libmp.so.2
0xffffffff7c200000      /aplication/j2sdk1.4.2_04/jre/lib/sparcv9/native_threads/libhpi.so
0xffffffff7be00000      /aplication/j2sdk1.4.2_04/jre/lib/sparcv9/libverify.so
0xffffffff7bc00000      /aplication/j2sdk1.4.2_04/jre/lib/sparcv9/libjava.so
0xffffffff7b900000      /aplication/j2sdk1.4.2_04/jre/lib/sparcv9/libzip.so
0xfffffffdae800000      /aplication/j2sdk1.4.2_04/jre/lib/sparcv9/libnet.so
0xfffffffdac900000      /aplication/thalerv1.4/webapps/appweb/nativecall/libnativecall.so
0xfffffffdac700000      /tuxweb/lib/libwsc.so.71
0xfffffffdac500000      /tuxweb/lib/libbuft.so.71
0xfffffffdac200000      /tuxweb/lib/libgpnet.so.71
0xfffffffdac000000      /tuxweb/lib/libfml.so.71
0xfffffffdabe00000      /tuxweb/lib/libfml32.so.71
0xfffffffdabb00000      /tuxweb/lib/libengine.so.71
0xfffffffdab900000      /usr/lib/64/libpthread.so.1
0xfffffffdab600000      /usr/lib/64/librt.so.1
0xfffffffdab400000      /usr/lib/64/libaio.so.1
0xfffffffdaa700000      /tuxweb/lib/registry.so

Heap at VM Abort:
Heap
  def new generation   total 1158784K, used 1150571K [0xfffffffdb3800000,
0xfffffffdfc5e0000, 0xfffffffe33800000)
   eden space 1123712K,  54% used [0xfffffffdb3800000, 0xfffffffdf795afc0,
0xfffffffdf8160000)
   from space 35072K, 100% used [0xfffffffdf8160000, 0xfffffffdfa3a0000, 0xfffffffdfa3a0000)
   to   space 35072K,   0% used [0xfffffffdfa3a0000, 0xfffffffdfa3a0000, 0xfffffffdfc5e0000)
  tenured generation   total 2387632K, used 1880586K [0xfffffffe33800000,
0xfffffffec53ac000, 0xffffffff33800000)
    the space 2387632K,  78% used [0xfffffffe33800000, 0xfffffffea6482b68,
0xfffffffea6482c00, 0xfffffffec53ac000)
  compacting perm gen  total 16384K, used 13651K [0xffffffff33800000, 0xffffffff34800000,
0xffffffff37800000)
    the space 16384K,  83% used [0xffffffff33800000, 0xffffffff34554d08,
0xffffffff34554e00, 0xffffffff34800000)

Starting service Tomcat
Apache Tomcat/4.1.30
Jun 17, 2004 12:28:17 AM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Jun 17, 2004 12:28:17 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=1/116  config=null
Jun 17, 2004 12:28:17 AM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8010
Jun 17, 2004 12:28:17 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/6  config=null
Dynamic Library nativecall loaded
Dispatcher constructor
WSCLIENTS=5
THREADSPERCLIENTS=3
Thread[Thread-13,5,main]: Starting...
Thread[Thread-14,5,main]: Starting...
Thread[Thread-15,5,main]: Starting...
Thread[Thread-16,5,main]: Starting...
Thread[Thread-17,5,main]: Starting...
Thread[Thread-18,5,main]: Starting...
Thread[Thread-19,5,main]: Starting...
Thread[Thread-20,5,main]: Starting...
Thread[Thread-21,5,main]: Starting...
Thread[Thread-22,5,main]: Starting...
Thread[Thread-23,5,main]: Starting...
Thread[Thread-24,5,main]: Starting...
Thread[Thread-25,5,main]: Starting...
Thread[Thread-26,5,main]: Starting...
Thread[Thread-27,5,main]: Starting...
Using Tuxedo server at address WSNADDR=0x00023334C0A8F9EA
Using user INTERNET-0
Using passwd qwerty
Using client UNIX-JSP
Using Tuxedo server at address WSNADDR=0x00023334C0A8F9EA
Using user INTERNET-1
Using passwd qwerty
Using client UNIX-JSP
Using Tuxedo server at address WSNADDR=0x00023334C0A8F9EA
Using user INTERNET-2
Using passwd qwerty
Using client UNIX-JSP
Using Tuxedo server at address WSNADDR=0x00023334C0A8F9EA
Using user INTERNET-3
Using passwd qwerty
Using client UNIX-JSP
Using Tuxedo server at address WSNADDR=0x00023334C0A8F9EA
Using user INTERNET-4
Using passwd qwerty
Using client UNIX-JSP
[2004-06-17 00:28:33] ITZZ(0) 4423ms
[2004-06-17 00:28:38] ITZZ(0) 22ms
[2004-06-17 00:28:38] ITZZ(0) 8ms
[2004-06-17 00:28:38] ITZZ(0) 12ms
[2004-06-17 00:28:38] ITZZ(0) 9ms
(... transactions ...)
---------------------------------------------------------------------

At the same time in Apache error log, I see of course that it can't connect to ajp13
connector, which is obvious.
The transactional server (with DB) is another machine than the webserver.

Above I see "from space 35072K, 100% used". I don't know anything about how java is 
managing his memory, but "100%" doesn't look good, isn't it ?
Anyway java runs with JAVA_OPTS=-Xms5120m -Xmx6144m, so it has more than 5Gb RAM to run !!

Do I have to look into apache/tomcat configuration ?
into the  application code itself ?
both ?

I'm a bit lost ...

Any available help would be very appreciated.

Thanks,

Bastien.

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


Re: Apache2, Tomcat5 and mod_jk2 configuration problems

Posted by Chong Yu Meng <ch...@cymulacrum.net>.
Hi Ryan,

It sounds like an error similar to one Andrew Clute encountered on Red 
Hat Enterprise Linux 3 (apr_md5_final). I transcribed some of the steps 
he took here : http://cymulacrum.net/writings/tomcat5/a1375.html

Can you test it first ? If it works, I would like to add a comment to 
the document that says that the steps apply to Red Hat 9 as well.

Regards,
pascal chong


Ryan McConigley wrote:

>
>     Greetings,
>
>     I have a problem.  I am trying to get Tomcat (5.0.25), Apache 
> (2.0.49) and mod_jk2 (2.0.4) all to talk to each other under RedHat 9.0.
>
>     So far I can get Apache up and working on port 80 and Tomcat works 
> fine on port 8080.  However, my users want to be able to use .jsp 
> pages on their virtual hosts.
>
>     I did have it working fine on the old machine we had (Redhat 7.3, 
> Apache 1.3, Tomcat 4 and mod_jk) but we upgraded and now its not working.
>
>     One thing I have noticed is when Tomcat starts up there is the 
> message:
> INFO: APR not loaded, disabling jni components: java.io.IOException: 
> java.lang.UnsatisfiedLinkError: 
> /usr/local/httpd-2.0.49/modules/jkjni.so: 
> /usr/local/httpd-2.0.49/modules/jkjni.so: undefined symbol: apr_md5_final
>     
>     I assumed I was getting this because Apache was not compilied in 
> with apr support, so I recompiled it with --with-apr and 
> --with-apr-util.  Apache still works, but when I tried to recompile 
> mod_jk2 it tells me now that my apxs can not be found, even though 
> prior it was finding it ok and its quite clearly in the location 
> specified.
>
>     I'm not sure if that is a critical error or not or how to overcome 
> it.  I have been trying different compile options, but still not 
> getting much luck.
>
>     When you click on a .jsp page, all that happens is the browser 
> just sits there continually loading.  In the tomcat logs you get a 
> line which says "INFO: No next" and thats it.
>
>     Can anyone shed some light on my problem, before I do physical 
> harm to the box in question.  The configuration files are as 
> follows:   Also, can I have .jsp files enabled for some virtual 
> servers and not for others, or is it an all or nothing affair?
>
> ----------------------worker2.properties--------------------------------
> # workers2.properties
>
> # Shared memory handling. Needs to be set.
> [shm]
> info=Scoreboard.  Required for reconfiguration and status with 
> multiprocess servers
> file=/usr/local/tomcat/logs/jk2.shm
> size=1048576
> debug=0
> disabled=0
>
> #UNIX domain socket
> [channel.un:/usr/local/tomcat/work/jk2.socket]
> tomcatId=localhst:8009
> debug=0
>
> # define the worker
> #[ajp13:/usr/local/tomcat/work/jk2.socket]
> #chanel=channel.un:/usr/local/tomcat/work/jk2.socket
> [ajp13:localhost:8009]
> channel=channel.socket:localhost:8009
>
> # Announce a "status" worker
> pstatus:status]
> info=Status worker.  Displays runtime information.
>
> [uri:/jkstatus/*]
> group=status:status
>
> # Uri mapping
> [uri:/examples/*]
>
> [uri:projects.csse.uwa.edu.au/*.jsp]
> worker=ajp13:localhost:8009
> [uri:perth-agentcity.csse.uwa.edu.au/*.jsp]
> worker=ajp13:localhost:8009
>
> ---------------------------------------------------------------------------- 
>
> ---------------jk2_mod.conf (included in the apache.conf 
> file)--------------
> # Sample mod_jk2.conf  08-Feb-2004, located at:
> # http://www.gknw.com/development/apache/docs/win32/mod_jk2/mod_jk2x.conf
> #
> # Load the mod_jk2 module
> #
> LoadModule jk2_module modules/mod_jk2.so
>
> <IfModule mod_jk2.c>
>
>     #-----------------------------------------------
>     # Set the Apache2 logger level
>     #-----------------------------------------------
>     #
>     JkSet2 logger level debug
>
>     #-----------------------------------------------
>     # Set the alternate log file
>     #-----------------------------------------------
>     #
>     JkSet2 logger.file:0 file ${serverRoot}/logs/jk2.log
>     JkSet2 logger.file:0 level debug
>
>     #-----------------------------------------------
>     # Set the scoreboard file
>     #-----------------------------------------------
>     #
>     JkSet2 shm: file ${serverRoot}/logs/jk2.shm
>     JkSet2 shm: size 1048576
>
>     #-----------------------------------------------
>     # Where to find the workers2.properties file
>     #-----------------------------------------------
>     #
>     #JkSet config.file ${serverRoot}/conf/workers2.properties
>
>     #-----------------------------------------------
>     # Alternatively setup the workers here
>     #-----------------------------------------------
>     #
>     JkSet2 channel.socket:localhost:8009 info "Ajp13 forwarding over 
> socket"
>     JkSet2 status: info "Status worker, displays runtime information"
>     JkSet2 workerEnv: logger logger.file:0
>
>     #-----------------------------------------------
>     # Configure the /jkstatus handler
>     #-----------------------------------------------
>     #
>     <Location "/jkstatus">
>         JkUriSet group status:
>         JkUriSet info "Map the /jkstatus handler to the Web server uri 
> space"
>     </Location>
>
>     #-----------------------------------------------
>     # Configure Tomcat Example Applications
>     #-----------------------------------------------
>     #
>     <Location "/examples">
>         JkUriSet group lb:lb
>         JkUriSet info "Map the Tomcat examples to the Web server uri 
> space"
>     </Location>
>
>     #-----------------------------------------------
>     # Configure Tomcat Documentation
>     #-----------------------------------------------
>     #
>     <Location "/tomcat-docs">
>         JkUriSet group lb:lb
>         JkUriSet info "Map the Tomcat docs to the Web server uri space"
>     </Location>
>
> </IfModule>
>
> #
> ----------------------------------------------------------------------
> --------------   jk2.properties   ------------------------------------
> # jk2.properties
> # Configured for chennel UNIX
>
> # Set the desired handler list
> handler.list=spr,requiest,chennelUnix
>
> # UNIX Domain socket location
> chennelUnix.file=/usr/local/tomcat/work/jk2.socket
>
> # Dynamic library
> serverRoot=/etc/httpd
> apr.NativeSo=/usr/local/httpd/modules/jkjni.so
> ------------------------------------------------------------------------------- 
>
>
> ----------------------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">
>
>
>   <!-- Comment these entries out to disable JMX MBeans support -->
>   <!-- You may also configure custom components (e.g. Valves/Realms) by
>        including your own mbean-descriptor file(s), and setting the
>        "descriptors" attribute to point to a ';' seperated list of paths
>        (in the ClassLoader sense) of files to add to the default list.
>        e.g. descriptors="/com/myfirm/mypackage/mbean-descriptor.xml"
>   -->
>   <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>
>
>   <!-- A "Service" is a collection of one or more "Connectors" that share
>        a single "Container" (and therefore the web applications visible
>        within that Container).  Normally, that Container is an "Engine",
>        but this is not required.
>
>        Note:  A "Service" is not itself a "Container", so you may not
>        define subcomponents such as "Valves" or "Loggers" at this level.
>    -->
>
>   <!-- Define the Tomcat Stand-Alone Service -->
>   <Service name="Catalina">
>
>     <!-- A "Connector" represents an endpoint by which requests are 
> received
>          and responses are returned.  Each Connector passes requests 
> on to the
>          associated "Container" (normally an Engine) for processing.
>
>          By default, a non-SSL HTTP/1.1 Connector is established on 
> port 8080.
>          You can also enable an SSL HTTP/1.1 Connector on port 8443 by
>          following the instructions below and uncommenting the second 
> Connector
>          entry.  SSL support requires the following steps (see the SSL 
> Config
>          HOWTO in the Tomcat 5 documentation bundle for more detailed
>          instructions):
>          * If your JDK version 1.3 or prior, download and install JSSE 
> 1.0.2 or
>            later, and put the JAR files into "$JAVA_HOME/jre/lib/ext".
>          * Execute:
>              %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA 
> (Windows)
>              $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA  
> (Unix)
>            with a password value of "changeit" for both the 
> certificate and
>            the keystore itself.
>
>          By default, DNS lookups are enabled when a web application calls
>          request.getRemoteHost().  This can have an adverse impact on
>          performance, so you can disable it by setting the
>          "enableLookups" attribute to "false".  When DNS lookups are 
> disabled,
>          request.getRemoteHost() will return the String version of the
>          IP address of the remote client.
>     -->
>
>     <!-- 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" />
>     <!-- Note : To disable connection timeouts, set connectionTimeout 
> value
>      to 0 -->
>
>         <!-- Note : To use gzip compression you could set the 
> following properties :
>
>                            compression="on"
>                            compressionMinSize="2048"
>                            noCompressionUserAgents="gozilla, traviata"
>                            compressableMimeType="text/html,text/xml"
>         -->
>
>     <!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
>     <!--
>     <Connector port="8443"
>                maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
>                enableLookups="false" disableUploadTimeout="true"
>                acceptCount="100" debug="0" scheme="https" secure="true"
>                clientAuth="false" sslProtocol="TLS" />
>     -->
>
>     <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
>     <Connector port="8009"
>                enableLookups="false" redirectPort="8443" debug="0"
>                protocol="AJP/1.3" />
>
>     <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
>     <!-- See proxy documentation for more information about using 
> this. -->
>     <!--
>     <Connector port="8082"
>                maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
>                enableLookups="false"
>                acceptCount="100" debug="0" connectionTimeout="20000"
>                proxyPort="80" disableUploadTimeout="true" />
>     -->
>
>     <!-- An Engine represents the entry point (within Catalina) that 
> processes
>          every request.  The Engine implementation for Tomcat stand alone
>          analyzes the HTTP headers included with the request, and 
> passes them
>          on to the appropriate Host (virtual host). -->
>
>     <!-- You should set jvmRoute to support load-balancing via JK/JK2 
> ie :
>     <Engine name="Standalone" defaultHost="localhost" debug="0" 
> jvmRoute="jvm1">
>     -->
>
>     <!-- Define the top level container in our container hierarchy -->
>     <Engine name="Catalina" defaultHost="localhost" debug="0">
>
>       <!-- The request dumper valve dumps useful debugging information 
> about
>            the request headers and cookies that were received, and the 
> response
>            headers and cookies that were sent, for all requests 
> received by
>            this instance of Tomcat.  If you care only about requests to a
>            particular virtual host, or a particular application, nest 
> this
>            element inside the corresponding <Host> or <Context> entry 
> instead.
>
>            For a similar mechanism that is portable to all Servlet 2.4
>            containers, check out the "RequestDumperFilter" Filter in the
>            example application (the source for this filter may be 
> found in
>            "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
>
>            Request dumping is disabled by default.  Uncomment the 
> following
>            element to enable it. -->
>       <!--
>       <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
>       -->
>
>       <!-- Global logger unless overridden at lower levels -->
>       <Logger className="org.apache.catalina.logger.FileLogger"
>               prefix="catalina_log." suffix=".txt"
>               timestamp="true"/>
>
>       <!-- Because this Realm is here, an instance will be shared 
> globally -->
>
>       <!-- This Realm uses the UserDatabase configured in the global JNDI
>            resources under the key "UserDatabase".  Any edits
>            that are performed against this UserDatabase are immediately
>            available for use by the Realm.  -->
>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>                  debug="0" resourceName="UserDatabase"/>
>
>       <!-- Comment out the old realm but leave here for now in case we
>            need to go back quickly -->
>       <!--
>       <Realm className="org.apache.catalina.realm.MemoryRealm" />
>       -->
>
>       <!-- Replace the above Realm with one of the following to get a 
> Realm
>            stored in a database and accessed via JDBC -->
>
>       <!--
>       <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
>              driverName="org.gjt.mm.mysql.Driver"
>           connectionURL="jdbc:mysql://localhost/authority"
>          connectionName="test" connectionPassword="test"
>               userTable="users" userNameCol="user_name" 
> userCredCol="user_pass"
>           userRoleTable="user_roles" roleNameCol="role_name" />
>       -->
>
>       <!--
>       <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
>              driverName="oracle.jdbc.driver.OracleDriver"
>           connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
>          connectionName="scott" connectionPassword="tiger"
>               userTable="users" userNameCol="user_name" 
> userCredCol="user_pass"
>           userRoleTable="user_roles" roleNameCol="role_name" />
>       -->
>
>       <!--
>       <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
>              driverName="sun.jdbc.odbc.JdbcOdbcDriver"
>           connectionURL="jdbc:odbc:CATALINA"
>               userTable="users" userNameCol="user_name" 
> userCredCol="user_pass"
>           userRoleTable="user_roles" roleNameCol="role_name" />
>       -->
>
>       <!-- Define the default virtual host
>            Note: XML Schema validation will not work with Xerces 2.2.
>        -->
>       <Host name="localhost" debug="0" appBase="webapps"
>        unpackWARs="true" autoDeploy="true"
>        xmlValidation="false" xmlNamespaceAware="false">
>
>         <!-- Defines a cluster for this node,
>              By defining this element, means that every manager will 
> be changed.
>              So when running a cluster, only make sure that you have 
> webapps in there
>              that need to be clustered and remove the other ones.
>              A cluster has the following parameters:
>
>              className = the fully qualified name of the cluster class
>
>              name = a descriptive name for your cluster, can be anything
>
>              debug = the debug level, higher means more output
>
>              mcastAddr = the multicast address, has to be the same for 
> all the nodes
>
>              mcastPort = the multicast port, has to be the same for 
> all the nodes
>
>              mcastBindAddr = bind the multicast socket to a specific 
> address
>
>              mcastTTL = the multicast TTL if you want to limit your 
> broadcast
>
>              mcastSoTimeout = the multicast readtimeout
>
>              mcastFrequency = the number of milliseconds in between 
> sending a "I'm alive" heartbeat
>
>              mcastDropTime = the number a milliseconds before a node 
> is considered "dead" if no heartbeat is received
>
>              tcpThreadCount = the number of threads to handle incoming 
> replication requests, optimal would be the same amount of threads as 
> nodes
>
>              tcpListenAddress = the listen address (bind address) for 
> TCP cluster request on this host,
>                                 in case of multiple ethernet cards.
>                                 auto means that address becomes
>                                 
> InetAddress.getLocalHost().getHostAddress()
>
>              tcpListenPort = the tcp listen port
>
>              tcpSelectorTimeout = the timeout (ms) for the 
> Selector.select() method in case the OS
>                                   has a wakup bug in java.nio. Set to 
> 0 for no timeout
>
>              printToScreen = true means that managers will also print 
> to std.out
>
>              expireSessionsOnShutdown = true means that
>
>              useDirtyFlag = true means that we only replicate a 
> session after setAttribute,removeAttribute has been called.
>                             false means to replicate the session after 
> each request.
>                             false means that replication would work 
> for the following piece of code:
>                             <%
>                             HashMap map = 
> (HashMap)session.getAttribute("map");
>                             map.put("key","value");
>                             %>
>              replicationMode = can be either 'pooled', 'synchronous' 
> or 'asynchronous'.
>                                * Pooled means that the replication 
> happens using several sockets in a synchronous way. Ie, the data gets 
> replicated, then the request return. This is the same as the 
> 'synchronous' setting except it uses a pool of sockets, hence it is 
> multithreaded. This is the fastest and safest configuration. To use 
> this, also increase the nr of tcp threads that you have dealing with 
> replication.
>                                * Synchronous means that the thread 
> that executes the request, is also the
>                                thread the replicates the data to the 
> other nodes, and will not return until all
>                                nodes have received the information.
>                                * Asynchronous means that there is a 
> specific 'sender' thread for each cluster node,
>                                so the request thread will queue the 
> replication request into a "smart" queue,
>                                and then return to the client.
>                                The "smart" queue is a queue where when 
> a session is added to the queue, and the same session
>                                already exists in the queue from a 
> previous request, that session will be replaced
>                                in the queue instead of replicating two 
> requests. This almost never happens, unless there is a
>                                large network delay.
>         -->
>         <!--
>             When configuring for clustering, you also add in a valve 
> to catch all the requests
>             coming in, at the end of the request, the session may or 
> may not be replicated.
>             A session is replicated if and only if all the conditions 
> are met:
>             1. useDirtyFlag is true or setAttribute or removeAttribute 
> has been called AND
>             2. a session exists (has been created)
>             3. the request is not trapped by the "filter" attribute
>
>             The filter attribute is to filter out requests that could 
> not modify the session,
>             hence we don't replicate the session after the end of this 
> request.
>             The filter is negative, ie, anything you put in the 
> filter, you mean to filter out,
>             ie, no replication will be done on requests that match one 
> of the filters.
>             The filter attribute is delimited by ;, so you can't 
> escape out ; even if you wanted to.
>
>             filter=".*\.gif;.*\.js;" means that we will not replicate 
> the session after requests with the URI
>             ending with .gif and .js are intercepted.
>         -->
>
>         <!--
>         <Cluster 
> className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
>                  
> managerClassName="org.apache.catalina.cluster.session.DeltaManager"
>                  expireSessionsOnShutdown="false"
>                  useDirtyFlag="true">
>
>             <Membership
>                 
> className="org.apache.catalina.cluster.mcast.McastService"
>                 mcastAddr="228.0.0.4"
>                 mcastPort="45564"
>                 mcastFrequency="500"
>                 mcastDropTime="3000"/>
>
>             <Receiver
>                 
> className="org.apache.catalina.cluster.tcp.ReplicationListener"
>                 tcpListenAddress="auto"
>                 tcpListenPort="4001"
>                 tcpSelectorTimeout="100"
>                 tcpThreadCount="6"/>
>
>             <Sender
>                 
> className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
>                 replicationMode="pooled"/>
>
>             <Valve 
> className="org.apache.catalina.cluster.tcp.ReplicationValve"
>                    
> filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
>         </Cluster>
>         -->
>
>
>
>         <!-- Normally, users must authenticate themselves to each web app
>              individually.  Uncomment the following entry if you would 
> like
>              a user to be authenticated the first time they encounter a
>              resource protected by a security constraint, and then 
> have that
>              user identity maintained across *all* web applications 
> contained
>              in this virtual host. -->
>         <!--
>         <Valve className="org.apache.catalina.authenticator.SingleSignOn"
>                    debug="0"/>
>         -->
>
>         <!-- Access log processes all requests for this virtual host.  By
>              default, log files are created in the "logs" directory 
> relative to
>              $CATALINA_HOME.  If you wish, you can specify a different
>              directory with the "directory" attribute.  Specify either 
> a relative
>              (to $CATALINA_HOME) or absolute path to the desired 
> directory.
>         -->
>         <!--
>         <Valve className="org.apache.catalina.valves.AccessLogValve"
>                  directory="logs"  prefix="localhost_access_log." 
> suffix=".txt"
>                  pattern="common" resolveHosts="false"/>
>         -->
>
>         <!-- Logger shared by all Contexts related to this virtual 
> host.  By
>              default (when using FileLogger), log files are created in 
> the "logs"
>              directory relative to $CATALINA_HOME.  If you wish, you 
> can specify
>              a different directory with the "directory" attribute.  
> Specify either a
>              relative (to $CATALINA_HOME) or absolute path to the desired
>              directory.-->
>         <Logger className="org.apache.catalina.logger.FileLogger"
>                  directory="logs"  prefix="localhost_log." suffix=".txt"
>             timestamp="true"/>
>
>       </Host>
>
>       <!-- perth-agentcity.csse.uwa.edu.au  -->
>       <Host name="perth-agentcity.csse.uwa.edu.au" debug="1"
>                 appBase="/home/projects/misc/perth-agentcity/public_html"
>                 unpackWARs="true">
>       <!--  <Alias>perth-agentcity.csse.uwa.edu.au</Alias>         -->
>
>         <!--<Valve 
> className="org.apache.catalina.authenticator.SingleSignOn"
>                    debug="0"/>
>          -->
>
>         <Logger className="org.apache.catalina.logger.FileLogger"
>                  directory="logs"  prefix="perth-agentlog." suffix=".txt"
>                 timestamp="true"/> -->
>
>         <!--  Root Context -->
>         <Context path="" docBase="" debug="1"/>
>
>       </Host>
>     </Engine>
>   </Service>
> </Server>
>
> ------------------------------------------------------------------------------- 
>
> -- 
>           Ryan McConigley - Systems Administrator                  _.-,
>      Computer Science   University of Western Australia        .--'  '-._
>        Tel: (+61 8) 6488 7082 - Fax: (+61 8) 6488 1089       _/`-  
> _      '.
> Ryan[@]csse.uwa.edu.au - http://www.csse.uwa.edu.au/~ryan  
> '----'._`.----. \
>                                                                      
> `     \;
>  "You're just jealous because the voices are talking to 
> me"                ;_\
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>


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