You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Armand Rock <ro...@gilmore.ca> on 2006/03/27 18:58:36 UTC
SSL Using APR Connectors under Linux not working
Hello,
I succesfully got SSL to work in a windows xp environment by copying the
"tcnative-1.dll" file to the /tomcat/bin directory and restarting. The
following is the APR port 443 settings within server.xml. These settings
work succesfully within a windows environment:
<Connector port="443" maxHttpHeaderSize="8192" maxThreads="150"
minSpareThreads="25"
maxSpareThreads="75" enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
SSLEngine="on"
SSLCertificateFile="/somedirectory/somefile.cer"
SSLCertificateKeyFile="/somedirectory/somefile.key" />
I tried installing under Linux Fedora Core 4 and I get a "Page cannot be
displayed" error when i try to connect to the SSL port (http seems to work
fine). Again, this works fine under Windows.
Here is the steps I took under Linux:
Downloaded "apr-1.2.2.tar.gz" and unziped it within the directory
/tmp/apr-1.2.2
Unziped the file "tomcat-native-1.1.1.tar.gz" and unziped it within the
directory /tomcat/bin/tomcat-native-1.1.1
Went into the directory /tomcat/bin/tomcat-native-1.1.1/jni/native/
typed "./configure --with-apr=/tmp/apr-1.2.2/ && make && make install" and
received the following output:
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for working mkdir -p... yes
Tomcat Native Version: 1.1.1
checking for chosen layout... tcnative
checking for APR... yes
setting CC to "gcc"
setting CPP to "gcc -E"
checking for a BSD-compatible install... /usr/bin/install -c
checking for JDK location (please wait)... /usr/local/java/j2sdk1.4.2_04
from environment
checking Java platform... checking Java platform...
checking for sablevm... NONE
adding "-I/usr/local/java/j2sdk1.4.2_04/include" to TCNATIVE_PRIV_INCLUDES
checking os_type directory... linux
adding "-I/usr/local/java/j2sdk1.4.2_04/include/linux" to
TCNATIVE_PRIV_INCLUDES
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
none
checking for OpenSSL version... checking openssl/opensslv.h usability... yes
checking openssl/opensslv.h presence... yes
checking for openssl/opensslv.h... yes
OK
checking openssl/engine.h usability... yes
checking openssl/engine.h presence... yes
checking for openssl/engine.h... yes
checking for SSLeay_version in -lcrypto... yes
checking for SSL_CTX_new in -lssl... yes
checking for ENGINE_init... yes
checking for ENGINE_load_builtin_engines... yes
checking for SSL_set_cert_store... no
forcing SSL_LIBS to "-lssl -lcrypto"
adding "-DHAVE_OPENSSL" to CFLAGS
setting TCNATIVE_LIBS to ""
setting TCNATIVE_LIBS to "
tmp/apr-1.2.2/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl"
setting TCNATIVE_LDFLAGS to ""
configure: creating ./config.status
config.status: creating tcnative.pc
config.status: creating Makefile
config.status: executing default commands
make[1]: Entering directory `/tomcat/bin/tomcat-native-1.1.1/jni/native'
make[1]: Nothing to be done for `local-all'.
make[1]: Leaving directory `/tomcat/bin/tomcat-native-1.1.1/jni/native'
make[1]: Entering directory `/tomcat/bin/tomcat-native-1.1.1/jni/native'
make[1]: Nothing to be done for `local-all'.
make[1]: Leaving directory `/tomcat/bin/tomcat-native-1.1.1/jni/native'
/tmp/apr-1.2.2/build/mkdir.sh /usr/local/apr/include/apr-1
/usr/local/apr/lib/pkgconfig \
/usr/local/apr/lib /usr/local/apr/bin
/usr/bin/install -c -m 644 tcnative.pc
/usr/local/apr/lib/pkgconfig/tcnative-1.pc
list=''; for i in $list; do \
( cd $i ; make DESTDIR= install ); \
done
/bin/sh /tmp/apr-1.2.2/libtool --mode=install /usr/bin/install -c -m 755
libtcnative-1.la /usr/local/apr/lib
libtool: install: warning: relinking `libtcnative-1.la'
(cd /tomcat/bin/tomcat-native-1.1.1/jni/native; /bin/sh
/tmp/apr-1.2.2/libtool --silent --mode=relink
gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_
LARGEFILE64_SOURCE -g -O2 -DHAVE_OPENSSL -I/tomcat/bin/tomcat-native-1.1.1/j
ni/native/include -I/usr/local/java/j2sdk1.4.2_04/include -I/usr/local/java/
j2sdk1.4.2_04/include/linux -I/tmp/apr-1.2.2/include -version-info 2:2:2 -o
libtcnative-1.la -rpath /usr/local/apr/lib src/os.lo src/info.lo src/poll.lo
src/pool.lo src/misc.lo src/error.lo src/shm.lo src/proc.lo src/mmap.lo
src/network.lo src/sslcontext.lo src/dir.lo src/user.lo src/sslnetwork.lo
src/sslutils.lo src/ssl.lo src/file.lo src/sslinfo.lo src/stdlib.lo
src/lock.lo src/jnilib.lo os/unix/uxpipe.lo os/unix/system.lo
/tmp/apr-1.2.2/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl -lssl -lcrypto
)
/usr/bin/install -c -m 755 .libs/libtcnative-1.so.0.2.2T
/usr/local/apr/lib/libtcnative-1.so.0.2.2
(cd /usr/local/apr/lib && { ln -s -f libtcnative-1.so.0.2.2
libtcnative-1.so.0 || { rm -f libtcnative-1.so.0 && ln -s
libtcnative-1.so.0.2.2 libtcnative-1.so.0; }; })
(cd /usr/local/apr/lib && { ln -s -f libtcnative-1.so.0.2.2 libtcnative-1.so
|| { rm -f libtcnative-1.so && ln -s libtcnative-1.so.0.2.2
libtcnative-1.so; }; })
/usr/bin/install -c -m 755 .libs/libtcnative-1.lai
/usr/local/apr/lib/libtcnative-1.la
/usr/bin/install -c -m 755 .libs/libtcnative-1.a
/usr/local/apr/lib/libtcnative-1.a
ranlib /usr/local/apr/lib/libtcnative-1.a
chmod 644 /usr/local/apr/lib/libtcnative-1.a
PATH="$PATH:/sbin" ldconfig -n /usr/local/apr/lib
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/apr/lib
I then copied the .so library file from /usr/local/apr/lib/libtcnative-1.so
to /tomcat/bin/libtcnative-1.so
I restarted Tomcat....I'm still getting a page cannot be displayed error.
Is there anything else I perhaps need to do?
-
Armand Rock
Team Lead
Senior E-Business Developer
Gilmore </OverKlick> Technologies
(613)592-2944 ext. 3026
(613)795-6661 ext. 3026
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: SSL Using APR Connectors under Linux not working
Posted by Remy Maucherat <re...@gmail.com>.
On 3/28/06, Armand Rock <ro...@gilmore.ca> wrote:
> Thanks for the help...it works now...kind of...
> Http is no longer functioning 100% of the time (random images seem to not
> display anymore...
> getting rid of the APR changes fixes the problem...
> I'm going to have to take a look and see if there are any known bugs with
> the APR connectors under linux
> or if there is something else that needs to be done
You should update to Tomcat native 1.1.2.
--
xxxxxxxxxxxxxxxxxxxxxxxxx
Rémy Maucherat
Developer & Consultant
JBoss Inc
xxxxxxxxxxxxxxxxxxxxxxxxx
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: SSL Using APR Connectors under Linux not working
Posted by Markus Schönhaber <ma...@schoenhaber.de>.
Armand Rock wrote:
> Thanks for the help...it works now...kind of...
> Http is no longer functioning 100% of the time (random images seem to not
> display anymore...
> getting rid of the APR changes fixes the problem...
> I'm going to have to take a look and see if there are any known bugs with
> the APR connectors under linux
Almost all known bugs habe been fixed in Tomcat 5.5.16 and tomcat-native 1.1.2
(due to a packaging bug, 5.5.16 comes with the older tomcat-native 1.1.1
which won't work).
You didn't mention which Tomcat version you're using. If it isn't 5.5.16 the
first step should be to upgrade.
AFAIK the exception is a bug in the OS detection that was fixed after 5.5.16
was released. This bug, on my machine, had the effect that SO_REUSEADDR isn't
set on the APR-sockets, which in turn can cause a restart of Tomcat to fail
with "address already in use" if there are connections still in CLOSE_WAIT
state.
Regards
mks
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: SSL Using APR Connectors under Linux not working
Posted by Armand Rock <ro...@gilmore.ca>.
Thanks for the help...it works now...kind of...
Http is no longer functioning 100% of the time (random images seem to not
display anymore...
getting rid of the APR changes fixes the problem...
I'm going to have to take a look and see if there are any known bugs with
the APR connectors under linux
or if there is something else that needs to be done
-----Original Message-----
From: Markus Schönhaber [mailto:mailing-tomcat-user@schoenhaber.de]
Sent: Monday, March 27, 2006 4:29 PM
To: Tomcat Users List
Subject: Re: SSL Using APR Connectors under Linux not working
Armand Rock wrote:
[...]
> Libraries have been installed in:
> /usr/local/apr/lib
>
> I then copied the .so library file from
/usr/local/apr/lib/libtcnative-1.so
> to /tomcat/bin/libtcnative-1.so
> I restarted Tomcat....I'm still getting a page cannot be displayed error.
By default, if Tomcat doesn't find libtcnative-1.so, it will generate a log
message in catalina.out that contains information where it looked for it.
In contrast to Windows, on Linux <Tomcat dir>/bin isn't searched for native
libs by default and it therefore has no effect to copy libtcnative-1.so in
there.
> Is there anything else I perhaps need to do?
Add the directory that contains the native lib either to the environment
variable LD_LIBRARY_PATH or the Java property java.library.path when
starting
Tomcat. The easiest way to achieve this might be to create a file named
"setenv.sh" in <Tomcat dir>/bin which contains
# File content starts here
export LD_LIBRARY_PATH=/usr/local/apr/lib
# File content ends here
(the path "/usr/local/apr/lib" is taken from what you wrote above).
Regards
mks
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: SSL Using APR Connectors under Linux not working
Posted by Markus Schönhaber <ma...@schoenhaber.de>.
Armand Rock wrote:
[...]
> Libraries have been installed in:
> /usr/local/apr/lib
>
> I then copied the .so library file from /usr/local/apr/lib/libtcnative-1.so
> to /tomcat/bin/libtcnative-1.so
> I restarted Tomcat....I'm still getting a page cannot be displayed error.
By default, if Tomcat doesn't find libtcnative-1.so, it will generate a log
message in catalina.out that contains information where it looked for it.
In contrast to Windows, on Linux <Tomcat dir>/bin isn't searched for native
libs by default and it therefore has no effect to copy libtcnative-1.so in
there.
> Is there anything else I perhaps need to do?
Add the directory that contains the native lib either to the environment
variable LD_LIBRARY_PATH or the Java property java.library.path when starting
Tomcat. The easiest way to achieve this might be to create a file named
"setenv.sh" in <Tomcat dir>/bin which contains
# File content starts here
export LD_LIBRARY_PATH=/usr/local/apr/lib
# File content ends here
(the path "/usr/local/apr/lib" is taken from what you wrote above).
Regards
mks
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org