You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Louis LeBlanc <le...@keyslapper.org> on 2003/04/24 20:41:50 UTC

Re: mod_jk2 from source - brief HOW TO (fixed problem with FreeBSD 4.8 build)

On 04/24/03 01:51 PM, Louis LeBlanc sat at the `puter and typed:
> Hey Mark.  Thanks a million for putting this together.  I ran through
> your steps without incident until I got to 7.
> 
> Small problem - there is no jkjni.so in that directory.  mod_jk2.so
> exists, and there is a jkjni.a and jkjni.la, but no jkjni.so.
> 
> The build output is too long for me to toss it all out here, but here
> is the warning output that might shed some light:
> 
> *** Warning: This library needs some functionality provided by -lapr-0.
> *** I have the capability to make that library automatically link in when
> *** you link to this library.  But I can only do this if you have a
> *** shared version of the library, which you do not appear to have.
> 
> *** Warning: libtool could not satisfy all declared inter-library
> *** dependencies of module jkjni.  Therefore, libtool will create
> *** a static module, that should work as long as the dlopening
> *** application is linked with the -dlopen flag.
> 
> I am building against Tomcat 4.1.24 and Apache 2.0.45 on FreeBSD 4.8.
> 
> The configuration command I used is:
> 
> ./configure \
>     --with-apxs2=/usr/local/sbin/apxs \
>     --with-tomcat41=/usr/local/jakarta-tomcat4.1 \
>     --with-java-home=/usr/local/jdk1.4.1 \
>     --with-apr-include=/usr/local/include/apache2 \
>     --with-apr-lib=/usr/local/lib/apache2 \
>     --with-jni \
>     --with-pcre

Problem solved.  Required a few modifications to the
jakarta-tomcat-connectors-jk2-2.0.2-src/jk/native2/server/apache2/Makefile.in
file:

# diff -c2 Makefile.in.orig Makefile.in
*** Makefile.in.orig    Thu Apr 24 14:23:43 2003
--- Makefile.in Thu Apr 24 14:31:59 2003
***************
*** 9,12 ****
--- 9,13 ----
  APACHE2_LIBDIR=@APACHE2_HOME@/lib
  APR_INCL=@APR_CFLAGS@ 
+ APR_LIBDIR=@APACHE2_HOME@/lib/apache2
  EXTRA_CFLAGS=@APXS2_CFLAGS@
  EXTRA_CPPFLAGS=@APXS2_CPPFLAGS@
***************
*** 26,30 ****
  #include ../../../build.properties
  
! LIBTOOL=${APACHE2_HOME}/build/libtool 
  
  # It doesn't hurt if we include all
--- 27,31 ----
  #include ../../../build.properties
  
! LIBTOOL=${APACHE2_HOME}/bin/libtool 
  
  # It doesn't hurt if we include all
***************
*** 35,39 ****
  
  JK_CFLAGS=-DCHUNK_SIZE=4096 -DUSE_APACHE_MD5 -DHAS_APR @HAVE_JNI@ @HAS_PCRE@
! JK_LDFLAGS=-L${APACHE2_LIBDIR} -lcrypt -lapr-0 @PCRE_LIBS@
  
  ###### Based on rules.mk ##########################################
--- 36,40 ----
  
  JK_CFLAGS=-DCHUNK_SIZE=4096 -DUSE_APACHE_MD5 -DHAS_APR @HAVE_JNI@ @HAS_PCRE@
! JK_LDFLAGS=-L${APACHE2_LIBDIR} -L${APR_LIBDIR} -lcrypt -lapr -0 @PCRE_LIBS@
  
  ###### Based on rules.mk ##########################################

Hope this helps someone else in the future . . .

Maybe these changes will help make this make file more portable too.

Lou
-- 
Louis LeBlanc               leblanc@keyslapper.org
Fully Funded Hobbyist, KeySlapper Extrordinaire :)
http://www.keyslapper.org                     ԿԬ

Knebel's Law:
  It is now proved beyond doubt that smoking is one of the leading
  causes of statistics.

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


Re: mod_jk2 from source - brief HOW TO (fixed problem with FreeBSD 4.8 build)

Posted by Louis LeBlanc <le...@keyslapper.org>.
On 04/24/03 09:30 PM, Mladen Turk sat at the `puter and typed:
> 
> 
> > -----Original Message-----
> > From: Louis LeBlanc
> > 
> > # diff -c2 Makefile.in.orig Makefile.in
> 
> Could you run it using diff -u3 ?
> 
> > *** Makefile.in.orig    Thu Apr 24 14:23:43 2003
> > --- Makefile.in Thu Apr 24 14:31:59 2003
> > ***************
> > *** 9,12 ****
> > --- 9,13 ----
> >   APACHE2_LIBDIR=@APACHE2_HOME@/lib
> >   APR_INCL=@APR_CFLAGS@ 
> > + APR_LIBDIR=@APACHE2_HOME@/lib/apache2
> 
> @APACHE2_HOME@/lib/apache2 is freebsd specific apr libdir, or you did
> some tweaking?

This is the location of all the apr libs when Apache 2.0.45 is
installed from the ports, so I assume it is the FreeBSD specific apr
dir.

> And please forward to either bugzilla or tomcat-dev.

Will do.

--- Makefile.in.orig    Thu Apr 24 14:23:43 2003
+++ Makefile.in Thu Apr 24 14:31:59 2003
@@ -8,6 +8,7 @@
 APACHE2_LIBEXEC=@APACHE2_LIBEXEC@
 APACHE2_LIBDIR=@APACHE2_HOME@/lib
 APR_INCL=@APR_CFLAGS@ 
+APR_LIBDIR=@APACHE2_HOME@/lib/apache2
 EXTRA_CFLAGS=@APXS2_CFLAGS@
 EXTRA_CPPFLAGS=@APXS2_CPPFLAGS@
 CC=@CC@
@@ -25,7 +26,7 @@
 # Yes, we use the same properties file as ant
 #include ../../../build.properties
 
-LIBTOOL=${APACHE2_HOME}/build/libtool 
+LIBTOOL=${APACHE2_HOME}/bin/libtool 
 
 # It doesn't hurt if we include all
 INCLUDES= -I${JK_DIR}/include \
@@ -34,7 +35,7 @@
           ${JAVA_INCL}
 
 JK_CFLAGS=-DCHUNK_SIZE=4096 -DUSE_APACHE_MD5 -DHAS_APR @HAVE_JNI@ @HAS_PCRE@
-JK_LDFLAGS=-L${APACHE2_LIBDIR} -lcrypt -lapr-0 @PCRE_LIBS@
+JK_LDFLAGS=-L${APACHE2_LIBDIR} -L${APR_LIBDIR} -lcrypt -lapr -0 @PCRE_LIBS@
 
 ###### Based on rules.mk ##########################################
 ALL_CFLAGS   = $(EXTRA_CFLAGS) $(NOTEST_CFLAGS) $(CFLAGS)


-- 
Louis LeBlanc               leblanc@keyslapper.org
Fully Funded Hobbyist, KeySlapper Extrordinaire :)
http://www.keyslapper.org                     ԿԬ

The universe is an island, surrounded by whatever it is that surrounds
universes.

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


Re: mod_jk2 Apache2/Tomcat4.1 on FreeBSD [was Re: mod_jk2 from source - brief HOW TO]

Posted by Louis LeBlanc <le...@keyslapper.org>.
On 04/24/03 11:00 PM, Mladen Turk sat at the `puter and typed:
> 
> 
> > -----Original Message-----
> > From: Louis LeBlanc
> > 
> > I've posted the fix as requested to tomcat-dev.  I hope it helps.
> > 
> > In the meantime, I found another problem.
> > 
> > The apache configuration doesn't like something:
> > Syntax error on line 223 of /usr/local/etc/apache2/httpd.conf:
> > Cannot load /usr/local/libexec/apache2/mod_jk2.so into server:
> > /usr/local/libexec/apache2/mod_jk2.so: Undefined symbol 
> > "pthread_mutex_unlock"
> >
> 
> FreeBSD 4 and pthreads? I think they don't like each other. At least
> that was what some of the guys from apache-dev reported as taboo ;).
> 
> > I vaguely remembered reading something about loading the 
> > thread lib for something, and I found it.  The solution was 
> > in the jk2/installhowto.html page, and said to add this to 
> > the httpd.conf:
> > 
> > LoadFile /usr/lib/pthread.so
> > 
> > Unfortunately, /usr/lib/pthread.so doesn't exist as a native 
> > FreeBSD library, since the Posix thread implementation is in 
> > libc_r.so.  So I changed that line to:
> > 
> > LoadFile /usr/lib/libc_r.so
> > 
> > And the config seems better, but Apache dumps core 
> > immediately when I try to start it.
> >
> 
> Yep, switch to 5.0, it should solve the thread issues (but I've never
> been able even to install the bugger on the x86).

I made an aborted attempt recently myself.  Had to go with 4.8.

> Also you may try to recompile the apache and apr without threads
> support. The jk2 can cope with that, cause all thread calls are enclosed
> with APR_HAS_THREADS directive.

Would I be better off (in terms of ease of setup) to just go with
Apache 1.3 and mod_jk?  I had a pretty complex configuration with 1.3
before trying 2.0, and I haven't quite worked my 2.0 config out to
cover all the bases yet.

Thanks for your help!

Lou
-- 
Louis LeBlanc               leblanc@keyslapper.org
Fully Funded Hobbyist, KeySlapper Extrordinaire :)
http://www.keyslapper.org                     ԿԬ

Boob's Law:
  You always find something in the last place you look.

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


RE: mod_jk2 Apache2/Tomcat4.1 on FreeBSD [was Re: mod_jk2 from source - brief HOW TO]

Posted by Mladen Turk <mt...@inet.hr>.

> -----Original Message-----
> From: Louis LeBlanc
> 
> I've posted the fix as requested to tomcat-dev.  I hope it helps.
> 
> In the meantime, I found another problem.
> 
> The apache configuration doesn't like something:
> Syntax error on line 223 of /usr/local/etc/apache2/httpd.conf:
> Cannot load /usr/local/libexec/apache2/mod_jk2.so into server:
> /usr/local/libexec/apache2/mod_jk2.so: Undefined symbol 
> "pthread_mutex_unlock"
>

FreeBSD 4 and pthreads? I think they don't like each other. At least
that was what some of the guys from apache-dev reported as taboo ;).

> I vaguely remembered reading something about loading the 
> thread lib for something, and I found it.  The solution was 
> in the jk2/installhowto.html page, and said to add this to 
> the httpd.conf:
> 
> LoadFile /usr/lib/pthread.so
> 
> Unfortunately, /usr/lib/pthread.so doesn't exist as a native 
> FreeBSD library, since the Posix thread implementation is in 
> libc_r.so.  So I changed that line to:
> 
> LoadFile /usr/lib/libc_r.so
> 
> And the config seems better, but Apache dumps core 
> immediately when I try to start it.
>

Yep, switch to 5.0, it should solve the thread issues (but I've never
been able even to install the bugger on the x86).
 
Also you may try to recompile the apache and apr without threads
support. The jk2 can cope with that, cause all thread calls are enclosed
with APR_HAS_THREADS directive.

MT.


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


mod_jk2 Apache2/Tomcat4.1 on FreeBSD [was Re: mod_jk2 from source - brief HOW TO]

Posted by Louis LeBlanc <le...@keyslapper.org>.
On 04/24/03 09:30 PM, Mladen Turk sat at the `puter and typed:
> > -----Original Message-----
> > From: Louis LeBlanc
> > 
> > # diff -c2 Makefile.in.orig Makefile.in
> 
> Could you run it using diff -u3 ?
> 
> > *** Makefile.in.orig    Thu Apr 24 14:23:43 2003
> > --- Makefile.in Thu Apr 24 14:31:59 2003
> > ***************
> > *** 9,12 ****
> > --- 9,13 ----
> >   APACHE2_LIBDIR=@APACHE2_HOME@/lib
> >   APR_INCL=@APR_CFLAGS@ 
> > + APR_LIBDIR=@APACHE2_HOME@/lib/apache2
> 
> @APACHE2_HOME@/lib/apache2 is freebsd specific apr libdir, or you did
> some tweaking?
> 
> And please forward to either bugzilla or tomcat-dev.
> 

I've posted the fix as requested to tomcat-dev.  I hope it helps.

In the meantime, I found another problem.

The apache configuration doesn't like something:
Syntax error on line 223 of /usr/local/etc/apache2/httpd.conf:
Cannot load /usr/local/libexec/apache2/mod_jk2.so into server:
/usr/local/libexec/apache2/mod_jk2.so: Undefined symbol "pthread_mutex_unlock"

I vaguely remembered reading something about loading the thread lib for
something, and I found it.  The solution was in the
jk2/installhowto.html page, and said to add this to the httpd.conf:

LoadFile /usr/lib/pthread.so

Unfortunately, /usr/lib/pthread.so doesn't exist as a native FreeBSD
library, since the Posix thread implementation is in libc_r.so.  So I
changed that line to:

LoadFile /usr/lib/libc_r.so

And the config seems better, but Apache dumps core immediately when I
try to start it.

The library interface must be different, the gdb backtrace looks like
this:

#0  0x282d0aac in .cerror () from /usr/lib/libc.so.4
#1  0x28349765 in _thread_fd_table_init () from /usr/lib/libc_r.so
#2  0x28347f95 in _thread_init () from /usr/lib/libc_r.so
#3  0x2837e148 in _thread_init_invoker::_thread_init_invoker ()
   from /usr/lib/libc_r.so
#4  0x2837e181 in _thread_init_invoker::_thread_init_invoker ()
   from /usr/lib/libc_r.so
#5  0x2837e1aa in _thread_init_invoker::_thread_init_invoker ()
   from /usr/lib/libc_r.so
#6  0x2837e1d8 in _thread_init_invoker::_thread_init_invoker ()
   from /usr/lib/libc_r.so
#7  0x283044ae in _init () from /usr/lib/libc_r.so
#8  0x2808e3ef in dlopen () from /usr/libexec/ld-elf.so.1
#9  0x2822011c in apr_dso_load () from
/usr/local/lib/apache2/libapr.so.9
#10 0x8061887 in load_file ()
#11 0x8064459 in invoke_cmd ()
#12 0x8064f73 in execute_now ()
#13 0x80647c0 in ap_build_config_sub ()
#14 0x8064bfd in ap_build_config ()
#15 0x8065462 in ap_process_resource_config ()
#16 0x8065b60 in ap_read_config ()
#17 0x806792c in main ()
#18 0x805c7de in _start ()

I don't know much about Java and Apache modules at this point, but I
hope this info will help those of you who do.

I wish I had the time to keep working on this, but I don't.  If any
ideas to solve this problem come up, I will try them at my earliest
opportunity and provide feedback.

Thanks folks.

Lou
-- 
Louis LeBlanc               leblanc@keyslapper.org
Fully Funded Hobbyist, KeySlapper Extrordinaire :)
http://www.keyslapper.org                     ԿԬ

enhance, v.:
  To tamper with an image, usually to its detriment.

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


RE: mod_jk2 from source - brief HOW TO (fixed problem with FreeBSD 4.8 build)

Posted by Mladen Turk <mt...@inet.hr>.

> -----Original Message-----
> From: Louis LeBlanc
> 
> # diff -c2 Makefile.in.orig Makefile.in

Could you run it using diff -u3 ?

> *** Makefile.in.orig    Thu Apr 24 14:23:43 2003
> --- Makefile.in Thu Apr 24 14:31:59 2003
> ***************
> *** 9,12 ****
> --- 9,13 ----
>   APACHE2_LIBDIR=@APACHE2_HOME@/lib
>   APR_INCL=@APR_CFLAGS@ 
> + APR_LIBDIR=@APACHE2_HOME@/lib/apache2

@APACHE2_HOME@/lib/apache2 is freebsd specific apr libdir, or you did
some tweaking?

And please forward to either bugzilla or tomcat-dev.

Thx.
MT.


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


Re: mod_jk2 from source - brief HOW TO (fixed problem with FreeBSD 4.8 build)

Posted by Jacob Kjome <ho...@visi.com>.
You should post your fix to http://issues.apache.org/bugzilla/ as an 
enhancement, otherwise this will get lost in all the email traffic here.

Jake

At 02:41 PM 4/24/2003 -0400, you wrote:
>On 04/24/03 01:51 PM, Louis LeBlanc sat at the `puter and typed:
> > Hey Mark.  Thanks a million for putting this together.  I ran through
> > your steps without incident until I got to 7.
> >
> > Small problem - there is no jkjni.so in that directory.  mod_jk2.so
> > exists, and there is a jkjni.a and jkjni.la, but no jkjni.so.
> >
> > The build output is too long for me to toss it all out here, but here
> > is the warning output that might shed some light:
> >
> > *** Warning: This library needs some functionality provided by -lapr-0.
> > *** I have the capability to make that library automatically link in when
> > *** you link to this library.  But I can only do this if you have a
> > *** shared version of the library, which you do not appear to have.
> >
> > *** Warning: libtool could not satisfy all declared inter-library
> > *** dependencies of module jkjni.  Therefore, libtool will create
> > *** a static module, that should work as long as the dlopening
> > *** application is linked with the -dlopen flag.
> >
> > I am building against Tomcat 4.1.24 and Apache 2.0.45 on FreeBSD 4.8.
> >
> > The configuration command I used is:
> >
> > ./configure \
> >     --with-apxs2=/usr/local/sbin/apxs \
> >     --with-tomcat41=/usr/local/jakarta-tomcat4.1 \
> >     --with-java-home=/usr/local/jdk1.4.1 \
> >     --with-apr-include=/usr/local/include/apache2 \
> >     --with-apr-lib=/usr/local/lib/apache2 \
> >     --with-jni \
> >     --with-pcre
>
>Problem solved.  Required a few modifications to the
>jakarta-tomcat-connectors-jk2-2.0.2-src/jk/native2/server/apache2/Makefile.in
>file:
>
># diff -c2 Makefile.in.orig Makefile.in
>*** Makefile.in.orig    Thu Apr 24 14:23:43 2003
>--- Makefile.in Thu Apr 24 14:31:59 2003
>***************
>*** 9,12 ****
>--- 9,13 ----
>   APACHE2_LIBDIR=@APACHE2_HOME@/lib
>   APR_INCL=@APR_CFLAGS@
>+ APR_LIBDIR=@APACHE2_HOME@/lib/apache2
>   EXTRA_CFLAGS=@APXS2_CFLAGS@
>   EXTRA_CPPFLAGS=@APXS2_CPPFLAGS@
>***************
>*** 26,30 ****
>   #include ../../../build.properties
>
>! LIBTOOL=${APACHE2_HOME}/build/libtool
>
>   # It doesn't hurt if we include all
>--- 27,31 ----
>   #include ../../../build.properties
>
>! LIBTOOL=${APACHE2_HOME}/bin/libtool
>
>   # It doesn't hurt if we include all
>***************
>*** 35,39 ****
>
>   JK_CFLAGS=-DCHUNK_SIZE=4096 -DUSE_APACHE_MD5 -DHAS_APR @HAVE_JNI@ 
> @HAS_PCRE@
>! JK_LDFLAGS=-L${APACHE2_LIBDIR} -lcrypt -lapr-0 @PCRE_LIBS@
>
>   ###### Based on rules.mk ##########################################
>--- 36,40 ----
>
>   JK_CFLAGS=-DCHUNK_SIZE=4096 -DUSE_APACHE_MD5 -DHAS_APR @HAVE_JNI@ 
> @HAS_PCRE@
>! JK_LDFLAGS=-L${APACHE2_LIBDIR} -L${APR_LIBDIR} -lcrypt -lapr -0 @PCRE_LIBS@
>
>   ###### Based on rules.mk ##########################################
>
>Hope this helps someone else in the future . . .
>
>Maybe these changes will help make this make file more portable too.
>
>Lou
>--
>Louis LeBlanc               leblanc@keyslapper.org
>Fully Funded Hobbyist, KeySlapper Extrordinaire :)
>http://www.keyslapper.org                     Ô¿Ô¬
>
>Knebel's Law:
>   It is now proved beyond doubt that smoking is one of the leading
>   causes of statistics.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org