You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rick Roberts <te...@ait-web.com> on 2003/05/16 20:34:23 UTC

Apache 2 - Tomcat 4 - mod_jk2 - Redhat 9

Hello,

I have been away from this list for about a year now.  I canceled 
because it is just to much traffic to keep up with.  This will be maybe 
my 4th time to join this list.  I usually join around the time that I'm 
going thru an upgrade and try to catch up on what's new.

I've been running Apache 1.3x and Tomcat 3.x on Redhat Linux boxes for a 
couple of years and now I'm looking to upgrade to Apache2 and Tomcat 4.

This process is always very difficult for me, for some reason.  Not that 
I'm all that smart to begin with, but the docs have always been pretty 
confusing to me.  I'm more of a developer than a systems admin type, but 
I've been doing this kind of stuff for almost 20 years now (only the 
last 10 or so on unix/linux machines).

Anyway, for the last couple of days, I've been going through as much 
info as I can dig up about configuring Apache2 and Tomcat4 and tried a 
couple of different approaches to getting a working install, but I am 
still confused.  Hopefully, someone can steer me towards a good solution 
to my problem.

It looks like a lot has changed since I last built / installed / 
configured Apache/Tomcat.

I have a previous version of Apache / Tomcat running on a Redhat machine 
that uses the Apache RPM from Redhat which has been working fine for 
more than a year.

I upgraded to Redhat 9 recently and it comes with Apache2 (RPM version 
httpd-2.0.40-21.1), but I could not get mod_jk2 to work with that 
version.  I'm guessing that the Redhat RPM is not current enough for 
mod_jk2?

So I grabbed httpd-2.0.45 from the Apache site but I'm pretty sure I did 
not give all the correct modules to the ./configure script.  Can someone 
tell me which modules are needed for tomcat with mod_jk2 and SSL support?

Is mod_jk2 stable, and is it easy enough for a part-time sys admin to 
install / configure?  Or should I use JK 1.3 or JK 1.4?

I have tried to use some of the archive search tools but, man are they 
difficult to use!  Way to many docs and way to few search options to 
find what I'm looking for.  Why is this list not archived by Google? 
But that's another topic and I'm probably not the first to whine about 
that.  If someone knows of a good way to search the archives, please let 
me know about it.

I remember this list being a really great source of info.  I'm sure it 
still is.  Any help you can give me is greatly appreciated.

Thanks,

-- 
*******************************************
* Rick Roberts                            *
* Advanced Information Technologies, Inc. *
*******************************************


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


Re: Apache 2 - Tomcat 4 - mod_jk2 - Redhat 9

Posted by Mark Eggers <it...@yahoo.com>.
Rick,

I just wrote a long message about this.  For this
particular problem you'll have to set an environment
variable before configuring:

export CPPFLAGS=-I/usr/kerberos/include

Redhat's RPMs put the kerberos includes in a
'nonstandard' spot.

HTH

/mde/
just my two cents . . . .

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

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


Re: Apache 2 - Tomcat 4 - mod_jk2 - Redhat 9

Posted by Rick Roberts <te...@ait-web.com>.
I'm getting errors from the Apache ./configure script.  They have to do 
with mod-ssl / openssl.

I currently have openssl-0.9.7a-5 (Redhat RPM).

I notice that openssl-0.9.7b is available at openssl.org.  Guess I will 
give that a try and see what happens.

----

This is the ./configure command I used:
./configure --prefix=/home/apache2 --enable-ssl --enable-module=so


Here is the error outpup:
In file included from /usr/include/openssl/ssl.h:179,
                  from mod_ssl.h:111,
                  from mod_ssl.c:60:
/usr/include/openssl/kssl.h:72:18: krb5.h: No such file or directory
In file included from /usr/include/openssl/ssl.h:179,
                  from mod_ssl.h:111,
                  from mod_ssl.c:60:
/usr/include/openssl/kssl.h:132: parse error before "krb5_enctype"
/usr/include/openssl/kssl.h:134: parse error before "FAR"
/usr/include/openssl/kssl.h:135: parse error before '}' token
/usr/include/openssl/kssl.h:147: parse error before "kssl_ctx_setstring"
/usr/include/openssl/kssl.h:147: parse error before '*' token
/usr/include/openssl/kssl.h:148: parse error before '*' token
/usr/include/openssl/kssl.h:149: parse error before '*' token
/usr/include/openssl/kssl.h:149: parse error before '*' token
/usr/include/openssl/kssl.h:150: parse error before '*' token
/usr/include/openssl/kssl.h:151: parse error before "kssl_ctx_setprinc"
/usr/include/openssl/kssl.h:151: parse error before '*' token
/usr/include/openssl/kssl.h:153: parse error before "kssl_cget_tkt"
/usr/include/openssl/kssl.h:153: parse error before '*' token
/usr/include/openssl/kssl.h:155: parse error before "kssl_sget_tkt"
/usr/include/openssl/kssl.h:155: parse error before '*' token
/usr/include/openssl/kssl.h:157: parse error before "kssl_ctx_setkey"
/usr/include/openssl/kssl.h:157: parse error before '*' token
/usr/include/openssl/kssl.h:159: parse error before "context"
/usr/include/openssl/kssl.h:160: parse error before "kssl_build_principal_2"
/usr/include/openssl/kssl.h:160: parse error before "context"
/usr/include/openssl/kssl.h:163: parse error before "kssl_validate_times"
/usr/include/openssl/kssl.h:163: parse error before "atime"
/usr/include/openssl/kssl.h:165: parse error before "kssl_check_authent"
/usr/include/openssl/kssl.h:165: parse error before '*' token
/usr/include/openssl/kssl.h:167: parse error before "enctype"
In file included from mod_ssl.h:111,
                  from mod_ssl.c:60:
/usr/include/openssl/ssl.h:909: parse error before "KSSL_CTX"
/usr/include/openssl/ssl.h:909: warning: no semicolon at end of struct 
or union
/usr/include/openssl/ssl.h:931: parse error before '}' token
make[3]: *** [mod_ssl.lo] Error 1


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


Re: Apache 2 - Tomcat 4 - mod_jk2 - Redhat 9

Posted by John Turner <to...@johnturner.com>.
On Fri, 16 May 2003 14:34:23 -0400, Rick Roberts <te...@ait-web.com> 
wrote:

> I upgraded to Redhat 9 recently and it comes with Apache2 (RPM version 
> httpd-2.0.40-21.1), but I could not get mod_jk2 to work with that 
> version.  I'm guessing that the Redhat RPM is not current enough for 
> mod_jk2?

Correct.  Red Hat's Apache is a munged distribution of the official Apache 
distribution.  In my opinion, you shouldn't use it, but that's me.  If you 
do use it, you will need to build your connectors from source.

> So I grabbed httpd-2.0.45 from the Apache site but I'm pretty sure I did 
> not give all the correct modules to the ./configure script.  Can someone 
> tell me which modules are needed for tomcat with mod_jk2 and SSL support?

I have a complete HOWTO for Red Hat 7.x here:

http://www.johnturner.com/howto

I am told via email by others who have used it that it is fine for Red Hat 
8 and 9, though I cannot confirm this as I only use 7.2/3 at the moment.  
My HOWTO uses JK (mod_jk).

> Is mod_jk2 stable, and is it easy enough for a part-time sys admin to 
> install / configure?  Or should I use JK 1.3 or JK 1.4?

Depends on your definition of "stable".  In general: probably.  If you want 
a proven, stable configuration, stick with mod_jk for now, though many 
people are using mod_jk2 without problems.  It's really up to you.  
Tomcat's CoyoteConnector handles both at the moment, though in the future 
its possible it will only support JK2.

> I have tried to use some of the archive search tools but, man are they 
> difficult to use!  Way to many docs and way to few search options to find 
> what I'm looking for.  Why is this list not archived by Google? But 
> that's another topic and I'm probably not the first to whine about that.  
> If someone knows of a good way to search the archives, please let me know 
> about it.

Sorry, can't help you here.

John

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

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


Re: Apache 2 - Tomcat 4 - mod_jk2 - Redhat 9

Posted by Rick Roberts <te...@ait-web.com>.
Mark,

Thanks for the info.  I think I'm almost there.  However, I'm hitting an 
error with the mod_jk2 connector ./configure command.

Here is the ./configure that I use:

   ./configure --with-apxs2=/usr/local/apache2/bin/apxs \
	      --with-tomcat41=/var/tomcat4 \
	      --with-java-home=/usr/java/jdk1.4 \
	      --with-jni \
	      --with-pcre

Here is the error that I hit:

building connector for "apache-2.0"
checking for tomcat33 location... not provided
checking for tomcat40 location... not provided
checking for tomcat41 location... /var/tomcat4
checking for JDK location (please wait)... /usr/java/jdk1.4
checking Java platform... checking Java platform...
checking os_type directory...  linux
configure: error: Apache 1.3 need apr to use jni


Why does error referenc3 Apache 1.3?
Notice just above that it's knows we are building connector for 
"apache-2.0".

Any help greatly appreciated.

Thanks again,

Rick

-- 
*******************************************
* Rick Roberts                            *
* Advanced Information Technologies, Inc. *
*******************************************


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


Re: Apache 2 - Tomcat 4 - mod_jk2 - Redhat 9

Posted by Mark Eggers <it...@yahoo.com>.
Thanks John!

Except that my apache configure command builds all the
modules in as static.  I'm reworking that command and
will report it shortly.

The configure command for httpd should have been:

/configure --enable-modules=all \
           --enable-modules=ssl  \
           --enable-mods-shared=most

I think i left out the '-mods' in the shared command
line switch.

Oops

/mde/
just my two cents . . . .


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

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


Re: Apache 2 - Tomcat 4 - mod_jk2 - Redhat 9

Posted by John Turner <to...@johnturner.com>.
You da Man, Mark.

John

On Fri, 16 May 2003 13:22:46 -0700 (PDT), Mark Eggers 
<it...@yahoo.com> wrote:

> Rick,
>
> In general, building stuff with Redhat's Apache RPM is
> a pain, since they've scattered the files all over the
> place after building the software.  This means that
> apxs has no clue where things are.
>
> I agree with John, in that the first thing you should
> do is uninstall the Apache RPM, the apache-dev rpm,
> and the apache user and group as well.
>
> Also, Redhat 9 has the GNU Java compiler installed. You'll need to move 
> /usr/bin/[jar,rmic,rmiregistry]
> out of your path.
>
> Sun's j2sdk 1.4.1_02 has some issues with Redhat Linux
> 9, so you'll need to go with the 1.4.2-beta.  I
> install both in /usr/<j2sdk-version>, and then link
> the one I want to /usr/java.
>
> Finally, put /usr/java/bin in the PATH variable, and
> set JAVA_HOME to /usr/java.
>
> Next, download the binary package of Tomcat.  I use
> 4.1.24 - the full edition.  I usually create a Tomcat
> user, and install Tomcat there.  Set CATALINA_HOME and
> TOMCAT_HOME to point to the root of the install
> (/home/tomcat in my case).
>
> Get the source for Apache 2.0.45, uncompress, and
> untar it.  Now set CPPFLAGS=-I/usr/kerberos/include,
> since Redhat places the Kerberos headers in a
> nonstandard place.
>
> With Redhat 9, I could not get a custom layout to
> work, so just edited the <Layout Apache></Layout> in
> config.layout to suit my needs.  Like for Tomcat, I
> created an apache user with its directory in
> /home/apache.
>
> Now you can configure and build the web server.  I
> used the following to configure the web server:
>
> ./configure --with-modules=all \
> --with-shared=most \
> --with-module=ssl \
> --with-mods-shared=ssl
>
> mod_ssl is not included in --with-modules=all, so you
> have to specify that separately.
>
> Then you can do the make, and make install.  Be sure
> to change the ownership of the files after make
> install to reflect your apache user.  Also, the user
> nobody is really limited in Redhat 9 and doesn't
> appear to work like you would expect.  I set up an
> apache-run user that has the same group membership,
> but no write permissions to /home/apache (except for
> the logs).
>
> Now finally, you can build the mod_jk2 connector. Here's a quick HOWTO 
> for that:
>
> 1. Download
> jakarta-tomcat-connectors-jk2-2.0.2-src.tar.gz from
> http://jakarta.apache.org/builds/jakarta-tomcat- 
> connectors/jk2/release/v2.0.2/src/
>
> 2. Uncompress it and extract the tar file.
>
> 3. cd to
> jakarta-tomcat-connectors-jk2-2.0.2-src/jk/native2
>
> 4. chmod u+x configure
>
> 5. Run configure with:
>
> ./configure
> --with-apxs2=<apache-root-directory>/bin/apxs \
> --with-tomcat41=<tomcat-root-directory> \
> --with-java-home=<java-root-directory> \
> --with-jni \
> --with-pcre
>
> For example:
>
> ./configure --with-apxs2=/home/apache/bin/apxs \
> 	      --with-tomcat41=/home/tomcat \
> 	      --with-java-home=/usr/java \
> 	      --with-jni \
> 	      --with-pcre
>
> 6. Run make
>
> 7. The two .so files (mod_jk2.so and jkjni.so) will be
> in:
> jakarta-tomcat-connectors-jk2-2.0.2-src/jk/build/jk2/apache2
>
> 8. Copy those to files to
> <apache-root-directory>/modules with the proper
> permissions.
>
> 9. Configure and restart
>
> Finally, here are minimal jk2.properties (in
> $TOMCAT_HOME/conf) and workers2.properties (in
> <apache-root-directory>/conf) files that will set up a
> socket connection between Tomcat and Apache.
>
> # jk2.workers
> # Socket configuration
> #
> handler.list=request,container,channelSocket
>
> #
> # socket configuration
> #
> channelSocket.port=8009
> channelSocket.address=127.0.0.1
> channelSocket.maxPort=port+10
>
> #
> # workers2.properties
> #
>
> [shm]
> file=/home/apache/logs/shm.file
> size=1048576
>
> [workerEnv:]
> info=Global server options
> timing=1
> debug=0
>
> # Example socket channel, override port and host.
> [channel.socket:localhost:8009]
> port=8009
> host=127.0.0.1
>
> # define the worker
> [ajp13:localhost:8009]
> channel=channel.socket:localhost:8009
>
> # define the worker
> [status:status]
>
> # Uri mapping
> [uri:/jkstatus/*]
> worker=status:status
>
> # Uri mapping
> [uri:/examples/*.jsp]
> worker=ajp13:localhost:8009
>
> # [uri:/examples/servlet/*]
> worker=ajp13:localhost:8009
>
> You'll need an Alias directive in httpd.conf to catch
> html, images, etc. from the Tomcat examples.
>
> I apologize for the length of this message, but there
> is a lot of ground to cover.
>
> HTH
>
> /mde/
> just my two cents . . . .
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

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


Re: Apache 2 - Tomcat 4 - mod_jk2 - Redhat 9

Posted by Mark Eggers <it...@yahoo.com>.
Yes - this should be jk2.properties.

/mde/
just my two cents . . . .


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

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


Re: Apache 2 - Tomcat 4 - mod_jk2 - Redhat 9

Posted by Rick Roberts <te...@ait-web.com>.
Shouldn't this be jk2.properties vice jk2.workers?


# jk2.workers
# Socket configuration
#
handler.list=request,container,channelSocket

#
# socket configuration
#
channelSocket.port=8009
channelSocket.address=127.0.0.1
channelSocket.maxPort=port+10


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


Re: Apache 2 - Tomcat 4 - mod_jk2 - Redhat 9

Posted by Mark Eggers <it...@yahoo.com>.
Rick,

In general, building stuff with Redhat's Apache RPM is
a pain, since they've scattered the files all over the
place after building the software.  This means that
apxs has no clue where things are.

I agree with John, in that the first thing you should
do is uninstall the Apache RPM, the apache-dev rpm,
and the apache user and group as well.

Also, Redhat 9 has the GNU Java compiler installed. 
You'll need to move /usr/bin/[jar,rmic,rmiregistry]
out of your path.

Sun's j2sdk 1.4.1_02 has some issues with Redhat Linux
9, so you'll need to go with the 1.4.2-beta.  I
install both in /usr/<j2sdk-version>, and then link
the one I want to /usr/java.

Finally, put /usr/java/bin in the PATH variable, and
set JAVA_HOME to /usr/java.

Next, download the binary package of Tomcat.  I use
4.1.24 - the full edition.  I usually create a Tomcat
user, and install Tomcat there.  Set CATALINA_HOME and
TOMCAT_HOME to point to the root of the install
(/home/tomcat in my case).

Get the source for Apache 2.0.45, uncompress, and
untar it.  Now set CPPFLAGS=-I/usr/kerberos/include,
since Redhat places the Kerberos headers in a
nonstandard place.

With Redhat 9, I could not get a custom layout to
work, so just edited the <Layout Apache></Layout> in
config.layout to suit my needs.  Like for Tomcat, I
created an apache user with its directory in
/home/apache.

Now you can configure and build the web server.  I
used the following to configure the web server:

./configure --with-modules=all \
            --with-shared=most \
            --with-module=ssl \
            --with-mods-shared=ssl

mod_ssl is not included in --with-modules=all, so you
have to specify that separately.

Then you can do the make, and make install.  Be sure
to change the ownership of the files after make
install to reflect your apache user.  Also, the user
nobody is really limited in Redhat 9 and doesn't
appear to work like you would expect.  I set up an
apache-run user that has the same group membership,
but no write permissions to /home/apache (except for
the logs).

Now finally, you can build the mod_jk2 connector. 
Here's a quick HOWTO for that:

1. Download
jakarta-tomcat-connectors-jk2-2.0.2-src.tar.gz from
  
http://jakarta.apache.org/builds/jakarta-tomcat-connectors/jk2/release/v2.0.2/src/

2. Uncompress it and extract the tar file.

3. cd to
jakarta-tomcat-connectors-jk2-2.0.2-src/jk/native2

4. chmod u+x configure

5. Run configure with:

   ./configure
    --with-apxs2=<apache-root-directory>/bin/apxs \
    --with-tomcat41=<tomcat-root-directory> \
    --with-java-home=<java-root-directory> \
    --with-jni \
    --with-pcre

For example:

  ./configure --with-apxs2=/home/apache/bin/apxs \
	      --with-tomcat41=/home/tomcat \
	      --with-java-home=/usr/java \
	      --with-jni \
	      --with-pcre

6. Run make

7. The two .so files (mod_jk2.so and jkjni.so) will be
in:
  
jakarta-tomcat-connectors-jk2-2.0.2-src/jk/build/jk2/apache2

8. Copy those to files to
<apache-root-directory>/modules with the proper
permissions.

9. Configure and restart

Finally, here are minimal jk2.properties (in
$TOMCAT_HOME/conf) and workers2.properties (in
<apache-root-directory>/conf) files that will set up a
socket connection between Tomcat and Apache.

# jk2.workers
# Socket configuration
#
handler.list=request,container,channelSocket

#
# socket configuration
#
channelSocket.port=8009
channelSocket.address=127.0.0.1
channelSocket.maxPort=port+10

#
# workers2.properties
#

[shm]
file=/home/apache/logs/shm.file
size=1048576

[workerEnv:]
info=Global server options
timing=1
debug=0

# Example socket channel, override port and host.
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1

# define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009

# define the worker
[status:status]

# Uri mapping
[uri:/jkstatus/*]
worker=status:status

# Uri mapping
[uri:/examples/*.jsp]
worker=ajp13:localhost:8009

# [uri:/examples/servlet/*]
worker=ajp13:localhost:8009

You'll need an Alias directive in httpd.conf to catch
html, images, etc. from the Tomcat examples.

I apologize for the length of this message, but there
is a lot of ground to cover.

HTH

/mde/
just my two cents . . . .

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

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