You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Allan Bruce <al...@f2s.com> on 2004/03/18 12:27:52 UTC

Tomcat Apache connector not working

I have apache and tomcat both up and running.  Now I want to be able to set
up a connector so that I can browse the 'examples' directory of the tomcat
installation through apaches port.  The below config doesnt seem to work,
can somebody please tell me where I am going wrong?
Thanks



----- catalina.out
18-Mar-2004 10:01:57 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 8080
18-Mar-2004 10:01:58 org.apache.jk.server.JkMain start
INFO: APR not loaded, disabling jni components: java.io.IOException:
/usr/lib/apache2/mod_jk2.so: /usr/lib/apache2/mod_jk2.so: undefined symbol:
ap_server_root
18-Mar-2004 10:01:58 org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8019
18-Mar-2004 10:01:58 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=23/505
config=/usr/local/sites/tomcat/tomcat/conf/jk2.properties
18-Mar-2004 10:01:58 org.apache.jk.server.JkMain start
INFO: APR not loaded, disabling jni components: java.io.IOException:
/usr/lib/apache2/mod_jk2.so: /usr/lib/apache2/mod_jk2.so: undefined symbol:
ap_server_root
18-Mar-2004 10:01:58 org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
18-Mar-2004 10:01:58 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=5/126
config=/usr/local/sites/tomcat/tomcat/conf/jk2.properties




------added to commonhttpd.conf
LoadModule jk2_module /usr/lib/apache2/mod_jk2.so



--/etc/httpd2/conf/workers2.properties
#min for working
[channel.socket:localhost:8019]
info=Ajp13 forwarding over socket
tomcatId=localhost:8019
# Map the Tomcat examples webapp to the Web server uri space
[uri:/examples/*]
info=Map the whole webapp
[shm]
file=/tmp/shm.out
size=100000


--/usr/local/tomcat/conf/jk2.properies
# list of needed handlers.
handler.list=apr,channelSocket,request
# Override the default port for the channelSocket
channelSocket.port=8019
# Dynamic library
apr.NativeSo=/usr/lib/apache2/mod_jk2.so


--added to /usr/local/tomcat/conf/server.xml
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="8019"
minProcessors="5" maxProcessors="75" enableLookups="true"
redirectPort="8443" acceptCount="10" debug="0" connectionTimeout="0"
useURIValidationHack="false"
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" />


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


Re: Tomcat Apache connector not working

Posted by Daniel Savard <ds...@cids.ca>.
Le ven 19/03/2004 à 12:30, Allan Bruce a écrit :

> 
> My output is:
> 
> [root@kes apache2]# ldd mod_jk2.so
>         libc.so.6 => /lib/i686/libc.so.6 (0x40030000)
>         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
> 
> is this a problem? I am quite new to linux so I dont know much about
> libraries.
> Thanks
> Allan
> 

Yes, that is. Your output indicates the mod_jk2.so doesn't know it needs
to bind with many other shared libraries in order to resolve all
symbols. So, it will look only in the two above libraries to resolve all
the symbols, and will not find the ap_server_root (as well as many
others) symbol causing the error.

You may look at the list of symbols which will required to be resolved
at runtime with the nm command: nm mod_jk2.so and all lines beginning
with a U are for undefined symbols. Those with a T are defined within
the current library.

There is no other way than building the module yourself to make it aware
it requires to bind with all other libraries.


-- 

=======================================
Daniel Savard

=======================================



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


Re: Tomcat Apache connector not working

Posted by Allan Bruce <al...@f2s.com>.
----- Original Message ----- 
From: "Daniel Savard" <ds...@cids.ca>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Friday, March 19, 2004 3:27 PM
Subject: Re: Tomcat Apache connector not working


> Le ven 19/03/2004 à 05:11, Allan Bruce a écrit :
>
> >
> > I used an rpm to install the connector.  Do you suggest I uninstall the
rpm
> > and compile the source?
> > Thanks
> > Allan
> >
>
> Before you may do the following check:
>
> Locate the mod_jk2.so file and issue the following command:
>
> ldd mod_jk2.so
>
> It will list all the required libraries for the module to work properly.
> I got the following list on my system:
>
> /usr/lib/libgdkxft.so => /usr/lib/libgdkxft.so (0x4002c000)
> libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 (0x40031000)
> libc.so.6 => /lib/i686/libc.so.6 (0x40054000)
> libgtk-1.2.so.0 => /usr/lib/libgtk-1.2.so.0 (0x40190000)
> libgdk-1.2.so.0 => /usr/lib/libgdk-1.2.so.0 (0x402be000)
> libgmodule-1.2.so.0 => /usr/lib/libgmodule-1.2.so.0 (0x402f4000)
> libglib-1.2.so.0 => /usr/lib/libglib-1.2.so.0 (0x402f7000)
> libdl.so.2 => /lib/libdl.so.2 (0x4031b000)
> libXi.so.6 => /usr/lib/libXi.so.6 (0x4031f000)
> libXext.so.6 => /usr/lib/libXext.so.6 (0x40327000)
> libX11.so.6 => /usr/lib/libX11.so.6 (0x40336000)
> libm.so.6 => /lib/i686/libm.so.6 (0x40400000)
> libXft.so.1 => /usr/lib/libXft.so.1 (0x40423000)
> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
> libXrender.so.1 => /usr/lib/libXrender.so.1 (0x4044d000)
> libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x40452000)
> libz.so.1 => /usr/lib/libz.so.1 (0x404a3000)
>
> If you get something similar, the problem may be with the
> LD_LIBRARY_PATH or the /etc/ld.so.conf, your libraries are not located
> were they are expected and they cannot be found to resolve the symbols
> at runtime.
>
> It seems to me the safest approach would be to recompile from source and
> have some sort of control over what you are doing.
>
> There are already some recent questions on the current mailing list
> which described the options you should pass to the configure. Just be
> warn if it fails at runtime with similar problem, the solution is to
> edit manually the Makefile in native2/server/apache2 directory to
> include manually the missing libraries at the JK_LDFLAGS definition
> line.
>
> I found db-4.0 is not required, another version of the Berkeley DB will
> do as well, given you provide the correct naming to the -l option.
>


My output is:

[root@kes apache2]# ldd mod_jk2.so
        libc.so.6 => /lib/i686/libc.so.6 (0x40030000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

is this a problem? I am quite new to linux so I dont know much about
libraries.
Thanks
Allan


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


Re: Tomcat Apache connector not working

Posted by Daniel Savard <ds...@cids.ca>.
Le ven 19/03/2004 à 05:11, Allan Bruce a écrit :

> 
> I used an rpm to install the connector.  Do you suggest I uninstall the rpm
> and compile the source?
> Thanks
> Allan
> 

Before you may do the following check:

Locate the mod_jk2.so file and issue the following command:

ldd mod_jk2.so

It will list all the required libraries for the module to work properly.
I got the following list on my system:

	/usr/lib/libgdkxft.so => /usr/lib/libgdkxft.so (0x4002c000)
	libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 (0x40031000)
	libc.so.6 => /lib/i686/libc.so.6 (0x40054000)
	libgtk-1.2.so.0 => /usr/lib/libgtk-1.2.so.0 (0x40190000)
	libgdk-1.2.so.0 => /usr/lib/libgdk-1.2.so.0 (0x402be000)
	libgmodule-1.2.so.0 => /usr/lib/libgmodule-1.2.so.0 (0x402f4000)
	libglib-1.2.so.0 => /usr/lib/libglib-1.2.so.0 (0x402f7000)
	libdl.so.2 => /lib/libdl.so.2 (0x4031b000)
	libXi.so.6 => /usr/lib/libXi.so.6 (0x4031f000)
	libXext.so.6 => /usr/lib/libXext.so.6 (0x40327000)
	libX11.so.6 => /usr/lib/libX11.so.6 (0x40336000)
	libm.so.6 => /lib/i686/libm.so.6 (0x40400000)
	libXft.so.1 => /usr/lib/libXft.so.1 (0x40423000)
	/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
	libXrender.so.1 => /usr/lib/libXrender.so.1 (0x4044d000)
	libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x40452000)
	libz.so.1 => /usr/lib/libz.so.1 (0x404a3000)

If you get something similar, the problem may be with the
LD_LIBRARY_PATH or the /etc/ld.so.conf, your libraries are not located
were they are expected and they cannot be found to resolve the symbols
at runtime.

It seems to me the safest approach would be to recompile from source and
have some sort of control over what you are doing.

There are already some recent questions on the current mailing list
which described the options you should pass to the configure. Just be
warn if it fails at runtime with similar problem, the solution is to
edit manually the Makefile in native2/server/apache2 directory to
include manually the missing libraries at the JK_LDFLAGS definition
line.

I found db-4.0 is not required, another version of the Berkeley DB will
do as well, given you provide the correct naming to the -l option.

-- 

=======================================
Daniel Savard

=======================================



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


Re: Tomcat Apache connector not working

Posted by Allan Bruce <al...@f2s.com>.
> Allan, the problem lies with the link-edit while building the mod_jk2.so
> module. The Makefile produced in the some_path/native2/server/apache2/
> is buggy. There is some important libraries missing in the list.
>
> Also, I believe the configure is not checking everything properly. All
> prereqs should be check at the configure step and flagged if not
> satisfied.
>
> You can refer to the following final discussion in the current mailing
> list:
>
> http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg104016.html
>
> What is missing, is the proper JK_LDFLAGS definition which should be:
>
> JK_LDFLAGS=-L${APACHE2_LIBDIR} -lcrypt -lapr-0 -laprutil-0 -lgdbm
> -lexpat -ldb-4.0 -lpthread -ldl
>
> In my case, everything after -lcrypt was missing. And since we are
> building shared objects, symbols are resolved at runtime rather than at
> compile or link-edit time.
>

I used an rpm to install the connector.  Do you suggest I uninstall the rpm
and compile the source?
Thanks
Allan


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


Re: Tomcat Apache connector not working

Posted by Daniel Savard <ds...@cids.ca>.
Le jeu 18/03/2004 à 06:27, Allan Bruce a écrit :
> I have apache and tomcat both up and running.  Now I want to be able to set
> up a connector so that I can browse the 'examples' directory of the tomcat
> installation through apaches port.  The below config doesnt seem to work,
> can somebody please tell me where I am going wrong?
> Thanks
> 
> 
> 
> ----- catalina.out
> 18-Mar-2004 10:01:57 org.apache.coyote.http11.Http11Protocol start
> INFO: Starting Coyote HTTP/1.1 on port 8080
> 18-Mar-2004 10:01:58 org.apache.jk.server.JkMain start
> INFO: APR not loaded, disabling jni components: java.io.IOException:
> /usr/lib/apache2/mod_jk2.so: /usr/lib/apache2/mod_jk2.so: undefined symbol:
> ap_server_root
> 18-Mar-2004 10:01:58 org.apache.jk.common.ChannelSocket init
> INFO: JK2: ajp13 listening on /0.0.0.0:8019
> 18-Mar-2004 10:01:58 org.apache.jk.server.JkMain start
> INFO: Jk running ID=0 time=23/505
> config=/usr/local/sites/tomcat/tomcat/conf/jk2.properties
> 18-Mar-2004 10:01:58 org.apache.jk.server.JkMain start
> INFO: APR not loaded, disabling jni components: java.io.IOException:
> /usr/lib/apache2/mod_jk2.so: /usr/lib/apache2/mod_jk2.so: undefined symbol:
> ap_server_root
> 18-Mar-2004 10:01:58 org.apache.jk.common.ChannelSocket init
> INFO: JK2: ajp13 listening on /0.0.0.0:8009
> 18-Mar-2004 10:01:58 org.apache.jk.server.JkMain start
> INFO: Jk running ID=0 time=5/126
> config=/usr/local/sites/tomcat/tomcat/conf/jk2.properties
> 
> 
> 
> 

Allan, the problem lies with the link-edit while building the mod_jk2.so
module. The Makefile produced in the some_path/native2/server/apache2/
is buggy. There is some important libraries missing in the list.

Also, I believe the configure is not checking everything properly. All
prereqs should be check at the configure step and flagged if not
satisfied.

You can refer to the following final discussion in the current mailing
list:

http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg104016.html

What is missing, is the proper JK_LDFLAGS definition which should be:

JK_LDFLAGS=-L${APACHE2_LIBDIR} -lcrypt -lapr-0 -laprutil-0 -lgdbm
-lexpat -ldb-4.0 -lpthread -ldl

In my case, everything after -lcrypt was missing. And since we are
building shared objects, symbols are resolved at runtime rather than at
compile or link-edit time.

-- 

=======================================
Daniel Savard

=======================================



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