PDA

View Full Version : Need help with apache+tomcat.(urgent)


loyal_lin
7th June 2004, 01:06 PM
hello

5 days ago i managed to setup apache
and it worked. soon after i tried to setup tomcat and although i started i couldn t reach the page
localhost:8080. maybe because of the firewall.
so i said i should install a connector. i picked up jk1.2.5. i installed it , i run the configuration script but after "make" i got this:
Making all in common
make[1]: Entering directory `/usr/local/src/jakarta-tomcat-connectors-jk-1.2.5-src/jk/native/common'
/bin/sh /usr/lib/apr/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -g -O2 -O2 -g -pipe -march=i386 -mcpu=i686 -pthread -DHAVE_APR -g -O2 -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -I /usr/java/j2sdk1.4.2_04/include -I /usr/java/j2sdk1.4.2_04/include/ -c jk_connect.c
jk_connect.c:99:28: apr_network_io.h: No such file or directory
jk_connect.c:100:23: apr_errno.h: No such file or directory
jk_connect.c:101:25: apr_general.h: No such file or directory
jk_connect.c: In function `jk_resolve':
jk_connect.c:140: error: `apr_pool_t' undeclared (first use in this function)
jk_connect.c:140: error: (Each undeclared identifier is reported only once
jk_connect.c:140: error: for each function it appears in.)
jk_connect.c:140: error: `context' undeclared (first use in this function)
jk_connect.c:141: error: `apr_sockaddr_t' undeclared (first use in this function)
jk_connect.c:141: error: `remote_sa' undeclared (first use in this function)
jk_connect.c:145: error: `APR_SUCCESS' undeclared (first use in this function)
jk_connect.c:148: error: `APR_UNSPEC' undeclared (first use in this function)
jk_connect.c:148: error: `apr_port_t' undeclared (first use in this function)
jk_connect.c:148: error: syntax error before "port"
make[1]: *** [jk_connect.lo] Error 1
make[1]: Leaving directory `/usr/local/src/jakarta-tomcat-connectors-jk-1.2.5-src/jk/native/common'
make: *** [all-recursive] Error 1

as it seems tha epr header files are not seen.
i am desperate as i have to implement a project with java servlets.
thanks....immediate help needed

deuch
7th June 2004, 06:51 PM
if you have a FC1, jakarta site provide a package with mod_jk 2 ...

For FC2; on the 4th CD, you have the RPM for mod_jk ...

To use Tomcat you havve to set variable :

TOMCAT_HOME=path_of_tomcat
JAVA_HOME=path_of_jdk

For tomcat, you have to use port 8080 and 80 for apache.

With tomcat + apache, you can see the welcome page of apache with http://localhost

hope it helps,
deuch

jeru
8th June 2004, 01:47 PM

CATALINA_HOME=path to tomcat

You should probably start using mod_jk2 instead of jk these days. mod_jk2 is better suited for multithreaded servers like apache2 and was made to replace mod_jk. It's just too hard to get people to figure out and use an almost undocumented configuration. (or step away from the autoconfig patch that was made for mod_jk)

Tomcat doesn't need to be running on 8080, 8080 is irrelivent to the working with the JK/AJP13 protocol that runs on 8009. mod_jk and mod_jk2 only connect using this but even they can be configured to use whatever port you choose. 8009 is just default. 8080 is just the connector you use if you want to reach tomcat directly via http.

Like duech said, get the mod_jk2 DSO module from the FC2 build... There shouldn't be any harm in that. But it's also very easy to build if you feel like doing so. Then you just need to set your workers2.properties file to pass off whatever uri's tomcat container should process instead of apache. You'll also need to configure apache's httpd.conf to forward all /*.jsp requests to the JK/AJP13 connector

Here's a relativly new compilation/additions/updates of howto's I did for my brother in law... Not complete but should get you going initially.

http://mikepalmer.net/howto/

Tycho316
10th June 2004, 05:15 AM
what was your ./configure command?
i have to "./configure with-apxs=/usr/local/apache/bin/apxs" to make.

odysseus
11th June 2004, 06:27 PM
omg!

thx for the link, this rescued me from a 2-week-struggle, editing config-files, starting and stopping tomcats and apaches..

it works, apache and tomcat talk to each other :)