You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Bojan Smojver <bo...@binarix.com> on 2000/12/02 04:15:55 UTC

mod_jk vs. statically linked Apache

I've noticed that there aren't any instructions about compiling and then
statically linking mod_jk.so into Apache (mod_jk HOWTO from Tomcat 3.2).
Is this intentional (ie. do you want to move people away from doing
that) or is it just missing because most people prefer DSO?

I've been able to compile and statically link mod_jk.o into Apache (on
RedHat Linux 7.0), but it requires some fiddling. Would this be
something others would like to know about?

Bojan

Re: mod_jk vs. statically linked Apache (under AIX 4.3.3)

Posted by Franco Fiorese <ff...@artis.net>.
Bojan Smojver wrote:

> I've noticed that there aren't any instructions about compiling and then
> statically linking mod_jk.so into Apache (mod_jk HOWTO from Tomcat 3.2).
> Is this intentional (ie. do you want to move people away from doing
> that) or is it just missing because most people prefer DSO?
>
> I've been able to compile and statically link mod_jk.o into Apache (on
> RedHat Linux 7.0), but it requires some fiddling. Would this be
> something others would like to know about?
>
> Bojan

I have done the same. Building mod_jk statically linked with apache under
AIX 4.3.3.25.
Just to let to you known that it works fine...

Franco Fiorese


Re: mod_jk vs. statically linked Apache

Posted by Bojan Smojver <bo...@binarix.com>.
I didn't actually say that the configuration works. It'll be some time
before I know that for sure. But it does compile and link :-)

If I understand correctly, DSO is described in Apache INSTALL file as
optional.

I have seen references in the jk code to dl related functions (and
actually -ldl needs to be specified to link mod_jk into Apache
successfully) and now I'm not sure if statically linking the module
would affect it (and my limited knowledge suggests it shouldn't, but I
could be dead wrong here).

If it's not too much trouble, would you be able to explain why
(technically) static linking isn't supported in mod_jk before I waste
too much time on testing.

Regards,
Bojan

> Static linking was not an intended supported configuration, so there was no need
> to document it.  The fact that it works at all means you are lucky.
> 
> Craig McClanahan

Using mod_jk.so

Posted by Alan Wright <At...@btinternet.com>.
I am trying to use mod_jk instead of mod_jserv.so

should I do anything about the  AddHandler jserv-servlet .jsp directive in
httpd.conf?

Is there something that should be in its place?

I am finding the documentation relating to the use of mod_jk confusing because the
examples have lots of jserv stuff in them.


Alan Wright


jjdbc setNull to create nested table

Posted by yt <ts...@usa.net>.
Hi Craig,
I'm having a problem with jdbc creating a nested object table in 
oracle8i.

eg in oracle 8i, you create the object table using this code :

create  type phone_number  as Object
(phone_no varchar2(12),
  phone_type   char(1));

create type  all_phones  as table of phone_number;

// now create the nested table :
               
create table cust_phones
( cust_no   varchar2(8),
cust_name  varchar2(20),
phone_nos  all_phones)
nested table phone_nos  store as all_phones_nst;


insert into cust_phones values ('joey123','joey smith', all_phones()); 
is a query which works fine in oracle sql plus. It will put null values 
into the nested table all_phones. Which is exactly what I want.

But trying to run it from a java class through jdbc, like this :

String sql = "INSERT INTO CUST_PHONES VALUES (?,?,?);";
					
			PreparedStatement pstmt = null;
		pstmt = conn.prepareStatement(sql);

			pstmt.setString(1, "joey123");

			pstmt.setString(2, "joey smith");

			pstmt.setNull(3, java.sql.Types.STRUCT, "all_phones");


will give an error like this :
java.sql.SQLException: ORA-00911: invalid character

Let me know if you have any idea on how to fix this jdbc problem. 
If I use a regular stmt.execute(sql), it works fine and puts the null 
values into the table. Thanks in advance for your help.

  

Re: mod_jk vs. statically linked Apache

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Bojan Smojver wrote:

> I've noticed that there aren't any instructions about compiling and then
> statically linking mod_jk.so into Apache (mod_jk HOWTO from Tomcat 3.2).
> Is this intentional (ie. do you want to move people away from doing
> that) or is it just missing because most people prefer DSO?
>
> I've been able to compile and statically link mod_jk.o into Apache (on
> RedHat Linux 7.0), but it requires some fiddling. Would this be
> something others would like to know about?
>

Static linking was not an intended supported configuration, so there was no need
to document it.  The fact that it works at all means you are lucky.

>
> Bojan

Craig McClanahan



Re: mod_jk vs. statically linked Apache

Posted by Bojan Smojver <bo...@binarix.com>.
This is *FAR* from being a good set of instructions. A few of the
scripts are also extremely primitive. All of this applies to RedHat
Linux 7.0.

Please note that I still haven't received confirmation from the
developers of mod_jk if static linking of the module is a technically
sound option.

Here we go:

1. prepare a library libjk.a

Here is the extremely primitive script that you have to run from
<path>/jakarta-tomcat-3.2-src/src/native/apache1.3:

build.lib.sh
---------------------
#!/bin/sh
for i in *.c ../jk/*.c; do
  gcc -O2 -c -DLINUX -DLINUX -I../jk -I/usr/local/jdk/include/linux \
                             -I/usr/local/jdk/include \
                             -I/usr/src/apache/src/include \
                             -I/usr/src/apache/src/os/unix $i
done
ar r libjk.a *.o
---------------------

You might get a few warnings from gcc 2.96 about missing newlines.
That's OK. The above paths work on my system. I have Sun's JDK 1.3.0.
Check them out on your system...

2. Create jk in Apache

Something like:

<path>/apache/src/modules/jk

3. Copy the libjk.a into <path>/apache/src/modules/jk

4. Create relevant files in <path>/apache/src/modules/jk

libjk.module:
---------------------
Name: jk_module
ConfigStart
        LIBS="-Lmodules/jk -L../modules/jk -L../../modules/jk -ljk -ldl
$LIBS"
        RULE_HIDE=yes
ConfigEnd
---------------------

Makefile.tmpl
---------------------
LIB=libjk.a

all: ${LIB}

${LIB}:
        ${RANLIB} $@

clean:
---------------------

Copy Makefile.libdir from some other module (mod_jserv is OK). Looks
something like this:
---------------------
This is a place-holder which indicates to Configure that it shouldn't
provide the default targets when building the Makefile in this
directory.
Instead it'll just prepend all the important variable definitions, and
copy the Makefile.tmpl onto the end.
---------------------

5. Configure Apache

./configure <existing-config-directives>
--activate-module=src/modules/jk/libjk.a

6. Make and install

make
make install

That should be it. Hope you have success with it.

Bojan

David Bussenschutt wrote:
> 
> It's something I'm interested in... do tell!
> THe only reason I have DSO enabled currently is for mod_jk.so
> (I have php,ssl, and all others statically compiled for speed increase)

Re: mod_jk vs. statically linked Apache

Posted by David Bussenschutt <D....@mailbox.gu.edu.au>.
It's something I'm interested in... do tell!
THe only reason I have DSO enabled currently is for mod_jk.so
(I have php,ssl, and all others statically compiled for speed increase)

David.

At 02:15 PM 12/2/00 +1100, you wrote:
>I've noticed that there aren't any instructions about compiling and then
>statically linking mod_jk.so into Apache (mod_jk HOWTO from Tomcat 3.2).
>Is this intentional (ie. do you want to move people away from doing
>that) or is it just missing because most people prefer DSO?
>
>I've been able to compile and statically link mod_jk.o into Apache (on
>RedHat Linux 7.0), but it requires some fiddling. Would this be
>something others would like to know about?
>
>Bojan
>
>

--------------------------------------------------------------------
David Bussenschutt          Email: D.Bussenschutt@mailbox.gu.edu.au
Senior Computing Support Officer & Systems Administrator/Programmer
Location: Griffith University. Information Technology Services
          Brisbane Qld. Aust.  (TEN bldg. rm 1.33) Ph: (07)38757079
--------------------------------------------------------------------