LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 08-23-2003, 02:12 PM   #1
ardochoke
LQ Newbie
 
Registered: Aug 2003
Posts: 3

Rep: Reputation: 0
mod_jk2 Apache error


Hello,

I have been trying to get mod_jk2 setup on the standard Redhat9 install of Apache...

I tried building the source and I get c compile errors out of ANT... So I tried just downloading the latest binary for Linux I could find from the apache site (mod_jk2-2.0.43.so).

I added the following line to httpd.conf:
LoadModule jk2_module modules/mod_jk2-2.0.43.so

When I start apache I get the following error:

httpd failed. The error was: Stopping httpd: [FAILED]

Starting httpd: httpd: module "../../server/apache2/mod_jk2.c" is not compatible with this version of Apache.
Please contact the vendor for the correct version.
[FAILED]

Any ideas on how to move forward would be greatly appreciated.

Cheers,
Adrian
 
Old 08-23-2003, 10:54 PM   #2
js_530
Member
 
Registered: Jul 2003
Posts: 162

Rep: Reputation: Disabled
Sounds like you're trying to use something made for apache 1.x but your on apache 2.x (default red hat 9 install of apache). You could always downgrade to 1.x, there's more module support.
 
Old 08-25-2003, 04:41 PM   #3
ardochoke
LQ Newbie
 
Registered: Aug 2003
Posts: 3

Original Poster
Rep: Reputation: 0
I ended up installing the latest 'production quality' release of apache 2. Added the module in the config and it worked fine. I'm guessing that Redhat9 has a very early release of Apache 2?!?! Anyway, it works fine now. Thanks.
 
Old 08-29-2003, 05:23 PM   #4
Morgrog
LQ Newbie
 
Registered: Jul 2003
Posts: 4

Rep: Reputation: 0
I'm trying to install it myself and I'm having tons of trouble, I tried a gazillion configs and I'm really lost here :'(

I got md_jk2.so in /usr/local/apache2/modules/ (along with jkjni.so)
(it was built using jakarta-tomcat-connectors-4.1.24-src)
I got Tomcat 4.1.27 in /usr/local/jakarta-tomcat-4.1.27/
I got Apache 2.0.47

Apache runs fine alone (port 80) and Tomcat runs fine alone (port 8080)
Now whenever I try to run both together (that means adding the line
Code:
LoadModule jk2_module /usr/local/apache2/modules/mod_jk2.so
) Appache gets me the following error:
Code:
Starting httpd: httpd: module "../../server/apache2/mod_jk2.c" is not compatible with this version of Apache.
Please contact the vendor for the correct version.
                                                           [FAILED]

I got my workers.properties going on too
Here's a snippet

Code:
# Define 1 real worker using ajp13
 worker.list=worker1

# Set properties for worker1 (ajp13)
 worker.worker1.type=ajp13
 worker.worker1.host=localhost
 worker.worker1.port=8009
 worker.worker1.lbfactor=50
 worker.worker1.cachesize=10
 worker.worker1.cache_timeout=600
 worker.worker1.socket_keepalive=1
 worker.worker1.socket_timeout=300


Here's my server.xml:

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

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

    <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
               port="8080" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="100" debug="0" connectionTimeout="20000"
               useURIValidationHack="false" disableUploadTimeout="true" />
    <!-- Note : To disable connection timeouts, set connectionTimeout value to -1 -->

    <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
               port="8009" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="10" debug="0" connectionTimeout="0"
               useURIValidationHack="false"
               protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>

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

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

      <!-- Define the default virtual host -->
      <Host name="localhost" debug="0" appBase="webapps"
       unpackWARs="true" autoDeploy="true">

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

        <!-- Tomcat Examples Context -->
        <Context path="/examples" docBase="examples" debug="0"
                 reloadable="true" crossContext="true">
          <Logger className="org.apache.catalina.logger.FileLogger"
                     prefix="localhost_examples_log." suffix=".txt"
              timestamp="true"/>
          <Ejb   name="ejb/EmplRecord" type="Entity"
                 home="com.wombat.empl.EmployeeRecordHome"
               remote="com.wombat.empl.EmployeeRecord"/>

          <Environment name="maxExemptions" type="java.lang.Integer"
                      value="15"/>
          <Parameter name="context.param.name" value="context.param.value"
                     override="false"/>
          <Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
                    type="javax.sql.DataSource"/>
          <ResourceParams name="jdbc/EmployeeAppDb">
            <parameter><name>username</name><value>sa</value></parameter>
            <parameter><name>password</name><value></value></parameter>
            <parameter><name>driverClassName</name>
              <value>org.hsql.jdbcDriver</value></parameter>
            <parameter><name>url</name>
              <value>jdbc:HypersonicSQL:database</value></parameter>
          </ResourceParams>
          <Resource name="mail/Session" auth="Container"
                    type="javax.mail.Session"/>
          <ResourceParams name="mail/Session">
            <parameter>
              <name>mail.smtp.host</name>
              <value>localhost</value>
            </parameter>
          </ResourceParams>
          <ResourceLink name="linkToGlobalResource"
                    global="simpleValue"
                    type="java.lang.Integer"/>
        </Context>

      </Host>

    </Engine>

  </Service>


</Server>

What is going on here? :'(

(edit : a few corrections here and there)

Last edited by Morgrog; 08-29-2003 at 05:26 PM.
 
Old 08-29-2003, 06:49 PM   #5
ardochoke
LQ Newbie
 
Registered: Aug 2003
Posts: 3

Original Poster
Rep: Reputation: 0
ideas...

I don't know if I have your answer but here is a few things to try...

1. Wrong httpd?
I got that error message when I first re-installed a new version of Apache httpd. You need to make sure your last version of httpd is stopped. On Redhat 9 you can go to their equivalent of the 'Start' button and then "System Settings" > "Server Settings" > "Services". Go to the httpd service and make sure it is stopped... I unchecked it as well so that it didn't start when the system re-started.

Then: /usr/local/apache2/bin/apachectl start

I checked that I was running the new version because the documentation looked like it does on the www.apache.org site. The default redhat httpd server showed an older version of the docs... I'm sure there are many better ways to check your running version - I just don't know them... btw, the version I downloaded was httpd-2.0.47

2. mod_jk2 version
I downloaded a binary version of mod_jk2. The file is called mod_jk2-2.0.43.so. There were two other versions I tried that just weren't going to work no matter what I did. I got mine from here:

http://jakarta.apache.org/builds/jak...in/linux/i386/

This is literally the only .so file I have in my modules directory. I don't know where the others went - but it is there by itself and everything works.

3. workers file
my workers file has a different name. It is called:
workers2.properties
It looks like the way you are doing it is from a previous version of mod_jk. Anyway my workers2.properties is in my conf directory. It looks like:
========
[shm]
file=${serverRoot}/logs/shm.file
size=1048576

# Example socket channel, override port and host.
[channel.socket:localhost:8019]
#port=8019
port=8009
host=127.0.0.1

# define the worker
[ajp13:localhost:8019]
channel=channel.socket:localhost:8019

# Uri mapping
[uri:/joanda/*]
worker=ajp13:localhost:8019
========

so a URL like:
http://localhost/joanda/index.html goes to my webapp that is loaded under the joanda context. I'm actually running the webapp out of JBoss but that shouldn't make any difference... Jo is my wife and my name is Adrian - so our site is joanda. Completely irrelevant to your problem - but hey...


4. LoadModule
My httpd.conf line looks like:
LoadModule jk2_module modules/mod_jk2-2.0.43

This is the only LoadModule that is in my httpd.conf file - again I don't know where all the others went - but it works.

Well I hope this helps. Let me know if you get it working!

Cheers,
Adrian
 
Old 08-31-2003, 05:52 PM   #6
Morgrog
LQ Newbie
 
Registered: Jul 2003
Posts: 4

Rep: Reputation: 0
It's working! wonderful, thanks a zillion

I think the only thing I forgot was the uri mapping... (and of course the good version of jk2)

Thanks again!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help - mod_jk2 connector / Tomcat 5 / Apache 2 / Redhat 9 sfwhip Programming 5 06-13-2004 02:57 AM
How to connect Tomcat 5 and Apache 2.0.48 using mod_jk2 zhangwf Linux - Networking 1 03-20-2004 09:42 AM
How to connect Tomcat 5 and Apache 2.0.48 using mod_jk2 zhangwf Linux - Newbie 0 03-19-2004 09:21 PM
mod_jk2, I just can't do this. techrolla Linux - Networking 4 01-07-2004 08:29 AM
Trying to integrate Apache w/ Tomcat....error message w/ mod_jk2.so mlhammer Linux - General 2 10-06-2003 04:10 AM


All times are GMT -5. The time now is 12:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration