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:
[EMAIL PROTECTED] 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       _/`-  _      '.
[EMAIL PROTECTED] - http://www.csse.uwa.edu.au/~ryan  '----'._`.----. \
                                                                     `     \;
 "You're just jealous because the voices are talking to me"                ;_\




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to