You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dejan Stamenov <de...@outlook.com> on 2015/05/17 21:22:24 UTC

Problem with APR library - Tomcat 7

Hello,

 

I am working on a project where I need to install SSL certificates on Tomcat
7 server for my Java application. I have been experimenting around, I have
set up the connector in the server.xml file, but when I look into the logs I
can see this:

http://prntscr.com/76a98v

 

For the connector to be working, I needed to install APR library. I did so,
following this guide here:
http://www.techsww.com/tutorials/libraries/apr/installation/installing_apach
e_portable_runtime_library_on_ubuntu_linux.php

In my case, I use the apr-1.5.2 version. Also, in the configure -prefix part
I have specified the URL that is shown on my server error log, i.e.
/usr/lib/x86_64-linux-gnu. After server reboot, I still get the same error.
Have been looking around the internet how to solve this, but only found a
couple of open questions on Stack Overflow/Exchange with no answers in them.

 

Regards,

Dejan Stamenov

 <ma...@outlook.com> dejanstamenov93@outlook.com
Student at the Faculty of computer science and engineering, Skopje
Student ID: 122003
Prilep, Macedonia
+389(0)75 279 857

 


RE: Problem with APR library - Tomcat 7

Posted by Dejan Stamenov <de...@outlook.com>.
Hello Mark,

I have installed the native library from the links you provided, but still I got the same error: http://prntscr.com/76ycyo
How does it come after installing the native library, still can't find the APR library?

> Date: Mon, 18 May 2015 11:07:29 +0100
> From: markt@apache.org
> To: users@tomcat.apache.org
> Subject: Re: Problem with APR library - Tomcat 7
> 
> On 17/05/2015 20:22, Dejan Stamenov wrote:
> > Hello,
> > 
> >  
> > 
> > I am working on a project where I need to install SSL certificates on Tomcat
> > 7 server for my Java application. I have been experimenting around, I have
> > set up the connector in the server.xml file, but when I look into the logs I
> > can see this:
> > 
> > http://prntscr.com/76a98v
> > 
> >  
> > 
> > For the connector to be working, I needed to install APR library. I did so,
> > following this guide here:
> > http://www.techsww.com/tutorials/libraries/apr/installation/installing_apach
> > e_portable_runtime_library_on_ubuntu_linux.php
> > 
> > In my case, I use the apr-1.5.2 version. Also, in the configure -prefix part
> > I have specified the URL that is shown on my server error log, i.e.
> > /usr/lib/x86_64-linux-gnu. After server reboot, I still get the same error.
> > Have been looking around the internet how to solve this, but only found a
> > couple of open questions on Stack Overflow/Exchange with no answers in them.
> 
> Apache Tomcat Native (for the APR/native connector) != Apache APR.
> 
> (Apache Tomcat Native depends on Apache APR).
> 
> http://tomcat.apache.org/native-doc/
> http://tomcat.apache.org/download-native.cgi
> 
> Mark
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
 		 	   		  

Re: Problem with APR library - Tomcat 7

Posted by Mark Thomas <ma...@apache.org>.
On 17/05/2015 20:22, Dejan Stamenov wrote:
> Hello,
> 
>  
> 
> I am working on a project where I need to install SSL certificates on Tomcat
> 7 server for my Java application. I have been experimenting around, I have
> set up the connector in the server.xml file, but when I look into the logs I
> can see this:
> 
> http://prntscr.com/76a98v
> 
>  
> 
> For the connector to be working, I needed to install APR library. I did so,
> following this guide here:
> http://www.techsww.com/tutorials/libraries/apr/installation/installing_apach
> e_portable_runtime_library_on_ubuntu_linux.php
> 
> In my case, I use the apr-1.5.2 version. Also, in the configure -prefix part
> I have specified the URL that is shown on my server error log, i.e.
> /usr/lib/x86_64-linux-gnu. After server reboot, I still get the same error.
> Have been looking around the internet how to solve this, but only found a
> couple of open questions on Stack Overflow/Exchange with no answers in them.

Apache Tomcat Native (for the APR/native connector) != Apache APR.

(Apache Tomcat Native depends on Apache APR).

http://tomcat.apache.org/native-doc/
http://tomcat.apache.org/download-native.cgi

Mark


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


Re: Problem with APR library - Tomcat 7

Posted by Sanaullah <sa...@gmail.com>.
I think in ubuntu/Debian, you can create the file in
/usr/share/tomcat7/bin/setenv.sh
but still you have to explore, as i am not using the deb package for tomcat
installation

On Tue, May 19, 2015 at 6:58 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Dejan,
>
> On 5/19/15 9:45 AM, Dejan Stamenov wrote:
> > I have wrote in the message before, I have specified it at:
> > /usr/lib/x86_64-linux-gnu. In this folder, I can see libapr-1.so,
> > libapr-1.so.0.5.1. and libarputil-1.so.0.5.3 too.
>
> How about libtcnative?
>
> > About the Tomcat /bin folder, it doesn't exist on my Tomcat path:
> > /etc/tomcat7. Should I create it, including the file too?
>
> That's not necessary.
>
> > When I do a search for the setenv.sh file, I can't find it either.
>
> Tomcat doesn't ship with a setenv.sh file. If you want to use one,
> you'll have to create it yourself. If you are using a package-managed
> version of Tomcat, those files could be anywhere. When using a
> standard Tomcat package downloaded from apache.org (or a mirror), then
> setenv.sh should be in CATALINA_BASE/bin/setenv.sh if you'd like to
> create one.
>
> Note that some methods for launching Tomcat ignore setenv.sh (like
> using jsvc, for instance). Make sure you know what you are doing
> before you do it.
>
> - -chris
>
> >> Date: Tue, 19 May 2015 18:38:23 +0500 Subject: Re: Problem with
> >> APR library - Tomcat 7 From: sanaullah82@gmail.com To:
> >> users@tomcat.apache.org
> >>
> >> so where did you specify your Apr lib path for tomcat?
> >>
> >> you can set the Apr lib path in setenv.sh in tomcat bin folder
> >>
> >> JAVA_OPTS="$JAVA_OPTS -Djavax.net.debug=all"
> >> CATALINA_OPTS="-Djava.library.path=/usr/lib/x86_64-linux-gnu/apr/lib"
> >>
> >>
> >>
> you should verify the path and restart the tomcat again also may be you
> >> need to compile the apr-utils as well
> >>
> >>
> >> On Tue, May 19, 2015 at 6:31 PM, Dejan Stamenov
> >> <dejanstamenov93@outlook.com
> >>> wrote:
> >>
> >>> Hello Chris,
> >>>
> >>> First, I have downloaded the APR library from here:
> >>> http://apache.sunsite.ualberta.ca/apr/apr-1.5.2.tar.gz  .
> >>> Following this tutorial:
> >>> http://www.techsww.com/tutorials/libraries/apr/installation/installi
> ng_apache_portable_runtime_library_on_ubuntu_linux.php
> >>>
> >>>
> >>>
> , I have installed this library into /usr/lib/x86_64-linux-gnu.
> >>> After that, I have downloaded the tcnative library from the
> >>> links Mark provided. Also, following the same links I run this
> >>> config command: ./configure
> >>> --with-apr=/usr/lib/x86_64-linux-gnu
> >>> --with-java-home=/usr/lib/jvm/java-7-openjdk-amd64
> >>> --with-ssl=yes --prefix=/usr/lib/x86_64-linux-gnu
> >>>
> >>> That --prefix location is where the error log file is
> >>> expecting for the library to be found. Here is the error log:
> >>>
> >>> May 19, 2015 2:59:58 PM org.apache.catalina.startup.Catalina
> >>> load INFO: Initialization processed in 1973 ms May 19, 2015
> >>> 2:59:58 PM org.apache.catalina.core.StandardService
> >>> startInternal INFO: Starting service Catalina May 19, 2015
> >>> 2:59:58 PM org.apache.catalina.core.StandardEngine
> >>> startInternal INFO: Starting Servlet Engine: Apache
> >>> Tomcat/7.0.52 (Ubuntu) May 19, 2015 2:59:58 PM
> >>> org.apache.catalina.startup.HostConfig deployDirectory INFO:
> >>> Deploying web application directory
> >>> /var/lib/tomcat7/webapps/ROOT May 19, 2015 3:00:02 PM
> >>> org.apache.coyote.AbstractProtocol start INFO: Starting
> >>> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:00:02 PM
> >>> org.apache.catalina.startup.Catalina start INFO: Server
> >>> startup in 4014 ms May 19, 2015 3:06:39 PM
> >>> org.apache.coyote.AbstractProtocol pause INFO: Pausing
> >>> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:06:39 PM
> >>> org.apache.coyote.AbstractProtocol pause INFO: Pausing
> >>> ProtocolHandler ["http-apr-8443"] May 19, 2015 3:06:39 PM
> >>> org.apache.catalina.core.StandardService stopInternal INFO:
> >>> Stopping service Catalina May 19, 2015 3:06:39 PM
> >>> org.apache.coyote.AbstractProtocol stop INFO: Stopping
> >>> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:06:39 PM
> >>> org.apache.coyote.AbstractProtocol destroy INFO: Destroying
> >>> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:06:39 PM
> >>> org.apache.coyote.AbstractProtocol stop INFO: Stopping
> >>> ProtocolHandler ["http-apr-8443"] May 19, 2015 3:06:39 PM
> >>> org.apache.coyote.AbstractProtocol destroy INFO: Destroying
> >>> ProtocolHandler ["http-apr-8443"] May 19, 2015 3:07:08 PM
> >>> org.apache.catalina.startup.ClassLoaderFactory validateFile
> >>> WARNING: Problem with directory
> >>> [/usr/share/tomcat7/common/classes], exists: [false],
> >>> isDirectory: [false], canRead: [false] May 19, 2015 3:07:08 PM
> >>> org.apache.catalina.startup.ClassLoaderFactory validateFile
> >>> WARNING: Problem with directory [/usr/share/tomcat7/common],
> >>> exists: [false], isDirectory: [false], canRead: [false] May
> >>> 19, 2015 3:07:08 PM
> >>> org.apache.catalina.startup.ClassLoaderFactory validateFile
> >>> WARNING: Problem with directory
> >>> [/usr/share/tomcat7/server/classes], exists: [false],
> >>> isDirectory: [false], canRead: [false] May 19, 2015 3:07:08 PM
> >>> org.apache.catalina.startup.ClassLoaderFactory validateFile
> >>> WARNING: Problem with directory [/usr/share/tomcat7/server],
> >>> exists: [false], isDirectory: [false], canRead: [false] May
> >>> 19, 2015 3:07:08 PM
> >>> org.apache.catalina.startup.ClassLoaderFactory validateFile
> >>> WARNING: Problem with directory
> >>> [/usr/share/tomcat7/shared/classes], exists: [false],
> >>> isDirectory: [false], canRead: [false] May 19, 2015 3:07:08 PM
> >>> org.apache.catalina.startup.ClassLoaderFactory validateFile
> >>> WARNING: Problem with directory [/usr/share/tomcat7/shared],
> >>> exists: [false], isDirectory: [false], canRead: [false] May
> >>> 19, 2015 3:07:09 PM
> >>> org.apache.catalina.core.AprLifecycleListener init INFO: The
> >>> APR based Apache Tomcat Native library which allows optimal
> >>> performance in production environments was not found on the
> >>> java.library.path:
> >>> /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_
> 64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
> >>>
> >>>
> >>>
> May 19, 2015 3:07:10 PM org.apache.coyote.AbstractProtocol init
> >>> INFO: Initializing ProtocolHandler ["http-bio-8080"] May 19,
> >>> 2015 3:07:10 PM org.apache.catalina.core.StandardService
> >>> initInternal SEVERE: Failed to initialize connector
> >>> [Connector[HTTP/1.1-8443]]
> >>> org.apache.catalina.LifecycleException: Failed to initialize
> >>> component [Connector[HTTP/1.1-8443]] at
> >>> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
> >>>
> >>>
> >>>
> at
> >>> org.apache.catalina.core.StandardService.initInternal(StandardServic
> e.java:559)
> >>>
> >>>
> >>>
> at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
> >>> at
> >>> org.apache.catalina.core.StandardServer.initInternal(StandardServer.
> java:813)
> >>>
> >>>
> >>>
> at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
> >>> at org.apache.catalina.startup.Catalina.load(Catalina.java:638)
> >>>  at
> >>> org.apache.catalina.startup.Catalina.load(Catalina.java:663) at
> >>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> >>>
> >>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
> .java:57)
> >>>
> >>>
> >>>
> at
> >>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
> ssorImpl.java:43)
> >>>
> >>>
> >>>
> at java.lang.reflect.Method.invoke(Method.java:606)
> >>> at
> >>> org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280)
> >>> at
> >>> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)
> >>>  Caused by: org.apache.catalina.LifecycleException: The
> >>> configured protocol
> >>> [org.apache.coyote.http11.Http11AprProtocol] requires the
> >>> APR/native library which is not available at
> >>> org.apache.catalina.connector.Connector.initInternal(Connector.java:
> 972)
> >>>
> >>>
> >>>
> at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
> >>> ... 12 more
> >>>
> >>> May 19, 2015 3:07:10 PM org.apache.catalina.startup.Catalina
> >>> load INFO: Initialization processed in 1689 ms May 19, 2015
> >>> 3:07:10 PM org.apache.catalina.core.StandardService
> >>> startInternal INFO: Starting service Catalina May 19, 2015
> >>> 3:07:10 PM org.apache.catalina.core.StandardEngine
> >>> startInternal INFO: Starting Servlet Engine: Apache
> >>> Tomcat/7.0.52 (Ubuntu) May 19, 2015 3:07:10 PM
> >>> org.apache.catalina.startup.HostConfig deployDirectory INFO:
> >>> Deploying web application directory
> >>> /var/lib/tomcat7/webapps/ROOT May 19, 2015 3:07:14 PM
> >>> org.apache.coyote.AbstractProtocol start INFO: Starting
> >>> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:07:14 PM
> >>> org.apache.catalina.startup.Catalina start INFO: Server
> >>> startup in 3972 ms
> >>>
> >>> That is what I have done so far.
> >>>
> >>>> Date: Tue, 19 May 2015 09:20:21 -0400 From:
> >>>> chris@christopherschultz.net To: users@tomcat.apache.org
> >>>> Subject: Re: Problem with APR library - Tomcat 7
> >>>>
> > Dejan,
> >
> > On 5/18/15 4:15 PM, Dejan Stamenov wrote:
> >>>>>> I am sure I need the APR connector as I need to specify
> >>>>>> my server certificate, my private key and also a chain
> >>>>>> of other certificates that signed my server certificate.
> >>>>>> I haven't found any other connecter that can do this
> >>>>>> except APR, or I have missed something?
> >
> > You are mistaken. All of Tomcat's connectors provide TLS
> > capabilities.
> >
> > If you want to know what you are missing, please provide two
> > things:
> >
> > 1. Complete list of steps you went through to try to install
> > tcnative (including download, unzip, copy, including all file
> > paths used for everything including what CATALINA_HOME and
> > CATALINA_BASE values are).
> >
> > 2. The whole log file from a clean run (starting with no log file),
> >  with the text copied and pasted into a message. Nobody wants to
> > go to another web site and read text out of an image. Besides, it
> > means that the mailing list archives are worthless for this thread,
> > since nobody will be able to see that image after a few
> > days/months.
> >
> > Remember that this mailing list is part of the Tomcat community and
> >  not your own personal help desk. The answered provided to you are
> >  expected to benefit the entire community, not just you
> > specifically.
> >
> > -chris
> >
> >>>>>> -----Original Message----- From: Christopher Schultz
> >>>>>> [mailto:chris@christopherschultz.net] Sent: 18 May, 2015
> >>>>>> 22:11 To: Tomcat Users List Subject: Re: Problem with
> >>>>>> APR library - Tomcat 7
> >>>>>>
> >>>>>> Dejan,
> >>>>>>
> >>>>>> On 5/18/15 3:53 PM, Dejan Stamenov wrote:
> >>>>>>> The error below the warning message is saying that the
> >>>>>>> APR library is missing from my server.
> >>>>>>
> >>>>>> Okay.
> >>>>>>
> >>>>>>> That's why I am sure I need the APR library for Tomcat
> >>>>>>> 7.
> >>>>>>
> >>>>>> Well, you can use a different type of connector that
> >>>>>> *does not* require the APR connector. You *chose* to use
> >>>>>> the APR connector, and now you need both APR and tcnative
> >>>>>> to get that to work. I'm asking you about your initial
> >>>>>> decision: are you sure you need the APR-based connector?
> >>>>>>
> >>>>>>> I have seen Mark message, but had some work and didn't
> >>>>>>> tried it today. Till tomorrow, I will give you answer
> >>>>>>> if that was the case and worked, or I need further
> >>>>>>> help.
> >>>>>>
> >>>>>> Building the APR-based connector on Linux should be very
> >>>>>> easy. If you have the various packages installed via
> >>>>>> your package manager, then building tcnative is a
> >>>>>> typical two-step process to build: "configure", "make".
> >>>>>>
> >>>>>> -chris
> >>>>>>
> >>>>>>> -----Original Message----- From: Christopher Schultz
> >>>>>>> [mailto:chris@christopherschultz.net] Sent: 18 May,
> >>>>>>> 2015 21:46 To: Tomcat Users List Subject: Re: Problem
> >>>>>>> with APR library - Tomcat 7
> >>>>>>
> >>>>>>> Dejan,
> >>>>>>
> >>>>>>> On 5/17/15 3:22 PM, Dejan Stamenov wrote:
> >>>>>>>> I am working on a project where I need to install SSL
> >>>>>>>>  certificates on Tomcat 7 server for my Java
> >>>>>>>> application. I have been experimenting around, I
> >>>>>>>> have set up the connector in the server.xml file, but
> >>>>>>>> when I look into the logs I can see this:
> >>>>>>
> >>>>>>>> http://prntscr.com/76a98v
> >>>>>>
> >>>>>>> Warning-level message. Are you sure you need tcnative?
> >>>>>>
> >>>>>>> The error after the warning is more troubling. What's
> >>>>>>> the full stack trace for /that/?
> >>>>>>
> >>>>>>>> For the connector to be working, I needed to install
> >>>>>>>> APR library. I did so, following this guide here:
> >>>>>>>> http://www.techsww.com/tutorials/libraries/apr/installation/ins
> talli
> >
> >>>>>>>>
> >>>>>>>>
> n
> >>>>>>
> >>>>>>>>
> > g
> >>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>> _apach
> >>>>>>
> >>>>>>
> >>>>>>> e_portable_runtime_library_on_ubuntu_linux.php
> >>>>>>
> >>>>>>> It's much easier to do "apt-get install libapr" than
> >>>>>>> whatever it is you are doing, here.
> >>>>>>
> >>>>>>>> In my case, I use the apr-1.5.2 version. Also, in
> >>>>>>>> the configure -prefix part I have specified the URL
> >>>>>>>> that is shown on my server error log, i.e.
> >>>>>>>> /usr/lib/x86_64-linux-gnu. After server reboot, I
> >>>>>>>> still get the same error. Have been looking around
> >>>>>>>> the internet how to solve this, but only found a
> >>>>>>>> couple of open questions on Stack Overflow/Exchange
> >>>>>>>> with no answers in them.
> >>>>>>
> >>>>>>> As Mark says, tcnative is merely APR-based. You need
> >>>>>>> libapr, then you need to build tcnative yourself, from
> >>>>>>> source, from the links he provided .
> >>>>>>
> >>>>>>> I'll ask again: are you sure you need tcnative?
> >>>>>>
> >>>>>>> -chris
> >>>>>>
> >>>>>>> ----------------------------------------------------------------
> - -----
> >>>>>>
> >>>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>>
> >>>>>>>
> 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
> >>>>>>
> >>>>>>
> >>>>>> -----------------------------------------------------------------
> - ----
> >>>>>>
> >>>>>>
> >
> >>>>>>
> >>>>>>
> 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
> >>>>>>
> >>>>
> >>>> -------------------------------------------------------------------
> - --
> >>>>
> >>>>
> >>>>
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >>>> For additional commands, e-mail:
> >>>> users-help@tomcat.apache.org
> >>>>
> >>>
> >>>
> >
> >
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJVW0GWAAoJEBzwKT+lPKRYBZMQAI1Fqvw+WGnaFV2CfBo5MJJK
> L+igfH+Gns9rlFJS4Xim3/REprET+3VJdl9U0Hi4Dvt93pKkCUvuOf9BmA7G3yzv
> Z1bpxnUSJgDeUZJKux0d2EVBp9AAI2ONY4ZTbuY5jOT7YieSBA1L8mbTVD5BFPY3
> 9e2NO4CCmBu+hw5nuafL0vfM7dEcb8V+qcMakYGi/jymyV+8Q3LgFePvqn4NHOzk
> auRjct5jVQXsrLH68DrJi00PnhhYPCZwshfO6KqGqN4ZC6hkN2j8BZ9fKC1N/r03
> erwk+zyK0Jzp22IZBSA3fAggcjUJaAUkoE6PRWR16kxuzWdDH/NIF8+7KqD6bTra
> Sm177afioF/H4mIstdPC4sBLKnE5dShRwLAWNeODkVXXFBwxlBD5KDgsy8q0eXiW
> aaabMyyF4avYh82CDRyqq8FM8hLqDqLs9T8ipWrcH8CuAzP9s+eGHZDpwAXQDFs+
> 0sM5SpjIAU1cpmh+QaxXx7/V/9EHHqeJk+WFysnFS5eXjBOTkBq0dSjP2gzOJ/M/
> CP1cVN/uvBEIEJbcchtagaDMhiOAcxv/RlnTSeaQnwAt4XrnxhjfyvNAhkDoCOiS
> ZiIjs3BQCg7kb6scThEZfPulD0V7wWD/AQ1Ctdn56L60wVIUhRpxuk38KhT4XsnR
> 56NdeNRBgXY7h2HHsuya
> =3ZrJ
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Problem with APR library - Tomcat 7

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Dejan,

On 5/19/15 9:45 AM, Dejan Stamenov wrote:
> I have wrote in the message before, I have specified it at: 
> /usr/lib/x86_64-linux-gnu. In this folder, I can see libapr-1.so, 
> libapr-1.so.0.5.1. and libarputil-1.so.0.5.3 too.

How about libtcnative?

> About the Tomcat /bin folder, it doesn't exist on my Tomcat path: 
> /etc/tomcat7. Should I create it, including the file too?

That's not necessary.

> When I do a search for the setenv.sh file, I can't find it either.

Tomcat doesn't ship with a setenv.sh file. If you want to use one,
you'll have to create it yourself. If you are using a package-managed
version of Tomcat, those files could be anywhere. When using a
standard Tomcat package downloaded from apache.org (or a mirror), then
setenv.sh should be in CATALINA_BASE/bin/setenv.sh if you'd like to
create one.

Note that some methods for launching Tomcat ignore setenv.sh (like
using jsvc, for instance). Make sure you know what you are doing
before you do it.

- -chris

>> Date: Tue, 19 May 2015 18:38:23 +0500 Subject: Re: Problem with
>> APR library - Tomcat 7 From: sanaullah82@gmail.com To: 
>> users@tomcat.apache.org
>> 
>> so where did you specify your Apr lib path for tomcat?
>> 
>> you can set the Apr lib path in setenv.sh in tomcat bin folder
>> 
>> JAVA_OPTS="$JAVA_OPTS -Djavax.net.debug=all" 
>> CATALINA_OPTS="-Djava.library.path=/usr/lib/x86_64-linux-gnu/apr/lib"
>>
>>
>> 
you should verify the path and restart the tomcat again also may be you
>> need to compile the apr-utils as well
>> 
>> 
>> On Tue, May 19, 2015 at 6:31 PM, Dejan Stamenov 
>> <dejanstamenov93@outlook.com
>>> wrote:
>> 
>>> Hello Chris,
>>> 
>>> First, I have downloaded the APR library from here: 
>>> http://apache.sunsite.ualberta.ca/apr/apr-1.5.2.tar.gz  . 
>>> Following this tutorial: 
>>> http://www.techsww.com/tutorials/libraries/apr/installation/installi
ng_apache_portable_runtime_library_on_ubuntu_linux.php
>>>
>>>
>>> 
, I have installed this library into /usr/lib/x86_64-linux-gnu.
>>> After that, I have downloaded the tcnative library from the
>>> links Mark provided. Also, following the same links I run this
>>> config command: ./configure
>>> --with-apr=/usr/lib/x86_64-linux-gnu 
>>> --with-java-home=/usr/lib/jvm/java-7-openjdk-amd64 
>>> --with-ssl=yes --prefix=/usr/lib/x86_64-linux-gnu
>>> 
>>> That --prefix location is where the error log file is
>>> expecting for the library to be found. Here is the error log:
>>> 
>>> May 19, 2015 2:59:58 PM org.apache.catalina.startup.Catalina 
>>> load INFO: Initialization processed in 1973 ms May 19, 2015 
>>> 2:59:58 PM org.apache.catalina.core.StandardService 
>>> startInternal INFO: Starting service Catalina May 19, 2015 
>>> 2:59:58 PM org.apache.catalina.core.StandardEngine
>>> startInternal INFO: Starting Servlet Engine: Apache
>>> Tomcat/7.0.52 (Ubuntu) May 19, 2015 2:59:58 PM
>>> org.apache.catalina.startup.HostConfig deployDirectory INFO:
>>> Deploying web application directory 
>>> /var/lib/tomcat7/webapps/ROOT May 19, 2015 3:00:02 PM 
>>> org.apache.coyote.AbstractProtocol start INFO: Starting 
>>> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:00:02 PM 
>>> org.apache.catalina.startup.Catalina start INFO: Server
>>> startup in 4014 ms May 19, 2015 3:06:39 PM 
>>> org.apache.coyote.AbstractProtocol pause INFO: Pausing 
>>> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:06:39 PM 
>>> org.apache.coyote.AbstractProtocol pause INFO: Pausing 
>>> ProtocolHandler ["http-apr-8443"] May 19, 2015 3:06:39 PM 
>>> org.apache.catalina.core.StandardService stopInternal INFO: 
>>> Stopping service Catalina May 19, 2015 3:06:39 PM 
>>> org.apache.coyote.AbstractProtocol stop INFO: Stopping 
>>> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:06:39 PM 
>>> org.apache.coyote.AbstractProtocol destroy INFO: Destroying 
>>> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:06:39 PM 
>>> org.apache.coyote.AbstractProtocol stop INFO: Stopping 
>>> ProtocolHandler ["http-apr-8443"] May 19, 2015 3:06:39 PM 
>>> org.apache.coyote.AbstractProtocol destroy INFO: Destroying 
>>> ProtocolHandler ["http-apr-8443"] May 19, 2015 3:07:08 PM 
>>> org.apache.catalina.startup.ClassLoaderFactory validateFile 
>>> WARNING: Problem with directory 
>>> [/usr/share/tomcat7/common/classes], exists: [false], 
>>> isDirectory: [false], canRead: [false] May 19, 2015 3:07:08 PM 
>>> org.apache.catalina.startup.ClassLoaderFactory validateFile 
>>> WARNING: Problem with directory [/usr/share/tomcat7/common], 
>>> exists: [false], isDirectory: [false], canRead: [false] May
>>> 19, 2015 3:07:08 PM
>>> org.apache.catalina.startup.ClassLoaderFactory validateFile
>>> WARNING: Problem with directory 
>>> [/usr/share/tomcat7/server/classes], exists: [false], 
>>> isDirectory: [false], canRead: [false] May 19, 2015 3:07:08 PM 
>>> org.apache.catalina.startup.ClassLoaderFactory validateFile 
>>> WARNING: Problem with directory [/usr/share/tomcat7/server], 
>>> exists: [false], isDirectory: [false], canRead: [false] May
>>> 19, 2015 3:07:08 PM
>>> org.apache.catalina.startup.ClassLoaderFactory validateFile
>>> WARNING: Problem with directory 
>>> [/usr/share/tomcat7/shared/classes], exists: [false], 
>>> isDirectory: [false], canRead: [false] May 19, 2015 3:07:08 PM 
>>> org.apache.catalina.startup.ClassLoaderFactory validateFile 
>>> WARNING: Problem with directory [/usr/share/tomcat7/shared], 
>>> exists: [false], isDirectory: [false], canRead: [false] May
>>> 19, 2015 3:07:09 PM
>>> org.apache.catalina.core.AprLifecycleListener init INFO: The
>>> APR based Apache Tomcat Native library which allows optimal
>>> performance in production environments was not found on the
>>> java.library.path: 
>>> /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_
64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
>>>
>>>
>>> 
May 19, 2015 3:07:10 PM org.apache.coyote.AbstractProtocol init
>>> INFO: Initializing ProtocolHandler ["http-bio-8080"] May 19,
>>> 2015 3:07:10 PM org.apache.catalina.core.StandardService
>>> initInternal SEVERE: Failed to initialize connector 
>>> [Connector[HTTP/1.1-8443]] 
>>> org.apache.catalina.LifecycleException: Failed to initialize 
>>> component [Connector[HTTP/1.1-8443]] at 
>>> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
>>>
>>>
>>> 
at
>>> org.apache.catalina.core.StandardService.initInternal(StandardServic
e.java:559)
>>>
>>>
>>> 
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
>>> at 
>>> org.apache.catalina.core.StandardServer.initInternal(StandardServer.
java:813)
>>>
>>>
>>> 
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
>>> at org.apache.catalina.startup.Catalina.load(Catalina.java:638)
>>>  at
>>> org.apache.catalina.startup.Catalina.load(Catalina.java:663) at
>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
>>>  
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
.java:57)
>>>
>>>
>>> 
at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
ssorImpl.java:43)
>>>
>>>
>>> 
at java.lang.reflect.Method.invoke(Method.java:606)
>>> at 
>>> org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280)
>>> at 
>>> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)
>>>  Caused by: org.apache.catalina.LifecycleException: The
>>> configured protocol
>>> [org.apache.coyote.http11.Http11AprProtocol] requires the
>>> APR/native library which is not available at 
>>> org.apache.catalina.connector.Connector.initInternal(Connector.java:
972)
>>>
>>>
>>> 
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
>>> ... 12 more
>>> 
>>> May 19, 2015 3:07:10 PM org.apache.catalina.startup.Catalina 
>>> load INFO: Initialization processed in 1689 ms May 19, 2015 
>>> 3:07:10 PM org.apache.catalina.core.StandardService 
>>> startInternal INFO: Starting service Catalina May 19, 2015 
>>> 3:07:10 PM org.apache.catalina.core.StandardEngine
>>> startInternal INFO: Starting Servlet Engine: Apache
>>> Tomcat/7.0.52 (Ubuntu) May 19, 2015 3:07:10 PM
>>> org.apache.catalina.startup.HostConfig deployDirectory INFO:
>>> Deploying web application directory 
>>> /var/lib/tomcat7/webapps/ROOT May 19, 2015 3:07:14 PM 
>>> org.apache.coyote.AbstractProtocol start INFO: Starting 
>>> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:07:14 PM 
>>> org.apache.catalina.startup.Catalina start INFO: Server
>>> startup in 3972 ms
>>> 
>>> That is what I have done so far.
>>> 
>>>> Date: Tue, 19 May 2015 09:20:21 -0400 From: 
>>>> chris@christopherschultz.net To: users@tomcat.apache.org 
>>>> Subject: Re: Problem with APR library - Tomcat 7
>>>> 
> Dejan,
> 
> On 5/18/15 4:15 PM, Dejan Stamenov wrote:
>>>>>> I am sure I need the APR connector as I need to specify
>>>>>> my server certificate, my private key and also a chain
>>>>>> of other certificates that signed my server certificate.
>>>>>> I haven't found any other connecter that can do this
>>>>>> except APR, or I have missed something?
> 
> You are mistaken. All of Tomcat's connectors provide TLS 
> capabilities.
> 
> If you want to know what you are missing, please provide two
> things:
> 
> 1. Complete list of steps you went through to try to install 
> tcnative (including download, unzip, copy, including all file
> paths used for everything including what CATALINA_HOME and
> CATALINA_BASE values are).
> 
> 2. The whole log file from a clean run (starting with no log file),
>  with the text copied and pasted into a message. Nobody wants to
> go to another web site and read text out of an image. Besides, it
> means that the mailing list archives are worthless for this thread,
> since nobody will be able to see that image after a few
> days/months.
> 
> Remember that this mailing list is part of the Tomcat community and
>  not your own personal help desk. The answered provided to you are
>  expected to benefit the entire community, not just you
> specifically.
> 
> -chris
> 
>>>>>> -----Original Message----- From: Christopher Schultz 
>>>>>> [mailto:chris@christopherschultz.net] Sent: 18 May, 2015 
>>>>>> 22:11 To: Tomcat Users List Subject: Re: Problem with
>>>>>> APR library - Tomcat 7
>>>>>> 
>>>>>> Dejan,
>>>>>> 
>>>>>> On 5/18/15 3:53 PM, Dejan Stamenov wrote:
>>>>>>> The error below the warning message is saying that the 
>>>>>>> APR library is missing from my server.
>>>>>> 
>>>>>> Okay.
>>>>>> 
>>>>>>> That's why I am sure I need the APR library for Tomcat 
>>>>>>> 7.
>>>>>> 
>>>>>> Well, you can use a different type of connector that
>>>>>> *does not* require the APR connector. You *chose* to use
>>>>>> the APR connector, and now you need both APR and tcnative
>>>>>> to get that to work. I'm asking you about your initial
>>>>>> decision: are you sure you need the APR-based connector?
>>>>>> 
>>>>>>> I have seen Mark message, but had some work and didn't 
>>>>>>> tried it today. Till tomorrow, I will give you answer
>>>>>>> if that was the case and worked, or I need further
>>>>>>> help.
>>>>>> 
>>>>>> Building the APR-based connector on Linux should be very 
>>>>>> easy. If you have the various packages installed via
>>>>>> your package manager, then building tcnative is a
>>>>>> typical two-step process to build: "configure", "make".
>>>>>> 
>>>>>> -chris
>>>>>> 
>>>>>>> -----Original Message----- From: Christopher Schultz 
>>>>>>> [mailto:chris@christopherschultz.net] Sent: 18 May,
>>>>>>> 2015 21:46 To: Tomcat Users List Subject: Re: Problem
>>>>>>> with APR library - Tomcat 7
>>>>>> 
>>>>>>> Dejan,
>>>>>> 
>>>>>>> On 5/17/15 3:22 PM, Dejan Stamenov wrote:
>>>>>>>> I am working on a project where I need to install SSL
>>>>>>>>  certificates on Tomcat 7 server for my Java 
>>>>>>>> application. I have been experimenting around, I
>>>>>>>> have set up the connector in the server.xml file, but
>>>>>>>> when I look into the logs I can see this:
>>>>>> 
>>>>>>>> http://prntscr.com/76a98v
>>>>>> 
>>>>>>> Warning-level message. Are you sure you need tcnative?
>>>>>> 
>>>>>>> The error after the warning is more troubling. What's
>>>>>>> the full stack trace for /that/?
>>>>>> 
>>>>>>>> For the connector to be working, I needed to install 
>>>>>>>> APR library. I did so, following this guide here: 
>>>>>>>> http://www.techsww.com/tutorials/libraries/apr/installation/ins
talli
>
>>>>>>>>
>>>>>>>> 
n
>>>>>> 
>>>>>>>> 
> g
>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>> _apach
>>>>>> 
>>>>>> 
>>>>>>> e_portable_runtime_library_on_ubuntu_linux.php
>>>>>> 
>>>>>>> It's much easier to do "apt-get install libapr" than 
>>>>>>> whatever it is you are doing, here.
>>>>>> 
>>>>>>>> In my case, I use the apr-1.5.2 version. Also, in
>>>>>>>> the configure -prefix part I have specified the URL
>>>>>>>> that is shown on my server error log, i.e. 
>>>>>>>> /usr/lib/x86_64-linux-gnu. After server reboot, I
>>>>>>>> still get the same error. Have been looking around
>>>>>>>> the internet how to solve this, but only found a
>>>>>>>> couple of open questions on Stack Overflow/Exchange
>>>>>>>> with no answers in them.
>>>>>> 
>>>>>>> As Mark says, tcnative is merely APR-based. You need 
>>>>>>> libapr, then you need to build tcnative yourself, from 
>>>>>>> source, from the links he provided .
>>>>>> 
>>>>>>> I'll ask again: are you sure you need tcnative?
>>>>>> 
>>>>>>> -chris
>>>>>> 
>>>>>>> ----------------------------------------------------------------
- -----
>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> 
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
>>>>>> 
>>>>>> 
>>>>>> -----------------------------------------------------------------
- ----
>>>>>>
>>>>>>
>
>>>>>>
>>>>>> 
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
>>>>>> 
>>>> 
>>>> -------------------------------------------------------------------
- --
>>>>
>>>>
>>>> 
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail:
>>>> users-help@tomcat.apache.org
>>>> 
>>> 
>>> 
> 
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVW0GWAAoJEBzwKT+lPKRYBZMQAI1Fqvw+WGnaFV2CfBo5MJJK
L+igfH+Gns9rlFJS4Xim3/REprET+3VJdl9U0Hi4Dvt93pKkCUvuOf9BmA7G3yzv
Z1bpxnUSJgDeUZJKux0d2EVBp9AAI2ONY4ZTbuY5jOT7YieSBA1L8mbTVD5BFPY3
9e2NO4CCmBu+hw5nuafL0vfM7dEcb8V+qcMakYGi/jymyV+8Q3LgFePvqn4NHOzk
auRjct5jVQXsrLH68DrJi00PnhhYPCZwshfO6KqGqN4ZC6hkN2j8BZ9fKC1N/r03
erwk+zyK0Jzp22IZBSA3fAggcjUJaAUkoE6PRWR16kxuzWdDH/NIF8+7KqD6bTra
Sm177afioF/H4mIstdPC4sBLKnE5dShRwLAWNeODkVXXFBwxlBD5KDgsy8q0eXiW
aaabMyyF4avYh82CDRyqq8FM8hLqDqLs9T8ipWrcH8CuAzP9s+eGHZDpwAXQDFs+
0sM5SpjIAU1cpmh+QaxXx7/V/9EHHqeJk+WFysnFS5eXjBOTkBq0dSjP2gzOJ/M/
CP1cVN/uvBEIEJbcchtagaDMhiOAcxv/RlnTSeaQnwAt4XrnxhjfyvNAhkDoCOiS
ZiIjs3BQCg7kb6scThEZfPulD0V7wWD/AQ1Ctdn56L60wVIUhRpxuk38KhT4XsnR
56NdeNRBgXY7h2HHsuya
=3ZrJ
-----END PGP SIGNATURE-----

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


RE: Problem with APR library - Tomcat 7

Posted by Dejan Stamenov <de...@outlook.com>.
I have wrote in the message before, I have specified it at: /usr/lib/x86_64-linux-gnu. In this folder, I can see libapr-1.so, libapr-1.so.0.5.1. and libarputil-1.so.0.5.3 too.
About the Tomcat /bin folder, it doesn't exist on my Tomcat path: /etc/tomcat7. Should I create it, including the file too? When I do a search for the setenv.sh file, I can't find it either.

> Date: Tue, 19 May 2015 18:38:23 +0500
> Subject: Re: Problem with APR library - Tomcat 7
> From: sanaullah82@gmail.com
> To: users@tomcat.apache.org
> 
> so where did you specify your Apr lib path for tomcat?
> 
> you can set the Apr lib path in setenv.sh in tomcat bin folder
> 
> JAVA_OPTS="$JAVA_OPTS -Djavax.net.debug=all"
> CATALINA_OPTS="-Djava.library.path=/usr/lib/x86_64-linux-gnu/apr/lib"
> you should verify the path and restart the tomcat again also may be you
> need to compile the apr-utils as well
> 
> 
> On Tue, May 19, 2015 at 6:31 PM, Dejan Stamenov <dejanstamenov93@outlook.com
> > wrote:
> 
> > Hello Chris,
> >
> > First, I have downloaded the APR library from here:
> > http://apache.sunsite.ualberta.ca/apr/apr-1.5.2.tar.gz  . Following this
> > tutorial:
> > http://www.techsww.com/tutorials/libraries/apr/installation/installing_apache_portable_runtime_library_on_ubuntu_linux.php
> > , I have installed this library into /usr/lib/x86_64-linux-gnu.
> > After that, I have downloaded the tcnative library from the links Mark
> > provided. Also, following the same links I run this config command:
> > ./configure --with-apr=/usr/lib/x86_64-linux-gnu
> >             --with-java-home=/usr/lib/jvm/java-7-openjdk-amd64
> >             --with-ssl=yes
> >             --prefix=/usr/lib/x86_64-linux-gnu
> >
> > That --prefix location is where the error log file is expecting for the
> > library to be found.
> > Here is the error log:
> >
> > May 19, 2015 2:59:58 PM org.apache.catalina.startup.Catalina load
> > INFO: Initialization processed in 1973 ms
> > May 19, 2015 2:59:58 PM org.apache.catalina.core.StandardService
> > startInternal
> > INFO: Starting service Catalina
> > May 19, 2015 2:59:58 PM org.apache.catalina.core.StandardEngine
> > startInternal
> > INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
> > May 19, 2015 2:59:58 PM org.apache.catalina.startup.HostConfig
> > deployDirectory
> > INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
> > May 19, 2015 3:00:02 PM org.apache.coyote.AbstractProtocol start
> > INFO: Starting ProtocolHandler ["http-bio-8080"]
> > May 19, 2015 3:00:02 PM org.apache.catalina.startup.Catalina start
> > INFO: Server startup in 4014 ms
> > May 19, 2015 3:06:39 PM org.apache.coyote.AbstractProtocol pause
> > INFO: Pausing ProtocolHandler ["http-bio-8080"]
> > May 19, 2015 3:06:39 PM org.apache.coyote.AbstractProtocol pause
> > INFO: Pausing ProtocolHandler ["http-apr-8443"]
> > May 19, 2015 3:06:39 PM org.apache.catalina.core.StandardService
> > stopInternal
> > INFO: Stopping service Catalina
> > May 19, 2015 3:06:39 PM org.apache.coyote.AbstractProtocol stop
> > INFO: Stopping ProtocolHandler ["http-bio-8080"]
> > May 19, 2015 3:06:39 PM org.apache.coyote.AbstractProtocol destroy
> > INFO: Destroying ProtocolHandler ["http-bio-8080"]
> > May 19, 2015 3:06:39 PM org.apache.coyote.AbstractProtocol stop
> > INFO: Stopping ProtocolHandler ["http-apr-8443"]
> > May 19, 2015 3:06:39 PM org.apache.coyote.AbstractProtocol destroy
> > INFO: Destroying ProtocolHandler ["http-apr-8443"]
> > May 19, 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory
> > validateFile
> > WARNING: Problem with directory [/usr/share/tomcat7/common/classes],
> > exists: [false], isDirectory: [false], canRead: [false]
> > May 19, 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory
> > validateFile
> > WARNING: Problem with directory [/usr/share/tomcat7/common], exists:
> > [false], isDirectory: [false], canRead: [false]
> > May 19, 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory
> > validateFile
> > WARNING: Problem with directory [/usr/share/tomcat7/server/classes],
> > exists: [false], isDirectory: [false], canRead: [false]
> > May 19, 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory
> > validateFile
> > WARNING: Problem with directory [/usr/share/tomcat7/server], exists:
> > [false], isDirectory: [false], canRead: [false]
> > May 19, 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory
> > validateFile
> > WARNING: Problem with directory [/usr/share/tomcat7/shared/classes],
> > exists: [false], isDirectory: [false], canRead: [false]
> > May 19, 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory
> > validateFile
> > WARNING: Problem with directory [/usr/share/tomcat7/shared], exists:
> > [false], isDirectory: [false], canRead: [false]
> > May 19, 2015 3:07:09 PM org.apache.catalina.core.AprLifecycleListener init
> > INFO: The APR based Apache Tomcat Native library which allows optimal
> > performance in production environments was not found on the
> > java.library.path:
> > /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
> > May 19, 2015 3:07:10 PM org.apache.coyote.AbstractProtocol init
> > INFO: Initializing ProtocolHandler ["http-bio-8080"]
> > May 19, 2015 3:07:10 PM org.apache.catalina.core.StandardService
> > initInternal
> > SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8443]]
> > org.apache.catalina.LifecycleException: Failed to initialize component
> > [Connector[HTTP/1.1-8443]]
> >     at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
> >     at
> > org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
> >     at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
> >     at
> > org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:813)
> >     at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
> >     at org.apache.catalina.startup.Catalina.load(Catalina.java:638)
> >     at org.apache.catalina.startup.Catalina.load(Catalina.java:663)
> >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >     at
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> >     at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >     at java.lang.reflect.Method.invoke(Method.java:606)
> >     at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280)
> >     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)
> > Caused by: org.apache.catalina.LifecycleException: The configured protocol
> > [org.apache.coyote.http11.Http11AprProtocol] requires the APR/native
> > library which is not available
> >     at
> > org.apache.catalina.connector.Connector.initInternal(Connector.java:972)
> >     at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
> >     ... 12 more
> >
> > May 19, 2015 3:07:10 PM org.apache.catalina.startup.Catalina load
> > INFO: Initialization processed in 1689 ms
> > May 19, 2015 3:07:10 PM org.apache.catalina.core.StandardService
> > startInternal
> > INFO: Starting service Catalina
> > May 19, 2015 3:07:10 PM org.apache.catalina.core.StandardEngine
> > startInternal
> > INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
> > May 19, 2015 3:07:10 PM org.apache.catalina.startup.HostConfig
> > deployDirectory
> > INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
> > May 19, 2015 3:07:14 PM org.apache.coyote.AbstractProtocol start
> > INFO: Starting ProtocolHandler ["http-bio-8080"]
> > May 19, 2015 3:07:14 PM org.apache.catalina.startup.Catalina start
> > INFO: Server startup in 3972 ms
> >
> > That is what I have done so far.
> >
> > > Date: Tue, 19 May 2015 09:20:21 -0400
> > > From: chris@christopherschultz.net
> > > To: users@tomcat.apache.org
> > > Subject: Re: Problem with APR library - Tomcat 7
> > >
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA256
> > >
> > > Dejan,
> > >
> > > On 5/18/15 4:15 PM, Dejan Stamenov wrote:
> > > > I am sure I need the APR connector as I need to specify my server
> > > > certificate, my private key and also a chain of other certificates
> > > > that signed my server certificate. I haven't found any other
> > > > connecter that can do this except APR, or I have missed something?
> > >
> > > You are mistaken. All of Tomcat's connectors provide TLS capabilities.
> > >
> > > If you want to know what you are missing, please provide two things:
> > >
> > > 1. Complete list of steps you went through to try to install tcnative
> > > (including download, unzip, copy, including all file paths used for
> > > everything including what CATALINA_HOME and CATALINA_BASE values are).
> > >
> > > 2. The whole log file from a clean run (starting with no log file),
> > > with the text copied and pasted into a message. Nobody wants to go to
> > > another web site and read text out of an image. Besides, it means that
> > > the mailing list archives are worthless for this thread, since nobody
> > > will be able to see that image after a few days/months.
> > >
> > > Remember that this mailing list is part of the Tomcat community and
> > > not your own personal help desk. The answered provided to you are
> > > expected to benefit the entire community, not just you specifically.
> > >
> > > - -chris
> > >
> > > > -----Original Message----- From: Christopher Schultz
> > > > [mailto:chris@christopherschultz.net] Sent: 18 May, 2015 22:11 To:
> > > > Tomcat Users List Subject: Re: Problem with APR library - Tomcat 7
> > > >
> > > > Dejan,
> > > >
> > > > On 5/18/15 3:53 PM, Dejan Stamenov wrote:
> > > >> The error below the warning message is saying that the APR
> > > >> library is missing from my server.
> > > >
> > > > Okay.
> > > >
> > > >> That's why I am sure I need the APR library for Tomcat 7.
> > > >
> > > > Well, you can use a different type of connector that *does not*
> > > > require the APR connector. You *chose* to use the APR connector,
> > > > and now you need both APR and tcnative to get that to work. I'm
> > > > asking you about your initial decision: are you sure you need the
> > > > APR-based connector?
> > > >
> > > >> I have seen Mark message, but had some work and didn't tried it
> > > >> today. Till tomorrow, I will give you answer if that was the case
> > > >> and worked, or I need further help.
> > > >
> > > > Building the APR-based connector on Linux should be very easy. If
> > > > you have the various packages installed via your package manager,
> > > > then building tcnative is a typical two-step process to build:
> > > > "configure", "make".
> > > >
> > > > -chris
> > > >
> > > >> -----Original Message----- From: Christopher Schultz
> > > >> [mailto:chris@christopherschultz.net] Sent: 18 May, 2015 21:46
> > > >> To: Tomcat Users List Subject: Re: Problem with APR library -
> > > >> Tomcat 7
> > > >
> > > >> Dejan,
> > > >
> > > >> On 5/17/15 3:22 PM, Dejan Stamenov wrote:
> > > >>> I am working on a project where I need to install SSL
> > > >>> certificates on Tomcat 7 server for my Java application. I have
> > > >>> been experimenting around, I have set up the connector in the
> > > >>> server.xml file, but when I look into the logs I can see this:
> > > >
> > > >>> http://prntscr.com/76a98v
> > > >
> > > >> Warning-level message. Are you sure you need tcnative?
> > > >
> > > >> The error after the warning is more troubling. What's the full
> > > >> stack trace for /that/?
> > > >
> > > >>> For the connector to be working, I needed to install APR
> > > >>> library. I did so, following this guide here:
> > > >>> http://www.techsww.com/tutorials/libraries/apr/installation/installi
> > > n
> > > >
> > > >>>
> > > g
> > > >
> > > >>>
> > > >>>
> > > >>>
> > > > _apach
> > > >
> > > >
> > > >> e_portable_runtime_library_on_ubuntu_linux.php
> > > >
> > > >> It's much easier to do "apt-get install libapr" than whatever it
> > > >> is you are doing, here.
> > > >
> > > >>> In my case, I use the apr-1.5.2 version. Also, in the configure
> > > >>>  -prefix part I have specified the URL that is shown on my
> > > >>> server error log, i.e. /usr/lib/x86_64-linux-gnu. After server
> > > >>> reboot, I still get the same error. Have been looking around
> > > >>> the internet how to solve this, but only found a couple of open
> > > >>> questions on Stack Overflow/Exchange with no answers in them.
> > > >
> > > >> As Mark says, tcnative is merely APR-based. You need libapr, then
> > > >> you need to build tcnative yourself, from source, from the links
> > > >> he provided .
> > > >
> > > >> I'll ask again: are you sure you need tcnative?
> > > >
> > > >> -chris
> > > >
> > > >> ---------------------------------------------------------------------
> > > >
> > > >>
> > > >
> > > >
> > > >
> > > > 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
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > >
> > > >
> > > 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
> > > >
> > > -----BEGIN PGP SIGNATURE-----
> > > Version: GnuPG v2
> > > Comment: GPGTools - http://gpgtools.org
> > >
> > > iQIcBAEBCAAGBQJVWziVAAoJEBzwKT+lPKRYk2sQAIqy7jTdK3yDezHrAXYKrBKo
> > > mn69ZsSj1FfCuX6RKjHH1vEmCwKsD+QN0lnn3upEHIzqyoxOZURNncsi8kdVCmNK
> > > oBGz5UV6PlN5vZyqio3SlM1ryuurLOSg6jFj42pCh+m0kWOmT7+lmmddH0YEpSI5
> > > 5uneXQF9Tg6D426X7UMG1L5qnf43c8Gy/j0VPPowNhX5YYmQxdwTcd01FkYY39Tp
> > > UVSL9k/e8SmT9uTdY/9GsdIA/XfWa76LfM9OfiXPRO/tXY1J07Cc0iX0TefW8TLj
> > > JDIUVJ1PDEvGDas9fjizs+NquyiQH8RHopY4MsygFADW6rw6UcL/LuNDT5LVXCZ1
> > > dATbQpMhGlB89tmB/6q/PtnIdL4Vmd6oIl6qdXlopkivuSfsEmrz+aDydE7rK0sr
> > > n4Dq/MEy/QlzAElwQBLIl1jCh9durr2J5cKUf2f2H6bMnSjMseXNPtMSNxEeZYiI
> > > TVFxHA0lzOIr2pvUyufPsS56wjpfd2o11W8iPg3SeWslaIFRLsn0G27BeXRAnJex
> > > DBgutbthZCWltuPaaVnqXLnUA0WMAq50SNwmJ+9eb8fP8nvnOeMi6k+6WyyhR/D8
> > > q8kOYcFBl8oXnRgI1uWaFO/+vdzy+0YerbfOzlnYEiLlRF3dUh6An/yb8nttSrRl
> > > MXh+xXcpE10tnLnI157r
> > > =HRz8
> > > -----END PGP SIGNATURE-----
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > For additional commands, e-mail: users-help@tomcat.apache.org
> > >
> >
> >
 		 	   		  

Re: Problem with APR library - Tomcat 7

Posted by Sanaullah <sa...@gmail.com>.
so where did you specify your Apr lib path for tomcat?

you can set the Apr lib path in setenv.sh in tomcat bin folder

JAVA_OPTS="$JAVA_OPTS -Djavax.net.debug=all"
CATALINA_OPTS="-Djava.library.path=/usr/lib/x86_64-linux-gnu/apr/lib"
you should verify the path and restart the tomcat again also may be you
need to compile the apr-utils as well


On Tue, May 19, 2015 at 6:31 PM, Dejan Stamenov <dejanstamenov93@outlook.com
> wrote:

> Hello Chris,
>
> First, I have downloaded the APR library from here:
> http://apache.sunsite.ualberta.ca/apr/apr-1.5.2.tar.gz  . Following this
> tutorial:
> http://www.techsww.com/tutorials/libraries/apr/installation/installing_apache_portable_runtime_library_on_ubuntu_linux.php
> , I have installed this library into /usr/lib/x86_64-linux-gnu.
> After that, I have downloaded the tcnative library from the links Mark
> provided. Also, following the same links I run this config command:
> ./configure --with-apr=/usr/lib/x86_64-linux-gnu
>             --with-java-home=/usr/lib/jvm/java-7-openjdk-amd64
>             --with-ssl=yes
>             --prefix=/usr/lib/x86_64-linux-gnu
>
> That --prefix location is where the error log file is expecting for the
> library to be found.
> Here is the error log:
>
> May 19, 2015 2:59:58 PM org.apache.catalina.startup.Catalina load
> INFO: Initialization processed in 1973 ms
> May 19, 2015 2:59:58 PM org.apache.catalina.core.StandardService
> startInternal
> INFO: Starting service Catalina
> May 19, 2015 2:59:58 PM org.apache.catalina.core.StandardEngine
> startInternal
> INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
> May 19, 2015 2:59:58 PM org.apache.catalina.startup.HostConfig
> deployDirectory
> INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
> May 19, 2015 3:00:02 PM org.apache.coyote.AbstractProtocol start
> INFO: Starting ProtocolHandler ["http-bio-8080"]
> May 19, 2015 3:00:02 PM org.apache.catalina.startup.Catalina start
> INFO: Server startup in 4014 ms
> May 19, 2015 3:06:39 PM org.apache.coyote.AbstractProtocol pause
> INFO: Pausing ProtocolHandler ["http-bio-8080"]
> May 19, 2015 3:06:39 PM org.apache.coyote.AbstractProtocol pause
> INFO: Pausing ProtocolHandler ["http-apr-8443"]
> May 19, 2015 3:06:39 PM org.apache.catalina.core.StandardService
> stopInternal
> INFO: Stopping service Catalina
> May 19, 2015 3:06:39 PM org.apache.coyote.AbstractProtocol stop
> INFO: Stopping ProtocolHandler ["http-bio-8080"]
> May 19, 2015 3:06:39 PM org.apache.coyote.AbstractProtocol destroy
> INFO: Destroying ProtocolHandler ["http-bio-8080"]
> May 19, 2015 3:06:39 PM org.apache.coyote.AbstractProtocol stop
> INFO: Stopping ProtocolHandler ["http-apr-8443"]
> May 19, 2015 3:06:39 PM org.apache.coyote.AbstractProtocol destroy
> INFO: Destroying ProtocolHandler ["http-apr-8443"]
> May 19, 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory
> validateFile
> WARNING: Problem with directory [/usr/share/tomcat7/common/classes],
> exists: [false], isDirectory: [false], canRead: [false]
> May 19, 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory
> validateFile
> WARNING: Problem with directory [/usr/share/tomcat7/common], exists:
> [false], isDirectory: [false], canRead: [false]
> May 19, 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory
> validateFile
> WARNING: Problem with directory [/usr/share/tomcat7/server/classes],
> exists: [false], isDirectory: [false], canRead: [false]
> May 19, 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory
> validateFile
> WARNING: Problem with directory [/usr/share/tomcat7/server], exists:
> [false], isDirectory: [false], canRead: [false]
> May 19, 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory
> validateFile
> WARNING: Problem with directory [/usr/share/tomcat7/shared/classes],
> exists: [false], isDirectory: [false], canRead: [false]
> May 19, 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory
> validateFile
> WARNING: Problem with directory [/usr/share/tomcat7/shared], exists:
> [false], isDirectory: [false], canRead: [false]
> May 19, 2015 3:07:09 PM org.apache.catalina.core.AprLifecycleListener init
> INFO: The APR based Apache Tomcat Native library which allows optimal
> performance in production environments was not found on the
> java.library.path:
> /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
> May 19, 2015 3:07:10 PM org.apache.coyote.AbstractProtocol init
> INFO: Initializing ProtocolHandler ["http-bio-8080"]
> May 19, 2015 3:07:10 PM org.apache.catalina.core.StandardService
> initInternal
> SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8443]]
> org.apache.catalina.LifecycleException: Failed to initialize component
> [Connector[HTTP/1.1-8443]]
>     at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
>     at
> org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
>     at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
>     at
> org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:813)
>     at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
>     at org.apache.catalina.startup.Catalina.load(Catalina.java:638)
>     at org.apache.catalina.startup.Catalina.load(Catalina.java:663)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:606)
>     at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280)
>     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)
> Caused by: org.apache.catalina.LifecycleException: The configured protocol
> [org.apache.coyote.http11.Http11AprProtocol] requires the APR/native
> library which is not available
>     at
> org.apache.catalina.connector.Connector.initInternal(Connector.java:972)
>     at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
>     ... 12 more
>
> May 19, 2015 3:07:10 PM org.apache.catalina.startup.Catalina load
> INFO: Initialization processed in 1689 ms
> May 19, 2015 3:07:10 PM org.apache.catalina.core.StandardService
> startInternal
> INFO: Starting service Catalina
> May 19, 2015 3:07:10 PM org.apache.catalina.core.StandardEngine
> startInternal
> INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
> May 19, 2015 3:07:10 PM org.apache.catalina.startup.HostConfig
> deployDirectory
> INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
> May 19, 2015 3:07:14 PM org.apache.coyote.AbstractProtocol start
> INFO: Starting ProtocolHandler ["http-bio-8080"]
> May 19, 2015 3:07:14 PM org.apache.catalina.startup.Catalina start
> INFO: Server startup in 3972 ms
>
> That is what I have done so far.
>
> > Date: Tue, 19 May 2015 09:20:21 -0400
> > From: chris@christopherschultz.net
> > To: users@tomcat.apache.org
> > Subject: Re: Problem with APR library - Tomcat 7
> >
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA256
> >
> > Dejan,
> >
> > On 5/18/15 4:15 PM, Dejan Stamenov wrote:
> > > I am sure I need the APR connector as I need to specify my server
> > > certificate, my private key and also a chain of other certificates
> > > that signed my server certificate. I haven't found any other
> > > connecter that can do this except APR, or I have missed something?
> >
> > You are mistaken. All of Tomcat's connectors provide TLS capabilities.
> >
> > If you want to know what you are missing, please provide two things:
> >
> > 1. Complete list of steps you went through to try to install tcnative
> > (including download, unzip, copy, including all file paths used for
> > everything including what CATALINA_HOME and CATALINA_BASE values are).
> >
> > 2. The whole log file from a clean run (starting with no log file),
> > with the text copied and pasted into a message. Nobody wants to go to
> > another web site and read text out of an image. Besides, it means that
> > the mailing list archives are worthless for this thread, since nobody
> > will be able to see that image after a few days/months.
> >
> > Remember that this mailing list is part of the Tomcat community and
> > not your own personal help desk. The answered provided to you are
> > expected to benefit the entire community, not just you specifically.
> >
> > - -chris
> >
> > > -----Original Message----- From: Christopher Schultz
> > > [mailto:chris@christopherschultz.net] Sent: 18 May, 2015 22:11 To:
> > > Tomcat Users List Subject: Re: Problem with APR library - Tomcat 7
> > >
> > > Dejan,
> > >
> > > On 5/18/15 3:53 PM, Dejan Stamenov wrote:
> > >> The error below the warning message is saying that the APR
> > >> library is missing from my server.
> > >
> > > Okay.
> > >
> > >> That's why I am sure I need the APR library for Tomcat 7.
> > >
> > > Well, you can use a different type of connector that *does not*
> > > require the APR connector. You *chose* to use the APR connector,
> > > and now you need both APR and tcnative to get that to work. I'm
> > > asking you about your initial decision: are you sure you need the
> > > APR-based connector?
> > >
> > >> I have seen Mark message, but had some work and didn't tried it
> > >> today. Till tomorrow, I will give you answer if that was the case
> > >> and worked, or I need further help.
> > >
> > > Building the APR-based connector on Linux should be very easy. If
> > > you have the various packages installed via your package manager,
> > > then building tcnative is a typical two-step process to build:
> > > "configure", "make".
> > >
> > > -chris
> > >
> > >> -----Original Message----- From: Christopher Schultz
> > >> [mailto:chris@christopherschultz.net] Sent: 18 May, 2015 21:46
> > >> To: Tomcat Users List Subject: Re: Problem with APR library -
> > >> Tomcat 7
> > >
> > >> Dejan,
> > >
> > >> On 5/17/15 3:22 PM, Dejan Stamenov wrote:
> > >>> I am working on a project where I need to install SSL
> > >>> certificates on Tomcat 7 server for my Java application. I have
> > >>> been experimenting around, I have set up the connector in the
> > >>> server.xml file, but when I look into the logs I can see this:
> > >
> > >>> http://prntscr.com/76a98v
> > >
> > >> Warning-level message. Are you sure you need tcnative?
> > >
> > >> The error after the warning is more troubling. What's the full
> > >> stack trace for /that/?
> > >
> > >>> For the connector to be working, I needed to install APR
> > >>> library. I did so, following this guide here:
> > >>> http://www.techsww.com/tutorials/libraries/apr/installation/installi
> > n
> > >
> > >>>
> > g
> > >
> > >>>
> > >>>
> > >>>
> > > _apach
> > >
> > >
> > >> e_portable_runtime_library_on_ubuntu_linux.php
> > >
> > >> It's much easier to do "apt-get install libapr" than whatever it
> > >> is you are doing, here.
> > >
> > >>> In my case, I use the apr-1.5.2 version. Also, in the configure
> > >>>  -prefix part I have specified the URL that is shown on my
> > >>> server error log, i.e. /usr/lib/x86_64-linux-gnu. After server
> > >>> reboot, I still get the same error. Have been looking around
> > >>> the internet how to solve this, but only found a couple of open
> > >>> questions on Stack Overflow/Exchange with no answers in them.
> > >
> > >> As Mark says, tcnative is merely APR-based. You need libapr, then
> > >> you need to build tcnative yourself, from source, from the links
> > >> he provided .
> > >
> > >> I'll ask again: are you sure you need tcnative?
> > >
> > >> -chris
> > >
> > >> ---------------------------------------------------------------------
> > >
> > >>
> > >
> > >
> > >
> > > 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
> > >
> > >
> > > ---------------------------------------------------------------------
> > >
> > >
> > 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
> > >
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v2
> > Comment: GPGTools - http://gpgtools.org
> >
> > iQIcBAEBCAAGBQJVWziVAAoJEBzwKT+lPKRYk2sQAIqy7jTdK3yDezHrAXYKrBKo
> > mn69ZsSj1FfCuX6RKjHH1vEmCwKsD+QN0lnn3upEHIzqyoxOZURNncsi8kdVCmNK
> > oBGz5UV6PlN5vZyqio3SlM1ryuurLOSg6jFj42pCh+m0kWOmT7+lmmddH0YEpSI5
> > 5uneXQF9Tg6D426X7UMG1L5qnf43c8Gy/j0VPPowNhX5YYmQxdwTcd01FkYY39Tp
> > UVSL9k/e8SmT9uTdY/9GsdIA/XfWa76LfM9OfiXPRO/tXY1J07Cc0iX0TefW8TLj
> > JDIUVJ1PDEvGDas9fjizs+NquyiQH8RHopY4MsygFADW6rw6UcL/LuNDT5LVXCZ1
> > dATbQpMhGlB89tmB/6q/PtnIdL4Vmd6oIl6qdXlopkivuSfsEmrz+aDydE7rK0sr
> > n4Dq/MEy/QlzAElwQBLIl1jCh9durr2J5cKUf2f2H6bMnSjMseXNPtMSNxEeZYiI
> > TVFxHA0lzOIr2pvUyufPsS56wjpfd2o11W8iPg3SeWslaIFRLsn0G27BeXRAnJex
> > DBgutbthZCWltuPaaVnqXLnUA0WMAq50SNwmJ+9eb8fP8nvnOeMi6k+6WyyhR/D8
> > q8kOYcFBl8oXnRgI1uWaFO/+vdzy+0YerbfOzlnYEiLlRF3dUh6An/yb8nttSrRl
> > MXh+xXcpE10tnLnI157r
> > =HRz8
> > -----END PGP SIGNATURE-----
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
>
>

Re: Problem with APR library - Tomcat 7

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Dejan,

On 5/26/15 6:45 AM, Dejan Stamenov wrote:
> I just wanted to notify all that my problem with the APR library
> has been finally solved. If anyone encounters this problem, please
> follow the steps (assuming your Linux server already has APR
> library preinstalled):
> 
> 1. Install libapr1-dev, libssl-dev, java openjdk and openjre. 2.
> Download tcnative from here:
> https://tomcat.apache.org/download-native.cgi 3. Configure it like
> it is written here: http://tomcat.apache.org/native-doc/ 4. After
> server reboot, if you still encounter the issue: "APR library not
> found" and you have done everything above, mostly likely there is
> bug in the Linux server you are using. Check here:
> https://bugs.launchpad.net/ubuntu/+source/tomcat-native/+bug/1326255
> and move the required libraries like it is done on the link above.

The problem in the bug report there was with the libtcnative1 package
from Ubuntu, though the solution will work for a self-built tcnative
package as well.

I'd advise against putting libtcnative*.so into /usr/lib when it's
just as easy to set the system property java.library.path to point to
a custom location when you launch Tomcat. Note that I've said this in
multiple replies as this point.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVZG9XAAoJEBzwKT+lPKRYUPwP/R4lFPGR/eWeldm/9AHJiYtQ
FL14b+CTWIyfKaFzgOGhGkLJe9P564bmzz+OGhHbe03K0ovH7Q8jpFItZp13CDb3
WVYnyS4jWr+06nCWAQE31WWc20bNPBWiJ9MLxvbkWNvrHBaSHrk1vbMgQ0nFradJ
6P8+MEGttl2u3yQTqbA7xfFWQ6T/7hnOIdMFepccW4Q6dAChs7ofRm7RYlr7T9Z5
FDBdV5EUYrhSY41cKRtzwsVyG/xn9uDkD5SsJGtQeXRfyq0N5fpdlHG4WQAnVaQe
KbXFqlFcKGMUfmROk7ZEygB2sreJ7DuZV6QPHcFLnpbhBh29uPiiJb2Ri62Aqox6
QsLxxMy9EvOPySpf2ftv0LlXA7rb7YooUrYdQwpEBRUczMsfjqRdoqHpApjYpPWT
oXx3If3J+fSYOX/pq240LMhTNdvflx1iN4qb43CufQ1UJsMgqxw+OBr9+gPAeNqk
Dzpz+gF9dg0UZMErC5MozQk6gLI7cSGbko6FaVuVJZ195I7h57c+vUKWoFT32u4q
p6WZiFJsBMRAcAkx6DZb685MryfJCKssq0bsSt7SRi4acCsEW3a1KtBI+8NVC7yq
jsSWnswCNbbsIMskTL6U50IrR4ZCtQocjmyXKogLEvsQ5Pf/Ic8dPGi4wOIbipxI
3ACPjb8wCsc3tnVQ+meP
=vD0r
-----END PGP SIGNATURE-----

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


RE: Problem with APR library - Tomcat 7

Posted by Dejan Stamenov <de...@outlook.com>.
Hello Chris,

I just wanted to notify all that my problem with the APR library has been finally solved. If anyone encounters this problem, please follow the steps (assuming your Linux server already has APR library preinstalled):

1. Install libapr1-dev, libssl-dev, java openjdk and openjre.
2. Download tcnative from here: https://tomcat.apache.org/download-native.cgi
3. Configure it like it is written here: http://tomcat.apache.org/native-doc/
4. After server reboot, if you still encounter the issue: "APR library not found" and you have done everything above, mostly likely there is bug in the Linux server you are using.
Check here: https://bugs.launchpad.net/ubuntu/+source/tomcat-native/+bug/1326255 and move the required libraries like it is done on the link above.

Thank you all for helping me.
Regards


-----Original Message-----
From: Christopher Schultz [mailto:chris@christopherschultz.net] 
Sent: 19 May, 2015 21:16
To: Tomcat Users List
Subject: Re: Problem with APR library - Tomcat 7

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Dejan,

On 5/19/15 2:08 PM, Christopher Schultz wrote:
> Dejan,
> 
> On 5/19/15 11:58 AM, Dejan Stamenov wrote:
>> Maybe I have messed up really bad, so I can't solve it now. I will 
>> start over with this, can you tell me if this are the steps I need to 
>> do for it to work:
> 
>> install libapr1-devinstall tcnativeWill I need to make that specific 
>> .sh file in the Tomcat /bin directory after I have done these 2 
>> steps?
> 
> If it were me, I would:
> 
> 1. Remove all traces of the APR source and binary that you downloaded 
> and built for yourself. 2. Make sure that the packages
> libapr1 and libapr1-dev are installed via apt-get 3. Make sure you 
> build tcnative such that, after:
> 
> $ make distclean $ ./configure [...] $ make
> 
> ... you have some .so files sitting-around somewhere.
> 
> 4. Copy those files into CATALINA_BASE/bin
> 
> 5. When you launch, make sure that java.library.path includes 
> CATALINA_BASE/bin
> 
>> Also, can I use something else than APR library connector?
> 
> Yes. All Tomcat connectors support TLS.
> 
> The APR-based connector will outperform all other connectors when 
> using TLS by an order of magnitude. If you are serious about 
> performance, you should either use the APR-based connector or 
> terminate TLS elsewhere (like a reverse proxy) and not have Tomcat do 
> any crypto at all.
> 
>> I have been trying to make it work now with a keystore, but when I 
>> access my application I get "The connection was reset" error.
>> In my keystore, I have my server certificate, my intermediate file 
>> and primary cert file which have been given to me (the last 2). Also, 
>> when I look into the logs of the server there is no error/warning 
>> about using this second Connector, but it still won't work.
> 
> Taking PEM files and putting them into a keystore is a real pain in 
> the neck.
> 
> This is the magic formula I've been using for a while, when starting 
> with PEM files and creating a keystore from scratch:
> 
> $ openssl pkcs12 -export -in ${HOSTNAME}.crt \ -inkey ${HOSTNAME}.key 
> \ -certfile CA-intermediate.crt -out
> ${HOSTNAME}.p12 -chain
> 
> $ $JAVA_HOME/bin/keytool -importkeystore \ -srckeystore
> ${HOSTNAME}.p12 \ -destkeystore ${HOSTNAME}.jks \ -srcstoretype
> pkcs12
> 
> Hope that helps, -chris

FWIW, this is the portion of my Tomcat package testing script. This script is completely automated and fetches a release candidate, builds everything, and tests everything. You should be able to see how everything is built and where it all goes.

Some environment variables are not set, because this is only the snip of the script that deals with tcnative. Note that I don't show the launch of the JVM, so you don't see where java.library.dir is set. I have also not corrected for line wrapping/formatting.

I hope this helps,
- -chris

echo Building tcnative...
mkdir -p "${BASE_SOURCE_DIR}/output/build/bin/native"

tar xz --directory "${BASE_SOURCE_DIR}/output/build/bin/native" -f "${BASE_DIR}/ downloads/tomcat-native"*"/tomcat-native"*".tar.gz"

if [ "0" != "$?" ] ; then
  echo "* Failed to unpack tcnative. Quitting."
  exit
fi

OWD=`pwd`
cd "${BASE_SOURCE_DIR}/output/build/bin/native/tomcat-native-"*/jni/nati
ve

./configure --with-apr=/usr/bin --with-ssl=yes
- --with-java-home="${TEST_JAVA_HOME}"
# /usr/lib/jvm/java-6-sun/

result=$?

if [ "0" != "$result" ] ; then
  echo "* !! tcnative configure returned non-zero result ($result).
Quitting."
  exit
fi

cd "${OWD}"

make -C
"${BASE_SOURCE_DIR}/output/build/bin/native/tomcat-native-"*/jni/native

result=$?

if [ "0" != "$result" ] ; then
  echo "* !! tcnative make returned non-zero result ($result). Quitting.
"
  exit
else
  echo "* tcnative builds cleanly"
fi

cp -d
"${BASE_SOURCE_DIR}/output/build/bin/native/tomcat-native-"*/jni/native/
.libs/*
"${BASE_SOURCE_DIR}/output/build/bin/native"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVW4vSAAoJEBzwKT+lPKRYRwMQAIWp4DODO4kOyRGXUmpa2WZt
CZ230wXRf1Mgl7j620S5tlDPTLpLnc8GA2TmKydvuDwAmcof0UixIvSFJVr9l3d5
unRG3sP/trfBH0iSbzWue9Ep2CZYNx5l6wjfhKlSVT18OU3zPshIKIXl+BZIGvX/
p7YkXY1Jvb4xgg5jIbVZPSAq+dyQCJEGeS8FwiqnpsYDQooK/GEF+uqU/qiXw8BP
yqhVCV3ZJhtR8I/V5CJaCl0apzXI2MMGZ8f8zG2vTflpo7sH5GhwcpH69i8VeLwb
hdHypjdUW3C5TSPO59wzxCZA7DHLfKHxr2QPYxnkjwVf6zZ+JsCrAJ8jMrNt2sUD
BnAGxmK8v4Pnf6EzLOgycyIJT+sYETmHMk5t68d503zu9xAlToisMIDhlyb3WUoG
9IhNEweHAK3n8W7C21wWktZFBO5TPhlGrcClEBj4Kr/V9KV0xK/NfiLLL0dV6GqN
fDhU/KWZgQDx5hn3jajlWhfMrsAYCn9WPwbBSwMk4QVJlosIo0RIXM/nWHfZDtW1
LTV7UHyU6Me0xTaebokhAh97Si0Hd2d056RotZJb6RwEEaHe36C4En8ZuN4R6zAG
Fe7h9Gs1gglHeyejo4wvCWQxT0fQe9SlwuEMyZJjCG4IPhRxPHEuyp8UgNwGZfpx
oM7ZXPB5J3s2RQRDsjxU
=6Ym+
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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: Problem with APR library - Tomcat 7

Posted by Dejan Stamenov <de...@outlook.com>.
Thank you Chris for both the replies. By tomorrow I will reply what I have done. Need the night to look deeper into things and see where I am making mistakes and if I can solve my issue with your replies. :)

-----Original Message-----
From: Christopher Schultz [mailto:chris@christopherschultz.net] 
Sent: 19 May, 2015 21:16
To: Tomcat Users List
Subject: Re: Problem with APR library - Tomcat 7

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Dejan,

On 5/19/15 2:08 PM, Christopher Schultz wrote:
> Dejan,
> 
> On 5/19/15 11:58 AM, Dejan Stamenov wrote:
>> Maybe I have messed up really bad, so I can't solve it now. I will 
>> start over with this, can you tell me if this are the steps I need to 
>> do for it to work:
> 
>> install libapr1-devinstall tcnativeWill I need to make that specific 
>> .sh file in the Tomcat /bin directory after I have done these 2 
>> steps?
> 
> If it were me, I would:
> 
> 1. Remove all traces of the APR source and binary that you downloaded 
> and built for yourself. 2. Make sure that the packages
> libapr1 and libapr1-dev are installed via apt-get 3. Make sure you 
> build tcnative such that, after:
> 
> $ make distclean $ ./configure [...] $ make
> 
> ... you have some .so files sitting-around somewhere.
> 
> 4. Copy those files into CATALINA_BASE/bin
> 
> 5. When you launch, make sure that java.library.path includes 
> CATALINA_BASE/bin
> 
>> Also, can I use something else than APR library connector?
> 
> Yes. All Tomcat connectors support TLS.
> 
> The APR-based connector will outperform all other connectors when 
> using TLS by an order of magnitude. If you are serious about 
> performance, you should either use the APR-based connector or 
> terminate TLS elsewhere (like a reverse proxy) and not have Tomcat do 
> any crypto at all.
> 
>> I have been trying to make it work now with a keystore, but when I 
>> access my application I get "The connection was reset" error.
>> In my keystore, I have my server certificate, my intermediate file 
>> and primary cert file which have been given to me (the last 2). Also, 
>> when I look into the logs of the server there is no error/warning 
>> about using this second Connector, but it still won't work.
> 
> Taking PEM files and putting them into a keystore is a real pain in 
> the neck.
> 
> This is the magic formula I've been using for a while, when starting 
> with PEM files and creating a keystore from scratch:
> 
> $ openssl pkcs12 -export -in ${HOSTNAME}.crt \ -inkey ${HOSTNAME}.key 
> \ -certfile CA-intermediate.crt -out
> ${HOSTNAME}.p12 -chain
> 
> $ $JAVA_HOME/bin/keytool -importkeystore \ -srckeystore
> ${HOSTNAME}.p12 \ -destkeystore ${HOSTNAME}.jks \ -srcstoretype
> pkcs12
> 
> Hope that helps, -chris

FWIW, this is the portion of my Tomcat package testing script. This script is completely automated and fetches a release candidate, builds everything, and tests everything. You should be able to see how everything is built and where it all goes.

Some environment variables are not set, because this is only the snip of the script that deals with tcnative. Note that I don't show the launch of the JVM, so you don't see where java.library.dir is set. I have also not corrected for line wrapping/formatting.

I hope this helps,
- -chris

echo Building tcnative...
mkdir -p "${BASE_SOURCE_DIR}/output/build/bin/native"

tar xz --directory "${BASE_SOURCE_DIR}/output/build/bin/native" -f "${BASE_DIR}/ downloads/tomcat-native"*"/tomcat-native"*".tar.gz"

if [ "0" != "$?" ] ; then
  echo "* Failed to unpack tcnative. Quitting."
  exit
fi

OWD=`pwd`
cd "${BASE_SOURCE_DIR}/output/build/bin/native/tomcat-native-"*/jni/nati
ve

./configure --with-apr=/usr/bin --with-ssl=yes
- --with-java-home="${TEST_JAVA_HOME}"
# /usr/lib/jvm/java-6-sun/

result=$?

if [ "0" != "$result" ] ; then
  echo "* !! tcnative configure returned non-zero result ($result).
Quitting."
  exit
fi

cd "${OWD}"

make -C
"${BASE_SOURCE_DIR}/output/build/bin/native/tomcat-native-"*/jni/native

result=$?

if [ "0" != "$result" ] ; then
  echo "* !! tcnative make returned non-zero result ($result). Quitting.
"
  exit
else
  echo "* tcnative builds cleanly"
fi

cp -d
"${BASE_SOURCE_DIR}/output/build/bin/native/tomcat-native-"*/jni/native/
.libs/*
"${BASE_SOURCE_DIR}/output/build/bin/native"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVW4vSAAoJEBzwKT+lPKRYRwMQAIWp4DODO4kOyRGXUmpa2WZt
CZ230wXRf1Mgl7j620S5tlDPTLpLnc8GA2TmKydvuDwAmcof0UixIvSFJVr9l3d5
unRG3sP/trfBH0iSbzWue9Ep2CZYNx5l6wjfhKlSVT18OU3zPshIKIXl+BZIGvX/
p7YkXY1Jvb4xgg5jIbVZPSAq+dyQCJEGeS8FwiqnpsYDQooK/GEF+uqU/qiXw8BP
yqhVCV3ZJhtR8I/V5CJaCl0apzXI2MMGZ8f8zG2vTflpo7sH5GhwcpH69i8VeLwb
hdHypjdUW3C5TSPO59wzxCZA7DHLfKHxr2QPYxnkjwVf6zZ+JsCrAJ8jMrNt2sUD
BnAGxmK8v4Pnf6EzLOgycyIJT+sYETmHMk5t68d503zu9xAlToisMIDhlyb3WUoG
9IhNEweHAK3n8W7C21wWktZFBO5TPhlGrcClEBj4Kr/V9KV0xK/NfiLLL0dV6GqN
fDhU/KWZgQDx5hn3jajlWhfMrsAYCn9WPwbBSwMk4QVJlosIo0RIXM/nWHfZDtW1
LTV7UHyU6Me0xTaebokhAh97Si0Hd2d056RotZJb6RwEEaHe36C4En8ZuN4R6zAG
Fe7h9Gs1gglHeyejo4wvCWQxT0fQe9SlwuEMyZJjCG4IPhRxPHEuyp8UgNwGZfpx
oM7ZXPB5J3s2RQRDsjxU
=6Ym+
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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: Problem with APR library - Tomcat 7

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Dejan,

On 5/19/15 2:08 PM, Christopher Schultz wrote:
> Dejan,
> 
> On 5/19/15 11:58 AM, Dejan Stamenov wrote:
>> Maybe I have messed up really bad, so I can't solve it now. I
>> will start over with this, can you tell me if this are the steps
>> I need to do for it to work:
> 
>> install libapr1-devinstall tcnativeWill I need to make that 
>> specific .sh file in the Tomcat /bin directory after I have done 
>> these 2 steps?
> 
> If it were me, I would:
> 
> 1. Remove all traces of the APR source and binary that you
> downloaded and built for yourself. 2. Make sure that the packages
> libapr1 and libapr1-dev are installed via apt-get 3. Make sure you
> build tcnative such that, after:
> 
> $ make distclean $ ./configure [...] $ make
> 
> ... you have some .so files sitting-around somewhere.
> 
> 4. Copy those files into CATALINA_BASE/bin
> 
> 5. When you launch, make sure that java.library.path includes 
> CATALINA_BASE/bin
> 
>> Also, can I use something else than APR library connector?
> 
> Yes. All Tomcat connectors support TLS.
> 
> The APR-based connector will outperform all other connectors when 
> using TLS by an order of magnitude. If you are serious about 
> performance, you should either use the APR-based connector or 
> terminate TLS elsewhere (like a reverse proxy) and not have Tomcat
> do any crypto at all.
> 
>> I have been trying to make it work now with a keystore, but when
>> I access my application I get "The connection was reset" error.
>> In my keystore, I have my server certificate, my intermediate
>> file and primary cert file which have been given to me (the last
>> 2). Also, when I look into the logs of the server there is no
>> error/warning about using this second Connector, but it still
>> won't work.
> 
> Taking PEM files and putting them into a keystore is a real pain
> in the neck.
> 
> This is the magic formula I've been using for a while, when
> starting with PEM files and creating a keystore from scratch:
> 
> $ openssl pkcs12 -export -in ${HOSTNAME}.crt \ -inkey
> ${HOSTNAME}.key \ -certfile CA-intermediate.crt -out
> ${HOSTNAME}.p12 -chain
> 
> $ $JAVA_HOME/bin/keytool -importkeystore \ -srckeystore
> ${HOSTNAME}.p12 \ -destkeystore ${HOSTNAME}.jks \ -srcstoretype
> pkcs12
> 
> Hope that helps, -chris

FWIW, this is the portion of my Tomcat package testing script. This
script is completely automated and fetches a release candidate, builds
everything, and tests everything. You should be able to see how
everything is built and where it all goes.

Some environment variables are not set, because this is only the snip
of the script that deals with tcnative. Note that I don't show the
launch of the JVM, so you don't see where java.library.dir is set. I
have also not corrected for line wrapping/formatting.

I hope this helps,
- -chris

echo Building tcnative...
mkdir -p "${BASE_SOURCE_DIR}/output/build/bin/native"

tar xz --directory "${BASE_SOURCE_DIR}/output/build/bin/native" -f
"${BASE_DIR}/
downloads/tomcat-native"*"/tomcat-native"*".tar.gz"

if [ "0" != "$?" ] ; then
  echo "* Failed to unpack tcnative. Quitting."
  exit
fi

OWD=`pwd`
cd "${BASE_SOURCE_DIR}/output/build/bin/native/tomcat-native-"*/jni/nati
ve

./configure --with-apr=/usr/bin --with-ssl=yes
- --with-java-home="${TEST_JAVA_HOME}"
# /usr/lib/jvm/java-6-sun/

result=$?

if [ "0" != "$result" ] ; then
  echo "* !! tcnative configure returned non-zero result ($result).
Quitting."
  exit
fi

cd "${OWD}"

make -C
"${BASE_SOURCE_DIR}/output/build/bin/native/tomcat-native-"*/jni/native

result=$?

if [ "0" != "$result" ] ; then
  echo "* !! tcnative make returned non-zero result ($result). Quitting.
"
  exit
else
  echo "* tcnative builds cleanly"
fi

cp -d
"${BASE_SOURCE_DIR}/output/build/bin/native/tomcat-native-"*/jni/native/
.libs/*
"${BASE_SOURCE_DIR}/output/build/bin/native"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVW4vSAAoJEBzwKT+lPKRYRwMQAIWp4DODO4kOyRGXUmpa2WZt
CZ230wXRf1Mgl7j620S5tlDPTLpLnc8GA2TmKydvuDwAmcof0UixIvSFJVr9l3d5
unRG3sP/trfBH0iSbzWue9Ep2CZYNx5l6wjfhKlSVT18OU3zPshIKIXl+BZIGvX/
p7YkXY1Jvb4xgg5jIbVZPSAq+dyQCJEGeS8FwiqnpsYDQooK/GEF+uqU/qiXw8BP
yqhVCV3ZJhtR8I/V5CJaCl0apzXI2MMGZ8f8zG2vTflpo7sH5GhwcpH69i8VeLwb
hdHypjdUW3C5TSPO59wzxCZA7DHLfKHxr2QPYxnkjwVf6zZ+JsCrAJ8jMrNt2sUD
BnAGxmK8v4Pnf6EzLOgycyIJT+sYETmHMk5t68d503zu9xAlToisMIDhlyb3WUoG
9IhNEweHAK3n8W7C21wWktZFBO5TPhlGrcClEBj4Kr/V9KV0xK/NfiLLL0dV6GqN
fDhU/KWZgQDx5hn3jajlWhfMrsAYCn9WPwbBSwMk4QVJlosIo0RIXM/nWHfZDtW1
LTV7UHyU6Me0xTaebokhAh97Si0Hd2d056RotZJb6RwEEaHe36C4En8ZuN4R6zAG
Fe7h9Gs1gglHeyejo4wvCWQxT0fQe9SlwuEMyZJjCG4IPhRxPHEuyp8UgNwGZfpx
oM7ZXPB5J3s2RQRDsjxU
=6Ym+
-----END PGP SIGNATURE-----

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


RE: Problem with APR library - Tomcat 7

Posted by Dejan Stamenov <de...@outlook.com>.
Chris,

I have tried the commands you wrote me for creating a keystore. When I access my application on ssl port, I get "The connection was reset" error.

I have used this command:
openssl pkcs12 -export -in server.pem -inkey
server.key -certfile serverchain.pem -out
server.p12

In serverchain.pem I have concatenation of my own CA certificate that signed this server.pem certificate for my server, and other 2 CA certificates that were given to me. (basically, one faculty CA, my subject project CA, and my own CA is actually my group CA certificate, by which I have signed my server.pem)
After that I have used this command:
keytool -importkeystore -srckeystore
server.p12 -destkeystore serverkeystore.jks -srcstoretype pkcs12

Specified the new key store in the connector with its password, reboot, and "The connection was reset" error appears again.

If in the first command I add the  -chain in the end as you wrote me on your reply, I get this error: "Error unable to get local issuer certificate getting chain."
Why is this happening?

> Date: Tue, 19 May 2015 15:01:06 -0400
> From: chris@christopherschultz.net
> To: users@tomcat.apache.org
> Subject: Re: Problem with APR library - Tomcat 7
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> Dejan,
> 
> On 5/19/15 2:17 PM, Dejan Stamenov wrote:
> > Can you please explain me these two lines you have wrote:
> > 
> > $ openssl pkcs12 -export -in ${HOSTNAME}.crt \ -inkey
> > ${HOSTNAME}.key \ -certfile CA-intermediate.crt -out
> > ${HOSTNAME}.p12 -chain
> 
> Packages your server's certificate, key, and the CA's intermediate
> certificate into a single PKCS#12 keystore. OpenSSL can't write Java
> keystores, and Java's keytool cant read PEM files. So, we use a
> PKCS#12 keystore as an intermediary, which both tools can read.
> 
> > $ $JAVA_HOME/bin/keytool -importkeystore \ -srckeystore
> > ${HOSTNAME}.p12 \ -destkeystore ${HOSTNAME}.jks \ -srcstoretype
> > pkcs12
> 
> Converts a PKCS#12 keystore into a Java keystore.
> 
> > Basically, what I have is 3 .pem files. One is the certificate for
> > my server, and the other two are the intermediate CA certificate
> > and root CA.
> 
> You shouldn't need the CA's root certificate since most browsers ship
> with those root certs as anchors. If you need to add the CA's root to
> your keystore, you can always add it like this:
> 
> $ keytool -import -alias [Authority.CA] \
>            -trustcacerts \
>                    -file [authority's CA cert] \
>                -keystore ${HOSTNAME}.jks
> 
> > So, I should run the pkcs12 for each of these 3 certificates?
> 
> No, it does everything at once. Make sure you keep your PEM files in a
> safe place as a back-up.
> 
> > And if you can explain me in a word or two what is being created
> > with them, it would be much appreciated as I am first time working
> > with this.
> 
> See above. If you want security done right, get someone who knows
> about X.509 certificates, etc. or do some reading to get yourself more
> familiar with these concepts. There really is no cookbook to just "do
> SSL" because it's complicated and, if you don't do it properly,
> increasingly risky lately.
> 
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
> Comment: GPGTools - http://gpgtools.org
> 
> iQIcBAEBCAAGBQJVW4hyAAoJEBzwKT+lPKRYdVsP/2KG0pobgtXBEDS6WBK6OMV1
> Sss/Xy2Ed3KCrtHceXL59FWoQBWysFRX/mVOPXnv4zAY7aurXOjI5oyHCRNZsOa/
> 4PmqKy/HU4MaxCPBJczD0DfYi5HmuFdRTT9NHdXzM3/gPei29vyx7OE0Lr1/DYHT
> 5spnvkh9WwA30sfGBb07/zEA79OM17eVge/Ki/Bfd0WRBODd2iIfM9GfKxR9vpM4
> vLE2P3zhGdCQT1aWxDIveZ+IL2QOdt7VwS2KWjc04snxjMh374EXvOtw7PWsD6Yg
> nlJxhrprRPhTiPDDuhOW4guV/o2jdLxYMBw/DX0gluCZ9qQLrUKC83cfdnE2+tuC
> PMaDBRT0UGzQx5Ok5iv1vNEBgAiwrWfK2MGrFAiiAJWGEjnANYc2GOQEdv7549gD
> 9nw6lgYbOOBztU326Hf6qeC/XDOBb/hDfc3E1xXkoXroWlUSteP3nmgkCDaoZY7B
> O005BAkQzZuhd7EFk3cWLBowSVt53O6xju5pOf6mdI8hPsIgWYB0ZxejS0cp0VvK
> +9pv5mkwUnmqQp5znkoBevBWRolzdOsHECXGotri2q3CoX1j+oCFmH+Nj+cpbRAF
> ob3/UuAMUfGXkb3TzILN2jnqX+JPmAXq5h7bEZTIu9PIy0x6BeGn1zkWiBSbfZcZ
> lg3He5P+ADNKCVHiMVBj
> =zaTm
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
 		 	   		  

Re: Problem with APR library - Tomcat 7

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Dejan,

On 5/19/15 2:17 PM, Dejan Stamenov wrote:
> Can you please explain me these two lines you have wrote:
> 
> $ openssl pkcs12 -export -in ${HOSTNAME}.crt \ -inkey
> ${HOSTNAME}.key \ -certfile CA-intermediate.crt -out
> ${HOSTNAME}.p12 -chain

Packages your server's certificate, key, and the CA's intermediate
certificate into a single PKCS#12 keystore. OpenSSL can't write Java
keystores, and Java's keytool cant read PEM files. So, we use a
PKCS#12 keystore as an intermediary, which both tools can read.

> $ $JAVA_HOME/bin/keytool -importkeystore \ -srckeystore
> ${HOSTNAME}.p12 \ -destkeystore ${HOSTNAME}.jks \ -srcstoretype
> pkcs12

Converts a PKCS#12 keystore into a Java keystore.

> Basically, what I have is 3 .pem files. One is the certificate for
> my server, and the other two are the intermediate CA certificate
> and root CA.

You shouldn't need the CA's root certificate since most browsers ship
with those root certs as anchors. If you need to add the CA's root to
your keystore, you can always add it like this:

$ keytool -import -alias [Authority.CA] \
           -trustcacerts \
                   -file [authority's CA cert] \
               -keystore ${HOSTNAME}.jks

> So, I should run the pkcs12 for each of these 3 certificates?

No, it does everything at once. Make sure you keep your PEM files in a
safe place as a back-up.

> And if you can explain me in a word or two what is being created
> with them, it would be much appreciated as I am first time working
> with this.

See above. If you want security done right, get someone who knows
about X.509 certificates, etc. or do some reading to get yourself more
familiar with these concepts. There really is no cookbook to just "do
SSL" because it's complicated and, if you don't do it properly,
increasingly risky lately.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVW4hyAAoJEBzwKT+lPKRYdVsP/2KG0pobgtXBEDS6WBK6OMV1
Sss/Xy2Ed3KCrtHceXL59FWoQBWysFRX/mVOPXnv4zAY7aurXOjI5oyHCRNZsOa/
4PmqKy/HU4MaxCPBJczD0DfYi5HmuFdRTT9NHdXzM3/gPei29vyx7OE0Lr1/DYHT
5spnvkh9WwA30sfGBb07/zEA79OM17eVge/Ki/Bfd0WRBODd2iIfM9GfKxR9vpM4
vLE2P3zhGdCQT1aWxDIveZ+IL2QOdt7VwS2KWjc04snxjMh374EXvOtw7PWsD6Yg
nlJxhrprRPhTiPDDuhOW4guV/o2jdLxYMBw/DX0gluCZ9qQLrUKC83cfdnE2+tuC
PMaDBRT0UGzQx5Ok5iv1vNEBgAiwrWfK2MGrFAiiAJWGEjnANYc2GOQEdv7549gD
9nw6lgYbOOBztU326Hf6qeC/XDOBb/hDfc3E1xXkoXroWlUSteP3nmgkCDaoZY7B
O005BAkQzZuhd7EFk3cWLBowSVt53O6xju5pOf6mdI8hPsIgWYB0ZxejS0cp0VvK
+9pv5mkwUnmqQp5znkoBevBWRolzdOsHECXGotri2q3CoX1j+oCFmH+Nj+cpbRAF
ob3/UuAMUfGXkb3TzILN2jnqX+JPmAXq5h7bEZTIu9PIy0x6BeGn1zkWiBSbfZcZ
lg3He5P+ADNKCVHiMVBj
=zaTm
-----END PGP SIGNATURE-----

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


RE: Problem with APR library - Tomcat 7

Posted by Dejan Stamenov <de...@outlook.com>.
Hey Chris,

Can you please explain me these two lines you have wrote:

$ openssl pkcs12 -export -in ${HOSTNAME}.crt \
                       -inkey ${HOSTNAME}.key \
                    -certfile CA-intermediate.crt
                         -out ${HOSTNAME}.p12
                       -chain

 $ $JAVA_HOME/bin/keytool -importkeystore \
                             -srckeystore ${HOSTNAME}.p12 \
                            -destkeystore ${HOSTNAME}.jks \
                            -srcstoretype pkcs12

Basically, what I have is 3 .pem files. One is the certificate for my server, and the other two are the intermediate CA certificate and root CA. 

So, I should run the pkcs12 for each of these 3 certificates? And if you can explain me in a word or two what is being created with them, it would be much appreciated as I am first time working with this.

-----Original Message-----
From: Christopher Schultz [mailto:chris@christopherschultz.net] 
Sent: 19 May, 2015 20:08
To: Tomcat Users List
Subject: Re: Problem with APR library - Tomcat 7

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Dejan,

On 5/19/15 11:58 AM, Dejan Stamenov wrote:
> Maybe I have messed up really bad, so I can't solve it now. I will 
> start over with this, can you tell me if this are the steps I need to 
> do for it to work:
> 
> install libapr1-devinstall tcnativeWill I need to make that specific 
> .sh file in the Tomcat /bin directory after I have done these 2 steps?

If it were me, I would:

1. Remove all traces of the APR source and binary that you downloaded and built for yourself.
2. Make sure that the packages libapr1 and libapr1-dev are installed via apt-get 3. Make sure you build tcnative such that, after:

  $ make distclean
  $ ./configure [...]
  $ make

... you have some .so files sitting-around somewhere.

4. Copy those files into CATALINA_BASE/bin

5. When you launch, make sure that java.library.path includes CATALINA_BASE/bin

> Also, can I use something else than APR library connector?

Yes. All Tomcat connectors support TLS.

The APR-based connector will outperform all other connectors when using TLS by an order of magnitude. If you are serious about performance, you should either use the APR-based connector or terminate TLS elsewhere (like a reverse proxy) and not have Tomcat do any crypto at all.

> I have been trying to make it work now with a keystore, but when I 
> access my application I get "The connection was reset" error. In my 
> keystore, I have my server certificate, my intermediate file and 
> primary cert file which have been given to me (the last 2). Also, when 
> I look into the logs of the server there is no error/warning about 
> using this second Connector, but it still won't work.

Taking PEM files and putting them into a keystore is a real pain in the neck.

This is the magic formula I've been using for a while, when starting with PEM files and creating a keystore from scratch:

 $ openssl pkcs12 -export -in ${HOSTNAME}.crt \
                       -inkey ${HOSTNAME}.key \
                    -certfile CA-intermediate.crt
                         -out ${HOSTNAME}.p12
                       -chain

 $ $JAVA_HOME/bin/keytool -importkeystore \
                             -srckeystore ${HOSTNAME}.p12 \
                            -destkeystore ${HOSTNAME}.jks \
                            -srcstoretype pkcs12

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVW3wLAAoJEBzwKT+lPKRYhe0QAJToV385JEvVjnAujgghILzS
3/xLyrOQqbUXo6HVT9+yKtbgtmMqQj7UQ7JQjsDWl0JTrV8e0Y9nJnS91vMZMw8F
aTgf+LqAowH7lehqb0gQRVjmsS1ZSMr51epbAiytx3eZPeOJTc+sxzVyAixrfEDd
UxkEe6dYBI2JA7UnnzbO1OKvpkqYWBksUAKyF0w1X4Lp1AlUeKI+BPEheuWn8RaM
9ppwJxpjTS17GA+hLuPpqH1g4WhxOlzmXewTED1tCrLQ7l3s32/yWaj0jbcfyX+K
++1zzL2/dVdYo0iWA2vRN4udzmgZy7uNVS2i6rtzk9m2udkmWS2dOrJJjwzwu6Yn
QqwbR1/3gP6CUrvE6+8a8zFIyBhju5jVtEeQJeZAZ0KIx//EZvtdFcZPIlzTgap5
y3Wyl3NozpmIrbhjBMZ6EndaW9lUqZHq8kN6IlAH9qGB6zV1snJDw1jn6oEVZWNJ
ADUs8rFIncmrD45AlIESd6Tv8ZjHbFbWUSsrGtotRPkH/Uvm5pU8bMvI106/5IbN
t9bnjSykqpc9Lhpy7JXUlJEgqT54xP8qRXubnppIvSmMtKS5C0F9g787oceF3igS
gZmPDmLXlJcMEHvesPgLu/qWDICoIWiC6qmpPoxYbwN/qtBfyutY+CC32fLhTljw
t1zijZjngG1uamToQ3uN
=pY5F
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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: Problem with APR library - Tomcat 7

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Dejan,

On 5/19/15 11:58 AM, Dejan Stamenov wrote:
> Maybe I have messed up really bad, so I can't solve it now. I will 
> start over with this, can you tell me if this are the steps I need
> to do for it to work:
> 
> install libapr1-devinstall tcnativeWill I need to make that
> specific .sh file in the Tomcat /bin directory after I have done
> these 2 steps?

If it were me, I would:

1. Remove all traces of the APR source and binary that you downloaded
and built for yourself.
2. Make sure that the packages libapr1 and libapr1-dev are installed
via apt-get
3. Make sure you build tcnative such that, after:

  $ make distclean
  $ ./configure [...]
  $ make

... you have some .so files sitting-around somewhere.

4. Copy those files into CATALINA_BASE/bin

5. When you launch, make sure that java.library.path includes
CATALINA_BASE/bin

> Also, can I use something else than APR library connector?

Yes. All Tomcat connectors support TLS.

The APR-based connector will outperform all other connectors when
using TLS by an order of magnitude. If you are serious about
performance, you should either use the APR-based connector or
terminate TLS elsewhere (like a reverse proxy) and not have Tomcat do
any crypto at all.

> I have been trying to make it work now with a keystore, but when I
> access my application I get "The connection was reset" error. In my
> keystore, I have my server certificate, my intermediate file and
> primary cert file which have been given to me (the last 2). Also,
> when I look into the logs of the server there is no error/warning
> about using this second Connector, but it still won't work.

Taking PEM files and putting them into a keystore is a real pain in
the neck.

This is the magic formula I've been using for a while, when starting
with PEM files and creating a keystore from scratch:

 $ openssl pkcs12 -export -in ${HOSTNAME}.crt \
                       -inkey ${HOSTNAME}.key \
                    -certfile CA-intermediate.crt
                         -out ${HOSTNAME}.p12
                       -chain

 $ $JAVA_HOME/bin/keytool -importkeystore \
                             -srckeystore ${HOSTNAME}.p12 \
                            -destkeystore ${HOSTNAME}.jks \
                            -srcstoretype pkcs12

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVW3wLAAoJEBzwKT+lPKRYhe0QAJToV385JEvVjnAujgghILzS
3/xLyrOQqbUXo6HVT9+yKtbgtmMqQj7UQ7JQjsDWl0JTrV8e0Y9nJnS91vMZMw8F
aTgf+LqAowH7lehqb0gQRVjmsS1ZSMr51epbAiytx3eZPeOJTc+sxzVyAixrfEDd
UxkEe6dYBI2JA7UnnzbO1OKvpkqYWBksUAKyF0w1X4Lp1AlUeKI+BPEheuWn8RaM
9ppwJxpjTS17GA+hLuPpqH1g4WhxOlzmXewTED1tCrLQ7l3s32/yWaj0jbcfyX+K
++1zzL2/dVdYo0iWA2vRN4udzmgZy7uNVS2i6rtzk9m2udkmWS2dOrJJjwzwu6Yn
QqwbR1/3gP6CUrvE6+8a8zFIyBhju5jVtEeQJeZAZ0KIx//EZvtdFcZPIlzTgap5
y3Wyl3NozpmIrbhjBMZ6EndaW9lUqZHq8kN6IlAH9qGB6zV1snJDw1jn6oEVZWNJ
ADUs8rFIncmrD45AlIESd6Tv8ZjHbFbWUSsrGtotRPkH/Uvm5pU8bMvI106/5IbN
t9bnjSykqpc9Lhpy7JXUlJEgqT54xP8qRXubnppIvSmMtKS5C0F9g787oceF3igS
gZmPDmLXlJcMEHvesPgLu/qWDICoIWiC6qmpPoxYbwN/qtBfyutY+CC32fLhTljw
t1zijZjngG1uamToQ3uN
=pY5F
-----END PGP SIGNATURE-----

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


RE: Problem with APR library - Tomcat 7

Posted by Dejan Stamenov <de...@outlook.com>.
Maybe I have messed up really bad, so I can't solve it now. I will start over with this, can you tell me if this are the steps I need to do for it to work:
install libapr1-devinstall tcnativeWill I need to make that specific .sh file in the Tomcat /bin directory after I have done these 2 steps? 

Also, can I use something else than APR library connector? I have been trying to make it work now with a keystore, but when I access my application I get "The connection was reset" error. In my keystore, I have my server certificate, my intermediate file and primary cert file which have been given to me (the last 2). Also, when I look into the logs of the server there is no error/warning about using this second Connector, but it still won't work.


> Date: Tue, 19 May 2015 11:39:03 -0400
> From: chris@christopherschultz.net
> To: users@tomcat.apache.org
> Subject: Re: Problem with APR library - Tomcat 7
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> Dejan,
> 
> On 5/19/15 10:06 AM, Dejan Stamenov wrote:
> > The output of the ls's below is "No such file or directory" on all
> > of them. It is strange, cause I made make & make install after the 
> > ./configuration was done.
> 
> What was the output of make && make install?
> 
> (Again, I'd argue that "make install" should not be necessary; just
> copy the .so files -- preserving symlinks of course -- to somewhere
> Tomcat can find it with an adjusted java.library.path).
> 
> > Also, I have just installed the libapr1 package, should I do the 
> > tcnative configuration and install again?
> 
> Yes, you will have to re-build tcnative if you have a different APR
> library, assuming they are different versions.
> 
> Remember you will probably:
> 
> 1. Need to install libapr1-dev
> 2. Not need to specify --with-apr for configure
> 
> - -chris
> 
> >> Date: Tue, 19 May 2015 09:56:05 -0400 From: 
> >> chris@christopherschultz.net To: users@tomcat.apache.org
> >> Subject: Re: Problem with APR library - Tomcat 7
> >> 
> > Dejan,
> > 
> > On 5/19/15 9:31 AM, Dejan Stamenov wrote:
> >>>> First, I have downloaded the APR library from here: 
> >>>> http://apache.sunsite.ualberta.ca/apr/apr-1.5.2.tar.gz  . 
> >>>> Following this tutorial: 
> >>>> http://www.techsww.com/tutorials/libraries/apr/installation/install
> ing
> >
> >>>>
> >>>> 
> _apache_portable_runtime_library_on_ubuntu_linux.php
> >>>> 
> >>>> 
> > , I have installed this library into /usr/lib/x86_64-linux-gnu.
> > 
> > This was not necessary. All Debian distributions have a package 
> > available for APR. I highly recommend that you just use the libapr1
> >  package. You are also likely to need the libapr1-dev package in 
> > order to build tcnative, since it's got all of the header files,
> > etc. you'll need.
> > 
> > Manually installing APR shouldn't hurt, but it will make things
> > more complicated than necessary.
> > 
> >>>> After that, I have downloaded the tcnative library from the 
> >>>> links Mark provided. Also, following the same links I run
> >>>> this config command:
> >>>> 
> >>>> ./configure --with-apr=/usr/lib/x86_64-linux-gnu 
> >>>> --with-java-home=/usr/lib/jvm/java-7-openjdk-amd64 
> >>>> --with-ssl=yes --prefix=/usr/lib/x86_64-linux-gnu
> > 
> > Did you also install the APR headers, etc into 
> > /usr/lib/x86_64-linux-gnu? That would be unusual.
> > 
> > You really have no need to install tcnative into 
> > /usr/lib/x86_64-linux-gnu, since it's only going to be used by 
> > Apache Tomcat. If I were you, I'd keep tcnative out of your system 
> > library and change the java.library.path you use when you launch 
> > Tomcat to include the path where tcnative is actually installed.
> > 
> >>>> That --prefix location is where the error log file is 
> >>>> expecting for the library to be found.
> > 
> > Ok. What did you do after "configure"?
> > 
> >>>> Here is the error log:
> >>>> 
> >>>> May 19, 2015 2:59:58 PM org.apache.catalina.startup.Catalina 
> >>>> load INFO: Initialization processed in 1973 ms May 19, 2015 
> >>>> 2:59:58 PM org.apache.catalina.core.StandardService 
> >>>> startInternal INFO: Starting service Catalina May 19, 2015 
> >>>> 2:59:58 PM org.apache.catalina.core.StandardEngine 
> >>>> startInternal INFO: Starting Servlet Engine: Apache 
> >>>> Tomcat/7.0.52 (Ubuntu) May 19, 2015 2:59:58 PM 
> >>>> org.apache.catalina.startup.HostConfig deployDirectory INFO: 
> >>>> Deploying web application directory 
> >>>> /var/lib/tomcat7/webapps/ROOT May 19, 2015 3:00:02 PM 
> >>>> org.apache.coyote.AbstractProtocol start INFO: Starting 
> >>>> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:00:02 PM 
> >>>> org.apache.catalina.startup.Catalina start INFO: Server
> >>>> startup in 4014 ms May 19, 2015 3:06:39 PM 
> >>>> org.apache.coyote.AbstractProtocol pause INFO: Pausing 
> >>>> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:06:39 PM 
> >>>> org.apache.coyote.AbstractProtocol pause INFO: Pausing 
> >>>> ProtocolHandler ["http-apr-8443"] May 19, 2015 3:06:39 PM 
> >>>> org.apache.catalina.core.StandardService stopInternal INFO: 
> >>>> Stopping service Catalina May 19, 2015 3:06:39 PM 
> >>>> org.apache.coyote.AbstractProtocol stop INFO: Stopping 
> >>>> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:06:39 PM 
> >>>> org.apache.coyote.AbstractProtocol destroy INFO: Destroying 
> >>>> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:06:39 PM 
> >>>> org.apache.coyote.AbstractProtocol stop INFO: Stopping 
> >>>> ProtocolHandler ["http-apr-8443"] May 19, 2015 3:06:39 PM 
> >>>> org.apache.coyote.AbstractProtocol destroy INFO: Destroying 
> >>>> ProtocolHandler ["http-apr-8443"] May 19, 2015 3:07:08 PM 
> >>>> org.apache.catalina.startup.ClassLoaderFactory validateFile 
> >>>> WARNING: Problem with directory 
> >>>> [/usr/share/tomcat7/common/classes], exists: [false], 
> >>>> isDirectory: [false], canRead: [false] May 19, 2015 3:07:08
> >>>> PM org.apache.catalina.startup.ClassLoaderFactory
> >>>> validateFile WARNING: Problem with directory
> >>>> [/usr/share/tomcat7/common], exists: [false], isDirectory:
> >>>> [false], canRead: [false] May 19, 2015 3:07:08 PM 
> >>>> org.apache.catalina.startup.ClassLoaderFactory validateFile 
> >>>> WARNING: Problem with directory 
> >>>> [/usr/share/tomcat7/server/classes], exists: [false], 
> >>>> isDirectory: [false], canRead: [false] May 19, 2015 3:07:08
> >>>> PM org.apache.catalina.startup.ClassLoaderFactory
> >>>> validateFile WARNING: Problem with directory
> >>>> [/usr/share/tomcat7/server], exists: [false], isDirectory:
> >>>> [false], canRead: [false] May 19, 2015 3:07:08 PM 
> >>>> org.apache.catalina.startup.ClassLoaderFactory validateFile 
> >>>> WARNING: Problem with directory 
> >>>> [/usr/share/tomcat7/shared/classes], exists: [false], 
> >>>> isDirectory: [false], canRead: [false] May 19, 2015 3:07:08
> >>>> PM org.apache.catalina.startup.ClassLoaderFactory
> >>>> validateFile WARNING: Problem with directory
> >>>> [/usr/share/tomcat7/shared], exists: [false], isDirectory:
> >>>> [false], canRead: [false] May 19, 2015 3:07:09 PM 
> >>>> org.apache.catalina.core.AprLifecycleListener init INFO: The 
> >>>> APR based Apache Tomcat Native library which allows optimal 
> >>>> performance in production environments was not found on the 
> >>>> java.library.path: 
> >>>> /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86
> _64
> >
> >>>>
> >>>> 
> - -linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
> >>>> 
> >>>> 
> > May 19, 2015 3:07:10 PM org.apache.coyote.AbstractProtocol init
> >>>> INFO: Initializing ProtocolHandler ["http-bio-8080"] May 19, 
> >>>> 2015 3:07:10 PM org.apache.catalina.core.StandardService 
> >>>> initInternal SEVERE: Failed to initialize connector 
> >>>> [Connector[HTTP/1.1-8443]] 
> >>>> org.apache.catalina.LifecycleException: Failed to initialize
> >>>>  component [Connector[HTTP/1.1-8443]] at 
> >>>> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
> >>>>
> >>>>
> >
> >>>>
> >>>> 
> at
> > org.apache.catalina.core.StandardService.initInternal(StandardService.
> ja
> >
> >
> > 
> va:559)
> >>>> at 
> >>>> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
> >>>>
> >>>>
> >
> >>>>
> >>>> 
> at
> > org.apache.catalina.core.StandardServer.initInternal(StandardServer.ja
> va
> >
> >
> > 
> :813)
> >>>> at 
> >>>> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
> >>>>
> >>>>
> >
> >>>>
> >>>> 
> at org.apache.catalina.startup.Catalina.load(Catalina.java:638)
> >>>> at
> >>>> org.apache.catalina.startup.Catalina.load(Catalina.java:663) 
> >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> >>>> Method) at 
> >>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImp
> l.j
> >
> >>>>
> >>>> 
> ava:57)
> >>>> 
> >>>> 
> > at 
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> or
> >
> >
> > 
> Impl.java:43)
> >>>> at java.lang.reflect.Method.invoke(Method.java:606) at 
> >>>> org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280)
> >>>>
> >>>> 
> at
> >>>> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)
> >>>>
> >>>> 
> Caused by: org.apache.catalina.LifecycleException: The
> >>>> configured protocol 
> >>>> [org.apache.coyote.http11.Http11AprProtocol] requires the 
> >>>> APR/native library which is not available at 
> >>>> org.apache.catalina.connector.Connector.initInternal(Connector.java
> :97
> >
> >>>>
> >>>> 
> 2)
> >>>> 
> >>>> 
> > at 
> > org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
> >>>>
> > 
> ... 12 more
> >>>> 
> >>>> May 19, 2015 3:07:10 PM org.apache.catalina.startup.Catalina 
> >>>> load INFO: Initialization processed in 1689 ms May 19, 2015 
> >>>> 3:07:10 PM org.apache.catalina.core.StandardService 
> >>>> startInternal INFO: Starting service Catalina May 19, 2015 
> >>>> 3:07:10 PM org.apache.catalina.core.StandardEngine 
> >>>> startInternal INFO: Starting Servlet Engine: Apache 
> >>>> Tomcat/7.0.52 (Ubuntu) May 19, 2015 3:07:10 PM 
> >>>> org.apache.catalina.startup.HostConfig deployDirectory INFO: 
> >>>> Deploying web application directory 
> >>>> /var/lib/tomcat7/webapps/ROOT May 19, 2015 3:07:14 PM 
> >>>> org.apache.coyote.AbstractProtocol start INFO: Starting 
> >>>> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:07:14 PM 
> >>>> org.apache.catalina.startup.Catalina start INFO: Server
> >>>> startup in 3972 ms
> >>>> 
> >>>> That is what I have done so far.
> > 
> > What is the output of:
> > 
> > $ ls -l /usr/java/packages/lib/amd64/*tcnative* \ 
> > /usr/lib/x86_64-linux-gnu/jni/*tcnative* \ 
> > /lib/x86_64-linux-gnu/*tcnative* \ 
> > /usr/lib/x86_64-linux-gnu/*tcnative* \ /usr/lib/jni/*tcnative* \ 
> > /lib/*tcnative* \ /usr/lib/*tcnative*
> > 
> > I suspect you never actually compiled and installed tcnative.
> > 
> > -chris
> > 
> >>>>> Date: Tue, 19 May 2015 09:20:21 -0400 From: 
> >>>>> chris@christopherschultz.net To: users@tomcat.apache.org 
> >>>>> Subject: Re: Problem with APR library - Tomcat 7
> >>>>> 
> >>>> Dejan,
> >>>> 
> >>>> On 5/18/15 4:15 PM, Dejan Stamenov wrote:
> >>>>>>> I am sure I need the APR connector as I need to
> >>>>>>> specify my server certificate, my private key and also
> >>>>>>> a chain of other certificates that signed my server
> >>>>>>> certificate. I haven't found any other connecter that
> >>>>>>> can do this except APR, or I have missed something?
> >>>> 
> >>>> You are mistaken. All of Tomcat's connectors provide TLS 
> >>>> capabilities.
> >>>> 
> >>>> If you want to know what you are missing, please provide two
> >>>>  things:
> >>>> 
> >>>> 1. Complete list of steps you went through to try to install
> >>>>  tcnative (including download, unzip, copy, including all
> >>>> file paths used for everything including what CATALINA_HOME
> >>>> and CATALINA_BASE values are).
> >>>> 
> >>>> 2. The whole log file from a clean run (starting with no log
> >>>>  file), with the text copied and pasted into a message.
> >>>> Nobody wants to go to another web site and read text out of
> >>>> an image. Besides, it means that the mailing list archives
> >>>> are worthless for this thread, since nobody will be able to
> >>>> see that image after a few days/months.
> >>>> 
> >>>> Remember that this mailing list is part of the Tomcat 
> >>>> community and not your own personal help desk. The answered 
> >>>> provided to you are expected to benefit the entire
> >>>> community, not just you specifically.
> >>>> 
> >>>> -chris
> >>>> 
> >>>>>>> -----Original Message----- From: Christopher Schultz 
> >>>>>>> [mailto:chris@christopherschultz.net] Sent: 18 May,
> >>>>>>> 2015 22:11 To: Tomcat Users List Subject: Re: Problem
> >>>>>>> with APR library - Tomcat 7
> >>>>>>> 
> >>>>>>> Dejan,
> >>>>>>> 
> >>>>>>> On 5/18/15 3:53 PM, Dejan Stamenov wrote:
> >>>>>>>> The error below the warning message is saying that
> >>>>>>>> the APR library is missing from my server.
> >>>>>>> 
> >>>>>>> Okay.
> >>>>>>> 
> >>>>>>>> That's why I am sure I need the APR library for
> >>>>>>>> Tomcat 7.
> >>>>>>> 
> >>>>>>> Well, you can use a different type of connector that 
> >>>>>>> *does not* require the APR connector. You *chose* to
> >>>>>>> use the APR connector, and now you need both APR and
> >>>>>>> tcnative to get that to work. I'm asking you about your
> >>>>>>> initial decision: are you sure you need the APR-based
> >>>>>>> connector?
> >>>>>>> 
> >>>>>>>> I have seen Mark message, but had some work and
> >>>>>>>> didn't tried it today. Till tomorrow, I will give you
> >>>>>>>> answer if that was the case and worked, or I need
> >>>>>>>> further help.
> >>>>>>> 
> >>>>>>> Building the APR-based connector on Linux should be
> >>>>>>> very easy. If you have the various packages installed
> >>>>>>> via your package manager, then building tcnative is a
> >>>>>>> typical two-step process to build: "configure",
> >>>>>>> "make".
> >>>>>>> 
> >>>>>>> -chris
> >>>>>>> 
> >>>>>>>> -----Original Message----- From: Christopher Schultz
> >>>>>>>>  [mailto:chris@christopherschultz.net] Sent: 18 May, 
> >>>>>>>> 2015 21:46 To: Tomcat Users List Subject: Re:
> >>>>>>>> Problem with APR library - Tomcat 7
> >>>>>>> 
> >>>>>>>> Dejan,
> >>>>>>> 
> >>>>>>>> On 5/17/15 3:22 PM, Dejan Stamenov wrote:
> >>>>>>>>> I am working on a project where I need to install
> >>>>>>>>> SSL certificates on Tomcat 7 server for my Java 
> >>>>>>>>> application. I have been experimenting around, I
> >>>>>>>>> have set up the connector in the server.xml file,
> >>>>>>>>> but when I look into the logs I can see this:
> >>>>>>> 
> >>>>>>>>> http://prntscr.com/76a98v
> >>>>>>> 
> >>>>>>>> Warning-level message. Are you sure you need
> >>>>>>>> tcnative?
> >>>>>>> 
> >>>>>>>> The error after the warning is more troubling.
> >>>>>>>> What's the full stack trace for /that/?
> >>>>>>> 
> >>>>>>>>> For the connector to be working, I needed to
> >>>>>>>>> install APR library. I did so, following this guide
> >>>>>>>>> here: 
> >>>>>>>>> http://www.techsww.com/tutorials/libraries/apr/installation/in
> sta
> >
> >>>>>>>>>
> >>>>>>>>> 
> lli
> >>>> 
> >>>>>>>>> 
> > n
> >>>>>>> 
> >>>>>>>>> 
> >>>> g
> >>>>>>> 
> >>>>>>>>> 
> >>>>>>>>> 
> >>>>>>>>> 
> >>>>>>> _apach
> >>>>>>> 
> >>>>>>> 
> >>>>>>>> e_portable_runtime_library_on_ubuntu_linux.php
> >>>>>>> 
> >>>>>>>> It's much easier to do "apt-get install libapr" than
> >>>>>>>>  whatever it is you are doing, here.
> >>>>>>> 
> >>>>>>>>> In my case, I use the apr-1.5.2 version. Also, in 
> >>>>>>>>> the configure -prefix part I have specified the
> >>>>>>>>> URL that is shown on my server error log, i.e. 
> >>>>>>>>> /usr/lib/x86_64-linux-gnu. After server reboot, I 
> >>>>>>>>> still get the same error. Have been looking around 
> >>>>>>>>> the internet how to solve this, but only found a 
> >>>>>>>>> couple of open questions on Stack
> >>>>>>>>> Overflow/Exchange with no answers in them.
> >>>>>>> 
> >>>>>>>> As Mark says, tcnative is merely APR-based. You need
> >>>>>>>>  libapr, then you need to build tcnative yourself,
> >>>>>>>> from source, from the links he provided .
> >>>>>>> 
> >>>>>>>> I'll ask again: are you sure you need tcnative?
> >>>>>>> 
> >>>>>>>> -chris
> >>>>>>> 
> >>>>>>>> ---------------------------------------------------------------
> - ---
> >
> >>>>>>>>
> >>>>>>>> 
> - ---
> >>>>>>> 
> >>>>>>>> 
> >>>>>>> 
> >>>>>>> 
> >>>>>>> 
> >>>>>>> 
> >>>>>>>> 
> > 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
> >>>>>>> 
> >>>>>>> 
> >>>>>>> ----------------------------------------------------------------
> - ---
> >>
> >>
> >>>>>>>
> >>>>>>> 
> - ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For 
> >> additional commands, e-mail: users-help@tomcat.apache.org
> >> 
> > 
> > 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
> Comment: GPGTools - http://gpgtools.org
> 
> iQIcBAEBCAAGBQJVW1kXAAoJEBzwKT+lPKRYZzkQAJ/8pqvIqwYkIZzRyugcPYXl
> hChU8PtvYt/gXWr4BLvHM7UdwySd16Grjw9ELAerEhP3X4zCqgsUN4CR7ZPPs9Jz
> YR+fYN74Vt4ntLT2Zr06OEyXLLzaCwyCTTYhyXODad3RV3BqEXBLCRm2Dn2HcxTq
> KN8+rUSHvxIRxn7ICpxtZhg7+5FpEavZ14pMpNDPyHQDWjo1vYgBFqVeeyZ2JlMn
> aakuEVw9oVrCOZtH5jAZnmUklzEo/6jm4Z+T1R5BpoMG7elfqoPZjenpplGqnTzD
> 0aL8gQTwMnbJUfd1XzsIheHs6sdX2TYBtgH8bI6HGPi78bDZoS04/S+RQ8c+SlwT
> 1BWoBCDJp8Vq4vZxrIpY/gGan3M8iFGKckFs1ApdKnZLgqA4xavRFOZiWqQZ3xi3
> m7pPVnCxSNTYRGVTrMw8AnHaJ+nvQJL+Oi+XU7gU50WxF/ymBk5MeoMI89TIWOqk
> ySKLzVMrmZB4iMd9Tta+NB/3F8GiBanG3Fjxqe84X4GVNL1A0FiBszAmgH9YaIvo
> IQF8ayPLaBDMHcdXn9i1Nl84IoWRQWkn2TlqwDlKMDxebN3SSj4lCAcUw5Zp4b5C
> EFuZpMb6CmkjCFeAZVO6nXsFx82SEMSWHwMzXLl4CccZje/UHOCIIms3ZH3utKbE
> mn2/XoM40UbRXXqKQvKC
> =RTUH
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
 		 	   		  

Re: Problem with APR library - Tomcat 7

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Dejan,

On 5/19/15 10:06 AM, Dejan Stamenov wrote:
> The output of the ls's below is "No such file or directory" on all
> of them. It is strange, cause I made make & make install after the 
> ./configuration was done.

What was the output of make && make install?

(Again, I'd argue that "make install" should not be necessary; just
copy the .so files -- preserving symlinks of course -- to somewhere
Tomcat can find it with an adjusted java.library.path).

> Also, I have just installed the libapr1 package, should I do the 
> tcnative configuration and install again?

Yes, you will have to re-build tcnative if you have a different APR
library, assuming they are different versions.

Remember you will probably:

1. Need to install libapr1-dev
2. Not need to specify --with-apr for configure

- -chris

>> Date: Tue, 19 May 2015 09:56:05 -0400 From: 
>> chris@christopherschultz.net To: users@tomcat.apache.org
>> Subject: Re: Problem with APR library - Tomcat 7
>> 
> Dejan,
> 
> On 5/19/15 9:31 AM, Dejan Stamenov wrote:
>>>> First, I have downloaded the APR library from here: 
>>>> http://apache.sunsite.ualberta.ca/apr/apr-1.5.2.tar.gz  . 
>>>> Following this tutorial: 
>>>> http://www.techsww.com/tutorials/libraries/apr/installation/install
ing
>
>>>>
>>>> 
_apache_portable_runtime_library_on_ubuntu_linux.php
>>>> 
>>>> 
> , I have installed this library into /usr/lib/x86_64-linux-gnu.
> 
> This was not necessary. All Debian distributions have a package 
> available for APR. I highly recommend that you just use the libapr1
>  package. You are also likely to need the libapr1-dev package in 
> order to build tcnative, since it's got all of the header files,
> etc. you'll need.
> 
> Manually installing APR shouldn't hurt, but it will make things
> more complicated than necessary.
> 
>>>> After that, I have downloaded the tcnative library from the 
>>>> links Mark provided. Also, following the same links I run
>>>> this config command:
>>>> 
>>>> ./configure --with-apr=/usr/lib/x86_64-linux-gnu 
>>>> --with-java-home=/usr/lib/jvm/java-7-openjdk-amd64 
>>>> --with-ssl=yes --prefix=/usr/lib/x86_64-linux-gnu
> 
> Did you also install the APR headers, etc into 
> /usr/lib/x86_64-linux-gnu? That would be unusual.
> 
> You really have no need to install tcnative into 
> /usr/lib/x86_64-linux-gnu, since it's only going to be used by 
> Apache Tomcat. If I were you, I'd keep tcnative out of your system 
> library and change the java.library.path you use when you launch 
> Tomcat to include the path where tcnative is actually installed.
> 
>>>> That --prefix location is where the error log file is 
>>>> expecting for the library to be found.
> 
> Ok. What did you do after "configure"?
> 
>>>> Here is the error log:
>>>> 
>>>> May 19, 2015 2:59:58 PM org.apache.catalina.startup.Catalina 
>>>> load INFO: Initialization processed in 1973 ms May 19, 2015 
>>>> 2:59:58 PM org.apache.catalina.core.StandardService 
>>>> startInternal INFO: Starting service Catalina May 19, 2015 
>>>> 2:59:58 PM org.apache.catalina.core.StandardEngine 
>>>> startInternal INFO: Starting Servlet Engine: Apache 
>>>> Tomcat/7.0.52 (Ubuntu) May 19, 2015 2:59:58 PM 
>>>> org.apache.catalina.startup.HostConfig deployDirectory INFO: 
>>>> Deploying web application directory 
>>>> /var/lib/tomcat7/webapps/ROOT May 19, 2015 3:00:02 PM 
>>>> org.apache.coyote.AbstractProtocol start INFO: Starting 
>>>> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:00:02 PM 
>>>> org.apache.catalina.startup.Catalina start INFO: Server
>>>> startup in 4014 ms May 19, 2015 3:06:39 PM 
>>>> org.apache.coyote.AbstractProtocol pause INFO: Pausing 
>>>> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:06:39 PM 
>>>> org.apache.coyote.AbstractProtocol pause INFO: Pausing 
>>>> ProtocolHandler ["http-apr-8443"] May 19, 2015 3:06:39 PM 
>>>> org.apache.catalina.core.StandardService stopInternal INFO: 
>>>> Stopping service Catalina May 19, 2015 3:06:39 PM 
>>>> org.apache.coyote.AbstractProtocol stop INFO: Stopping 
>>>> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:06:39 PM 
>>>> org.apache.coyote.AbstractProtocol destroy INFO: Destroying 
>>>> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:06:39 PM 
>>>> org.apache.coyote.AbstractProtocol stop INFO: Stopping 
>>>> ProtocolHandler ["http-apr-8443"] May 19, 2015 3:06:39 PM 
>>>> org.apache.coyote.AbstractProtocol destroy INFO: Destroying 
>>>> ProtocolHandler ["http-apr-8443"] May 19, 2015 3:07:08 PM 
>>>> org.apache.catalina.startup.ClassLoaderFactory validateFile 
>>>> WARNING: Problem with directory 
>>>> [/usr/share/tomcat7/common/classes], exists: [false], 
>>>> isDirectory: [false], canRead: [false] May 19, 2015 3:07:08
>>>> PM org.apache.catalina.startup.ClassLoaderFactory
>>>> validateFile WARNING: Problem with directory
>>>> [/usr/share/tomcat7/common], exists: [false], isDirectory:
>>>> [false], canRead: [false] May 19, 2015 3:07:08 PM 
>>>> org.apache.catalina.startup.ClassLoaderFactory validateFile 
>>>> WARNING: Problem with directory 
>>>> [/usr/share/tomcat7/server/classes], exists: [false], 
>>>> isDirectory: [false], canRead: [false] May 19, 2015 3:07:08
>>>> PM org.apache.catalina.startup.ClassLoaderFactory
>>>> validateFile WARNING: Problem with directory
>>>> [/usr/share/tomcat7/server], exists: [false], isDirectory:
>>>> [false], canRead: [false] May 19, 2015 3:07:08 PM 
>>>> org.apache.catalina.startup.ClassLoaderFactory validateFile 
>>>> WARNING: Problem with directory 
>>>> [/usr/share/tomcat7/shared/classes], exists: [false], 
>>>> isDirectory: [false], canRead: [false] May 19, 2015 3:07:08
>>>> PM org.apache.catalina.startup.ClassLoaderFactory
>>>> validateFile WARNING: Problem with directory
>>>> [/usr/share/tomcat7/shared], exists: [false], isDirectory:
>>>> [false], canRead: [false] May 19, 2015 3:07:09 PM 
>>>> org.apache.catalina.core.AprLifecycleListener init INFO: The 
>>>> APR based Apache Tomcat Native library which allows optimal 
>>>> performance in production environments was not found on the 
>>>> java.library.path: 
>>>> /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86
_64
>
>>>>
>>>> 
- -linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
>>>> 
>>>> 
> May 19, 2015 3:07:10 PM org.apache.coyote.AbstractProtocol init
>>>> INFO: Initializing ProtocolHandler ["http-bio-8080"] May 19, 
>>>> 2015 3:07:10 PM org.apache.catalina.core.StandardService 
>>>> initInternal SEVERE: Failed to initialize connector 
>>>> [Connector[HTTP/1.1-8443]] 
>>>> org.apache.catalina.LifecycleException: Failed to initialize
>>>>  component [Connector[HTTP/1.1-8443]] at 
>>>> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
>>>>
>>>>
>
>>>>
>>>> 
at
> org.apache.catalina.core.StandardService.initInternal(StandardService.
ja
>
>
> 
va:559)
>>>> at 
>>>> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
>>>>
>>>>
>
>>>>
>>>> 
at
> org.apache.catalina.core.StandardServer.initInternal(StandardServer.ja
va
>
>
> 
:813)
>>>> at 
>>>> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
>>>>
>>>>
>
>>>>
>>>> 
at org.apache.catalina.startup.Catalina.load(Catalina.java:638)
>>>> at
>>>> org.apache.catalina.startup.Catalina.load(Catalina.java:663) 
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>> Method) at 
>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImp
l.j
>
>>>>
>>>> 
ava:57)
>>>> 
>>>> 
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
or
>
>
> 
Impl.java:43)
>>>> at java.lang.reflect.Method.invoke(Method.java:606) at 
>>>> org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280)
>>>>
>>>> 
at
>>>> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)
>>>>
>>>> 
Caused by: org.apache.catalina.LifecycleException: The
>>>> configured protocol 
>>>> [org.apache.coyote.http11.Http11AprProtocol] requires the 
>>>> APR/native library which is not available at 
>>>> org.apache.catalina.connector.Connector.initInternal(Connector.java
:97
>
>>>>
>>>> 
2)
>>>> 
>>>> 
> at 
> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
>>>>
> 
... 12 more
>>>> 
>>>> May 19, 2015 3:07:10 PM org.apache.catalina.startup.Catalina 
>>>> load INFO: Initialization processed in 1689 ms May 19, 2015 
>>>> 3:07:10 PM org.apache.catalina.core.StandardService 
>>>> startInternal INFO: Starting service Catalina May 19, 2015 
>>>> 3:07:10 PM org.apache.catalina.core.StandardEngine 
>>>> startInternal INFO: Starting Servlet Engine: Apache 
>>>> Tomcat/7.0.52 (Ubuntu) May 19, 2015 3:07:10 PM 
>>>> org.apache.catalina.startup.HostConfig deployDirectory INFO: 
>>>> Deploying web application directory 
>>>> /var/lib/tomcat7/webapps/ROOT May 19, 2015 3:07:14 PM 
>>>> org.apache.coyote.AbstractProtocol start INFO: Starting 
>>>> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:07:14 PM 
>>>> org.apache.catalina.startup.Catalina start INFO: Server
>>>> startup in 3972 ms
>>>> 
>>>> That is what I have done so far.
> 
> What is the output of:
> 
> $ ls -l /usr/java/packages/lib/amd64/*tcnative* \ 
> /usr/lib/x86_64-linux-gnu/jni/*tcnative* \ 
> /lib/x86_64-linux-gnu/*tcnative* \ 
> /usr/lib/x86_64-linux-gnu/*tcnative* \ /usr/lib/jni/*tcnative* \ 
> /lib/*tcnative* \ /usr/lib/*tcnative*
> 
> I suspect you never actually compiled and installed tcnative.
> 
> -chris
> 
>>>>> Date: Tue, 19 May 2015 09:20:21 -0400 From: 
>>>>> chris@christopherschultz.net To: users@tomcat.apache.org 
>>>>> Subject: Re: Problem with APR library - Tomcat 7
>>>>> 
>>>> Dejan,
>>>> 
>>>> On 5/18/15 4:15 PM, Dejan Stamenov wrote:
>>>>>>> I am sure I need the APR connector as I need to
>>>>>>> specify my server certificate, my private key and also
>>>>>>> a chain of other certificates that signed my server
>>>>>>> certificate. I haven't found any other connecter that
>>>>>>> can do this except APR, or I have missed something?
>>>> 
>>>> You are mistaken. All of Tomcat's connectors provide TLS 
>>>> capabilities.
>>>> 
>>>> If you want to know what you are missing, please provide two
>>>>  things:
>>>> 
>>>> 1. Complete list of steps you went through to try to install
>>>>  tcnative (including download, unzip, copy, including all
>>>> file paths used for everything including what CATALINA_HOME
>>>> and CATALINA_BASE values are).
>>>> 
>>>> 2. The whole log file from a clean run (starting with no log
>>>>  file), with the text copied and pasted into a message.
>>>> Nobody wants to go to another web site and read text out of
>>>> an image. Besides, it means that the mailing list archives
>>>> are worthless for this thread, since nobody will be able to
>>>> see that image after a few days/months.
>>>> 
>>>> Remember that this mailing list is part of the Tomcat 
>>>> community and not your own personal help desk. The answered 
>>>> provided to you are expected to benefit the entire
>>>> community, not just you specifically.
>>>> 
>>>> -chris
>>>> 
>>>>>>> -----Original Message----- From: Christopher Schultz 
>>>>>>> [mailto:chris@christopherschultz.net] Sent: 18 May,
>>>>>>> 2015 22:11 To: Tomcat Users List Subject: Re: Problem
>>>>>>> with APR library - Tomcat 7
>>>>>>> 
>>>>>>> Dejan,
>>>>>>> 
>>>>>>> On 5/18/15 3:53 PM, Dejan Stamenov wrote:
>>>>>>>> The error below the warning message is saying that
>>>>>>>> the APR library is missing from my server.
>>>>>>> 
>>>>>>> Okay.
>>>>>>> 
>>>>>>>> That's why I am sure I need the APR library for
>>>>>>>> Tomcat 7.
>>>>>>> 
>>>>>>> Well, you can use a different type of connector that 
>>>>>>> *does not* require the APR connector. You *chose* to
>>>>>>> use the APR connector, and now you need both APR and
>>>>>>> tcnative to get that to work. I'm asking you about your
>>>>>>> initial decision: are you sure you need the APR-based
>>>>>>> connector?
>>>>>>> 
>>>>>>>> I have seen Mark message, but had some work and
>>>>>>>> didn't tried it today. Till tomorrow, I will give you
>>>>>>>> answer if that was the case and worked, or I need
>>>>>>>> further help.
>>>>>>> 
>>>>>>> Building the APR-based connector on Linux should be
>>>>>>> very easy. If you have the various packages installed
>>>>>>> via your package manager, then building tcnative is a
>>>>>>> typical two-step process to build: "configure",
>>>>>>> "make".
>>>>>>> 
>>>>>>> -chris
>>>>>>> 
>>>>>>>> -----Original Message----- From: Christopher Schultz
>>>>>>>>  [mailto:chris@christopherschultz.net] Sent: 18 May, 
>>>>>>>> 2015 21:46 To: Tomcat Users List Subject: Re:
>>>>>>>> Problem with APR library - Tomcat 7
>>>>>>> 
>>>>>>>> Dejan,
>>>>>>> 
>>>>>>>> On 5/17/15 3:22 PM, Dejan Stamenov wrote:
>>>>>>>>> I am working on a project where I need to install
>>>>>>>>> SSL certificates on Tomcat 7 server for my Java 
>>>>>>>>> application. I have been experimenting around, I
>>>>>>>>> have set up the connector in the server.xml file,
>>>>>>>>> but when I look into the logs I can see this:
>>>>>>> 
>>>>>>>>> http://prntscr.com/76a98v
>>>>>>> 
>>>>>>>> Warning-level message. Are you sure you need
>>>>>>>> tcnative?
>>>>>>> 
>>>>>>>> The error after the warning is more troubling.
>>>>>>>> What's the full stack trace for /that/?
>>>>>>> 
>>>>>>>>> For the connector to be working, I needed to
>>>>>>>>> install APR library. I did so, following this guide
>>>>>>>>> here: 
>>>>>>>>> http://www.techsww.com/tutorials/libraries/apr/installation/in
sta
>
>>>>>>>>>
>>>>>>>>> 
lli
>>>> 
>>>>>>>>> 
> n
>>>>>>> 
>>>>>>>>> 
>>>> g
>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>> _apach
>>>>>>> 
>>>>>>> 
>>>>>>>> e_portable_runtime_library_on_ubuntu_linux.php
>>>>>>> 
>>>>>>>> It's much easier to do "apt-get install libapr" than
>>>>>>>>  whatever it is you are doing, here.
>>>>>>> 
>>>>>>>>> In my case, I use the apr-1.5.2 version. Also, in 
>>>>>>>>> the configure -prefix part I have specified the
>>>>>>>>> URL that is shown on my server error log, i.e. 
>>>>>>>>> /usr/lib/x86_64-linux-gnu. After server reboot, I 
>>>>>>>>> still get the same error. Have been looking around 
>>>>>>>>> the internet how to solve this, but only found a 
>>>>>>>>> couple of open questions on Stack
>>>>>>>>> Overflow/Exchange with no answers in them.
>>>>>>> 
>>>>>>>> As Mark says, tcnative is merely APR-based. You need
>>>>>>>>  libapr, then you need to build tcnative yourself,
>>>>>>>> from source, from the links he provided .
>>>>>>> 
>>>>>>>> I'll ask again: are you sure you need tcnative?
>>>>>>> 
>>>>>>>> -chris
>>>>>>> 
>>>>>>>> ---------------------------------------------------------------
- ---
>
>>>>>>>>
>>>>>>>> 
- ---
>>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>>> 
> 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
>>>>>>> 
>>>>>>> 
>>>>>>> ----------------------------------------------------------------
- ---
>>
>>
>>>>>>>
>>>>>>> 
- ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For 
>> additional commands, e-mail: users-help@tomcat.apache.org
>> 
> 
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVW1kXAAoJEBzwKT+lPKRYZzkQAJ/8pqvIqwYkIZzRyugcPYXl
hChU8PtvYt/gXWr4BLvHM7UdwySd16Grjw9ELAerEhP3X4zCqgsUN4CR7ZPPs9Jz
YR+fYN74Vt4ntLT2Zr06OEyXLLzaCwyCTTYhyXODad3RV3BqEXBLCRm2Dn2HcxTq
KN8+rUSHvxIRxn7ICpxtZhg7+5FpEavZ14pMpNDPyHQDWjo1vYgBFqVeeyZ2JlMn
aakuEVw9oVrCOZtH5jAZnmUklzEo/6jm4Z+T1R5BpoMG7elfqoPZjenpplGqnTzD
0aL8gQTwMnbJUfd1XzsIheHs6sdX2TYBtgH8bI6HGPi78bDZoS04/S+RQ8c+SlwT
1BWoBCDJp8Vq4vZxrIpY/gGan3M8iFGKckFs1ApdKnZLgqA4xavRFOZiWqQZ3xi3
m7pPVnCxSNTYRGVTrMw8AnHaJ+nvQJL+Oi+XU7gU50WxF/ymBk5MeoMI89TIWOqk
ySKLzVMrmZB4iMd9Tta+NB/3F8GiBanG3Fjxqe84X4GVNL1A0FiBszAmgH9YaIvo
IQF8ayPLaBDMHcdXn9i1Nl84IoWRQWkn2TlqwDlKMDxebN3SSj4lCAcUw5Zp4b5C
EFuZpMb6CmkjCFeAZVO6nXsFx82SEMSWHwMzXLl4CccZje/UHOCIIms3ZH3utKbE
mn2/XoM40UbRXXqKQvKC
=RTUH
-----END PGP SIGNATURE-----

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


RE: Problem with APR library - Tomcat 7

Posted by Dejan Stamenov <de...@outlook.com>.
The output of the ls's below is "No such file or directory" on all of them. It is strange, cause I made make & make install after the ./configuration was done.
Also, I have just installed the libapr1 package, should I do the tcnative configuration and install again?

> Date: Tue, 19 May 2015 09:56:05 -0400
> From: chris@christopherschultz.net
> To: users@tomcat.apache.org
> Subject: Re: Problem with APR library - Tomcat 7
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> Dejan,
> 
> On 5/19/15 9:31 AM, Dejan Stamenov wrote:
> > First, I have downloaded the APR library from here: 
> > http://apache.sunsite.ualberta.ca/apr/apr-1.5.2.tar.gz  .
> > Following this tutorial: 
> > http://www.techsww.com/tutorials/libraries/apr/installation/installing
> _apache_portable_runtime_library_on_ubuntu_linux.php
> >
> > 
> , I have installed this library into /usr/lib/x86_64-linux-gnu.
> 
> This was not necessary. All Debian distributions have a package
> available for APR. I highly recommend that you just use the libapr1
> package. You are also likely to need the libapr1-dev package in order
> to build tcnative, since it's got all of the header files, etc. you'll
> need.
> 
> Manually installing APR shouldn't hurt, but it will make things more
> complicated than necessary.
> 
> > After that, I have downloaded the tcnative library from the links 
> > Mark provided. Also, following the same links I run this config 
> > command:
> > 
> > ./configure --with-apr=/usr/lib/x86_64-linux-gnu 
> > --with-java-home=/usr/lib/jvm/java-7-openjdk-amd64 --with-ssl=yes 
> > --prefix=/usr/lib/x86_64-linux-gnu
> 
> Did you also install the APR headers, etc into
> /usr/lib/x86_64-linux-gnu? That would be unusual.
> 
> You really have no need to install tcnative into
> /usr/lib/x86_64-linux-gnu, since it's only going to be used by Apache
> Tomcat. If I were you, I'd keep tcnative out of your system library
> and change the java.library.path you use when you launch Tomcat to
> include the path where tcnative is actually installed.
> 
> > That --prefix location is where the error log file is expecting
> > for the library to be found.
> 
> Ok. What did you do after "configure"?
> 
> > Here is the error log:
> > 
> > May 19, 2015 2:59:58 PM org.apache.catalina.startup.Catalina load 
> > INFO: Initialization processed in 1973 ms May 19, 2015 2:59:58 PM
> > org.apache.catalina.core.StandardService startInternal INFO:
> > Starting service Catalina May 19, 2015 2:59:58 PM
> > org.apache.catalina.core.StandardEngine startInternal INFO:
> > Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu) May 19, 2015
> > 2:59:58 PM org.apache.catalina.startup.HostConfig deployDirectory 
> > INFO: Deploying web application directory
> > /var/lib/tomcat7/webapps/ROOT May 19, 2015 3:00:02 PM
> > org.apache.coyote.AbstractProtocol start INFO: Starting
> > ProtocolHandler ["http-bio-8080"] May 19, 2015 3:00:02 PM
> > org.apache.catalina.startup.Catalina start INFO: Server startup in
> > 4014 ms May 19, 2015 3:06:39 PM org.apache.coyote.AbstractProtocol
> > pause INFO: Pausing ProtocolHandler ["http-bio-8080"] May 19, 2015
> > 3:06:39 PM org.apache.coyote.AbstractProtocol pause INFO: Pausing
> > ProtocolHandler ["http-apr-8443"] May 19, 2015 3:06:39 PM
> > org.apache.catalina.core.StandardService stopInternal INFO:
> > Stopping service Catalina May 19, 2015 3:06:39 PM
> > org.apache.coyote.AbstractProtocol stop INFO: Stopping
> > ProtocolHandler ["http-bio-8080"] May 19, 2015 3:06:39 PM
> > org.apache.coyote.AbstractProtocol destroy INFO: Destroying
> > ProtocolHandler ["http-bio-8080"] May 19, 2015 3:06:39 PM
> > org.apache.coyote.AbstractProtocol stop INFO: Stopping
> > ProtocolHandler ["http-apr-8443"] May 19, 2015 3:06:39 PM
> > org.apache.coyote.AbstractProtocol destroy INFO: Destroying
> > ProtocolHandler ["http-apr-8443"] May 19, 2015 3:07:08 PM
> > org.apache.catalina.startup.ClassLoaderFactory validateFile 
> > WARNING: Problem with directory
> > [/usr/share/tomcat7/common/classes], exists: [false], isDirectory:
> > [false], canRead: [false] May 19, 2015 3:07:08 PM
> > org.apache.catalina.startup.ClassLoaderFactory validateFile 
> > WARNING: Problem with directory [/usr/share/tomcat7/common],
> > exists: [false], isDirectory: [false], canRead: [false] May 19,
> > 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory
> > validateFile WARNING: Problem with directory
> > [/usr/share/tomcat7/server/classes], exists: [false], isDirectory:
> > [false], canRead: [false] May 19, 2015 3:07:08 PM
> > org.apache.catalina.startup.ClassLoaderFactory validateFile 
> > WARNING: Problem with directory [/usr/share/tomcat7/server],
> > exists: [false], isDirectory: [false], canRead: [false] May 19,
> > 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory
> > validateFile WARNING: Problem with directory
> > [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory:
> > [false], canRead: [false] May 19, 2015 3:07:08 PM
> > org.apache.catalina.startup.ClassLoaderFactory validateFile 
> > WARNING: Problem with directory [/usr/share/tomcat7/shared],
> > exists: [false], isDirectory: [false], canRead: [false] May 19,
> > 2015 3:07:09 PM org.apache.catalina.core.AprLifecycleListener init 
> > INFO: The APR based Apache Tomcat Native library which allows
> > optimal performance in production environments was not found on the
> > java.library.path:
> > /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64
> - -linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
> >
> > 
> May 19, 2015 3:07:10 PM org.apache.coyote.AbstractProtocol init
> > INFO: Initializing ProtocolHandler ["http-bio-8080"] May 19, 2015
> > 3:07:10 PM org.apache.catalina.core.StandardService initInternal 
> > SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8443]] 
> > org.apache.catalina.LifecycleException: Failed to initialize
> > component [Connector[HTTP/1.1-8443]] at
> > org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
> >
> > 
> at
> org.apache.catalina.core.StandardService.initInternal(StandardService.ja
> va:559)
> > at
> > org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
> >
> > 
> at
> org.apache.catalina.core.StandardServer.initInternal(StandardServer.java
> :813)
> > at
> > org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
> >
> > 
> at org.apache.catalina.startup.Catalina.load(Catalina.java:638)
> > at org.apache.catalina.startup.Catalina.load(Catalina.java:663) at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
> ava:57)
> >
> > 
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> Impl.java:43)
> > at java.lang.reflect.Method.invoke(Method.java:606) at
> > org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280) at
> > org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454) 
> > Caused by: org.apache.catalina.LifecycleException: The configured
> > protocol [org.apache.coyote.http11.Http11AprProtocol] requires the
> > APR/native library which is not available at
> > org.apache.catalina.connector.Connector.initInternal(Connector.java:97
> 2)
> >
> > 
> at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
> > ... 12 more
> > 
> > May 19, 2015 3:07:10 PM org.apache.catalina.startup.Catalina load 
> > INFO: Initialization processed in 1689 ms May 19, 2015 3:07:10 PM
> > org.apache.catalina.core.StandardService startInternal INFO:
> > Starting service Catalina May 19, 2015 3:07:10 PM
> > org.apache.catalina.core.StandardEngine startInternal INFO:
> > Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu) May 19, 2015
> > 3:07:10 PM org.apache.catalina.startup.HostConfig deployDirectory 
> > INFO: Deploying web application directory
> > /var/lib/tomcat7/webapps/ROOT May 19, 2015 3:07:14 PM
> > org.apache.coyote.AbstractProtocol start INFO: Starting
> > ProtocolHandler ["http-bio-8080"] May 19, 2015 3:07:14 PM
> > org.apache.catalina.startup.Catalina start INFO: Server startup in
> > 3972 ms
> > 
> > That is what I have done so far.
> 
> What is the output of:
> 
> $ ls -l /usr/java/packages/lib/amd64/*tcnative* \
>         /usr/lib/x86_64-linux-gnu/jni/*tcnative* \
>         /lib/x86_64-linux-gnu/*tcnative* \
>         /usr/lib/x86_64-linux-gnu/*tcnative* \
>         /usr/lib/jni/*tcnative* \
>         /lib/*tcnative* \
>         /usr/lib/*tcnative*
> 
> I suspect you never actually compiled and installed tcnative.
> 
> - -chris
> 
> >> Date: Tue, 19 May 2015 09:20:21 -0400 From:
> >> chris@christopherschultz.net To: users@tomcat.apache.org Subject:
> >> Re: Problem with APR library - Tomcat 7
> >> 
> > Dejan,
> > 
> > On 5/18/15 4:15 PM, Dejan Stamenov wrote:
> >>>> I am sure I need the APR connector as I need to specify my
> >>>> server certificate, my private key and also a chain of other
> >>>> certificates that signed my server certificate. I haven't
> >>>> found any other connecter that can do this except APR, or I
> >>>> have missed something?
> > 
> > You are mistaken. All of Tomcat's connectors provide TLS
> > capabilities.
> > 
> > If you want to know what you are missing, please provide two
> > things:
> > 
> > 1. Complete list of steps you went through to try to install
> > tcnative (including download, unzip, copy, including all file paths
> > used for everything including what CATALINA_HOME and CATALINA_BASE
> > values are).
> > 
> > 2. The whole log file from a clean run (starting with no log
> > file), with the text copied and pasted into a message. Nobody wants
> > to go to another web site and read text out of an image. Besides,
> > it means that the mailing list archives are worthless for this
> > thread, since nobody will be able to see that image after a few
> > days/months.
> > 
> > Remember that this mailing list is part of the Tomcat community
> > and not your own personal help desk. The answered provided to you
> > are expected to benefit the entire community, not just you
> > specifically.
> > 
> > -chris
> > 
> >>>> -----Original Message----- From: Christopher Schultz 
> >>>> [mailto:chris@christopherschultz.net] Sent: 18 May, 2015
> >>>> 22:11 To: Tomcat Users List Subject: Re: Problem with APR
> >>>> library - Tomcat 7
> >>>> 
> >>>> Dejan,
> >>>> 
> >>>> On 5/18/15 3:53 PM, Dejan Stamenov wrote:
> >>>>> The error below the warning message is saying that the APR 
> >>>>> library is missing from my server.
> >>>> 
> >>>> Okay.
> >>>> 
> >>>>> That's why I am sure I need the APR library for Tomcat 7.
> >>>> 
> >>>> Well, you can use a different type of connector that *does
> >>>> not* require the APR connector. You *chose* to use the APR
> >>>> connector, and now you need both APR and tcnative to get that
> >>>> to work. I'm asking you about your initial decision: are you
> >>>> sure you need the APR-based connector?
> >>>> 
> >>>>> I have seen Mark message, but had some work and didn't
> >>>>> tried it today. Till tomorrow, I will give you answer if
> >>>>> that was the case and worked, or I need further help.
> >>>> 
> >>>> Building the APR-based connector on Linux should be very
> >>>> easy. If you have the various packages installed via your
> >>>> package manager, then building tcnative is a typical two-step
> >>>> process to build: "configure", "make".
> >>>> 
> >>>> -chris
> >>>> 
> >>>>> -----Original Message----- From: Christopher Schultz 
> >>>>> [mailto:chris@christopherschultz.net] Sent: 18 May, 2015
> >>>>> 21:46 To: Tomcat Users List Subject: Re: Problem with APR
> >>>>> library - Tomcat 7
> >>>> 
> >>>>> Dejan,
> >>>> 
> >>>>> On 5/17/15 3:22 PM, Dejan Stamenov wrote:
> >>>>>> I am working on a project where I need to install SSL 
> >>>>>> certificates on Tomcat 7 server for my Java application.
> >>>>>> I have been experimenting around, I have set up the
> >>>>>> connector in the server.xml file, but when I look into
> >>>>>> the logs I can see this:
> >>>> 
> >>>>>> http://prntscr.com/76a98v
> >>>> 
> >>>>> Warning-level message. Are you sure you need tcnative?
> >>>> 
> >>>>> The error after the warning is more troubling. What's the
> >>>>> full stack trace for /that/?
> >>>> 
> >>>>>> For the connector to be working, I needed to install APR 
> >>>>>> library. I did so, following this guide here: 
> >>>>>> http://www.techsww.com/tutorials/libraries/apr/installation/insta
> lli
> >
> >>>>>> 
> n
> >>>> 
> >>>>>> 
> > g
> >>>> 
> >>>>>> 
> >>>>>> 
> >>>>>> 
> >>>> _apach
> >>>> 
> >>>> 
> >>>>> e_portable_runtime_library_on_ubuntu_linux.php
> >>>> 
> >>>>> It's much easier to do "apt-get install libapr" than
> >>>>> whatever it is you are doing, here.
> >>>> 
> >>>>>> In my case, I use the apr-1.5.2 version. Also, in the
> >>>>>> configure -prefix part I have specified the URL that is
> >>>>>> shown on my server error log, i.e.
> >>>>>> /usr/lib/x86_64-linux-gnu. After server reboot, I still
> >>>>>> get the same error. Have been looking around the internet
> >>>>>> how to solve this, but only found a couple of open 
> >>>>>> questions on Stack Overflow/Exchange with no answers in
> >>>>>> them.
> >>>> 
> >>>>> As Mark says, tcnative is merely APR-based. You need
> >>>>> libapr, then you need to build tcnative yourself, from
> >>>>> source, from the links he provided .
> >>>> 
> >>>>> I'll ask again: are you sure you need tcnative?
> >>>> 
> >>>>> -chris
> >>>> 
> >>>>> ------------------------------------------------------------------
> - ---
> >>>>
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>> 
> 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
> >>>> 
> >>>> 
> >>>> -------------------------------------------------------------------
> - --
> >>>>
> >>>>
> >
> >>>> 
> 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
> >>>> 
> >> 
> >> ---------------------------------------------------------------------
> >>
> >> 
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >> 
> > 
> > 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
> Comment: GPGTools - http://gpgtools.org
> 
> iQIcBAEBCAAGBQJVW0D1AAoJEBzwKT+lPKRYwl0P/Aj5pnjTPAWleqeztqBSZdXU
> f3pgv32wBv4C9Nb6xqPWlqNqdP2GvKkx9kk0aafjdBnJS6J3HDc/OcIOqoOzrjqB
> Q9f+oVfvgdNeS2TdFozaS+hJSbmgTeuf8PpMbdL0aHnOSEltyhooRZRJaVwShDVN
> qSRqVGCiGSOJFVUaoo3R5p2GGR75sh7cNGpdgaKS+naqSbHUNBTXVu/fQ+umIEv0
> jB8Z/s9Cbx0iz5nQh5TYMWBecjhsWly3PICCUHEiPipsjN0ORpCcqlesjNHLbg3z
> IBqkIj2YfVUh6nfEi48OVafzPi4M6UpoAEoaBUz7PeBYQhVbcs5c7WLO/Nqn1IBF
> 2rN6HC3TMunx9Am8Nu0m2vap7mJ4a3VScCw2n4wJVYf+nZwkTzajHVjbg6tTjcCg
> KYcVcGnxrPjdsOdUPVkGQUWKd5+gxES6bKhIjoDJWk6UUifSHnQphVPQvx7aTTqS
> vqRX628EdrZkKJfh2mik3E4toeTC2ZvfPj+h0znueUK3kA3Yv2rU+OzxX6DZA2kn
> lFH2YpgAuOdPMTxNBhWf8sXFApqQnKc+FH0T8FTL8MrE/33QFFwH7XlaIHfMA73X
> oG6Uc6cwAyJTMK5i7sjxVJRZCCyTzuEpLdWzDAVpKK9rCtz5GPsNPIzkBnyeyegW
> iSI5tOax4E5SpVNn1ay4
> =9J+t
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
 		 	   		  

Re: Problem with APR library - Tomcat 7

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Dejan,

On 5/19/15 9:31 AM, Dejan Stamenov wrote:
> First, I have downloaded the APR library from here: 
> http://apache.sunsite.ualberta.ca/apr/apr-1.5.2.tar.gz  .
> Following this tutorial: 
> http://www.techsww.com/tutorials/libraries/apr/installation/installing
_apache_portable_runtime_library_on_ubuntu_linux.php
>
> 
, I have installed this library into /usr/lib/x86_64-linux-gnu.

This was not necessary. All Debian distributions have a package
available for APR. I highly recommend that you just use the libapr1
package. You are also likely to need the libapr1-dev package in order
to build tcnative, since it's got all of the header files, etc. you'll
need.

Manually installing APR shouldn't hurt, but it will make things more
complicated than necessary.

> After that, I have downloaded the tcnative library from the links 
> Mark provided. Also, following the same links I run this config 
> command:
> 
> ./configure --with-apr=/usr/lib/x86_64-linux-gnu 
> --with-java-home=/usr/lib/jvm/java-7-openjdk-amd64 --with-ssl=yes 
> --prefix=/usr/lib/x86_64-linux-gnu

Did you also install the APR headers, etc into
/usr/lib/x86_64-linux-gnu? That would be unusual.

You really have no need to install tcnative into
/usr/lib/x86_64-linux-gnu, since it's only going to be used by Apache
Tomcat. If I were you, I'd keep tcnative out of your system library
and change the java.library.path you use when you launch Tomcat to
include the path where tcnative is actually installed.

> That --prefix location is where the error log file is expecting
> for the library to be found.

Ok. What did you do after "configure"?

> Here is the error log:
> 
> May 19, 2015 2:59:58 PM org.apache.catalina.startup.Catalina load 
> INFO: Initialization processed in 1973 ms May 19, 2015 2:59:58 PM
> org.apache.catalina.core.StandardService startInternal INFO:
> Starting service Catalina May 19, 2015 2:59:58 PM
> org.apache.catalina.core.StandardEngine startInternal INFO:
> Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu) May 19, 2015
> 2:59:58 PM org.apache.catalina.startup.HostConfig deployDirectory 
> INFO: Deploying web application directory
> /var/lib/tomcat7/webapps/ROOT May 19, 2015 3:00:02 PM
> org.apache.coyote.AbstractProtocol start INFO: Starting
> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:00:02 PM
> org.apache.catalina.startup.Catalina start INFO: Server startup in
> 4014 ms May 19, 2015 3:06:39 PM org.apache.coyote.AbstractProtocol
> pause INFO: Pausing ProtocolHandler ["http-bio-8080"] May 19, 2015
> 3:06:39 PM org.apache.coyote.AbstractProtocol pause INFO: Pausing
> ProtocolHandler ["http-apr-8443"] May 19, 2015 3:06:39 PM
> org.apache.catalina.core.StandardService stopInternal INFO:
> Stopping service Catalina May 19, 2015 3:06:39 PM
> org.apache.coyote.AbstractProtocol stop INFO: Stopping
> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:06:39 PM
> org.apache.coyote.AbstractProtocol destroy INFO: Destroying
> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:06:39 PM
> org.apache.coyote.AbstractProtocol stop INFO: Stopping
> ProtocolHandler ["http-apr-8443"] May 19, 2015 3:06:39 PM
> org.apache.coyote.AbstractProtocol destroy INFO: Destroying
> ProtocolHandler ["http-apr-8443"] May 19, 2015 3:07:08 PM
> org.apache.catalina.startup.ClassLoaderFactory validateFile 
> WARNING: Problem with directory
> [/usr/share/tomcat7/common/classes], exists: [false], isDirectory:
> [false], canRead: [false] May 19, 2015 3:07:08 PM
> org.apache.catalina.startup.ClassLoaderFactory validateFile 
> WARNING: Problem with directory [/usr/share/tomcat7/common],
> exists: [false], isDirectory: [false], canRead: [false] May 19,
> 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory
> validateFile WARNING: Problem with directory
> [/usr/share/tomcat7/server/classes], exists: [false], isDirectory:
> [false], canRead: [false] May 19, 2015 3:07:08 PM
> org.apache.catalina.startup.ClassLoaderFactory validateFile 
> WARNING: Problem with directory [/usr/share/tomcat7/server],
> exists: [false], isDirectory: [false], canRead: [false] May 19,
> 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory
> validateFile WARNING: Problem with directory
> [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory:
> [false], canRead: [false] May 19, 2015 3:07:08 PM
> org.apache.catalina.startup.ClassLoaderFactory validateFile 
> WARNING: Problem with directory [/usr/share/tomcat7/shared],
> exists: [false], isDirectory: [false], canRead: [false] May 19,
> 2015 3:07:09 PM org.apache.catalina.core.AprLifecycleListener init 
> INFO: The APR based Apache Tomcat Native library which allows
> optimal performance in production environments was not found on the
> java.library.path:
> /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64
- -linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
>
> 
May 19, 2015 3:07:10 PM org.apache.coyote.AbstractProtocol init
> INFO: Initializing ProtocolHandler ["http-bio-8080"] May 19, 2015
> 3:07:10 PM org.apache.catalina.core.StandardService initInternal 
> SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8443]] 
> org.apache.catalina.LifecycleException: Failed to initialize
> component [Connector[HTTP/1.1-8443]] at
> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
>
> 
at
org.apache.catalina.core.StandardService.initInternal(StandardService.ja
va:559)
> at
> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
>
> 
at
org.apache.catalina.core.StandardServer.initInternal(StandardServer.java
:813)
> at
> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
>
> 
at org.apache.catalina.startup.Catalina.load(Catalina.java:638)
> at org.apache.catalina.startup.Catalina.load(Catalina.java:663) at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
ava:57)
>
> 
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606) at
> org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280) at
> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454) 
> Caused by: org.apache.catalina.LifecycleException: The configured
> protocol [org.apache.coyote.http11.Http11AprProtocol] requires the
> APR/native library which is not available at
> org.apache.catalina.connector.Connector.initInternal(Connector.java:97
2)
>
> 
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
> ... 12 more
> 
> May 19, 2015 3:07:10 PM org.apache.catalina.startup.Catalina load 
> INFO: Initialization processed in 1689 ms May 19, 2015 3:07:10 PM
> org.apache.catalina.core.StandardService startInternal INFO:
> Starting service Catalina May 19, 2015 3:07:10 PM
> org.apache.catalina.core.StandardEngine startInternal INFO:
> Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu) May 19, 2015
> 3:07:10 PM org.apache.catalina.startup.HostConfig deployDirectory 
> INFO: Deploying web application directory
> /var/lib/tomcat7/webapps/ROOT May 19, 2015 3:07:14 PM
> org.apache.coyote.AbstractProtocol start INFO: Starting
> ProtocolHandler ["http-bio-8080"] May 19, 2015 3:07:14 PM
> org.apache.catalina.startup.Catalina start INFO: Server startup in
> 3972 ms
> 
> That is what I have done so far.

What is the output of:

$ ls -l /usr/java/packages/lib/amd64/*tcnative* \
        /usr/lib/x86_64-linux-gnu/jni/*tcnative* \
        /lib/x86_64-linux-gnu/*tcnative* \
        /usr/lib/x86_64-linux-gnu/*tcnative* \
        /usr/lib/jni/*tcnative* \
        /lib/*tcnative* \
        /usr/lib/*tcnative*

I suspect you never actually compiled and installed tcnative.

- -chris

>> Date: Tue, 19 May 2015 09:20:21 -0400 From:
>> chris@christopherschultz.net To: users@tomcat.apache.org Subject:
>> Re: Problem with APR library - Tomcat 7
>> 
> Dejan,
> 
> On 5/18/15 4:15 PM, Dejan Stamenov wrote:
>>>> I am sure I need the APR connector as I need to specify my
>>>> server certificate, my private key and also a chain of other
>>>> certificates that signed my server certificate. I haven't
>>>> found any other connecter that can do this except APR, or I
>>>> have missed something?
> 
> You are mistaken. All of Tomcat's connectors provide TLS
> capabilities.
> 
> If you want to know what you are missing, please provide two
> things:
> 
> 1. Complete list of steps you went through to try to install
> tcnative (including download, unzip, copy, including all file paths
> used for everything including what CATALINA_HOME and CATALINA_BASE
> values are).
> 
> 2. The whole log file from a clean run (starting with no log
> file), with the text copied and pasted into a message. Nobody wants
> to go to another web site and read text out of an image. Besides,
> it means that the mailing list archives are worthless for this
> thread, since nobody will be able to see that image after a few
> days/months.
> 
> Remember that this mailing list is part of the Tomcat community
> and not your own personal help desk. The answered provided to you
> are expected to benefit the entire community, not just you
> specifically.
> 
> -chris
> 
>>>> -----Original Message----- From: Christopher Schultz 
>>>> [mailto:chris@christopherschultz.net] Sent: 18 May, 2015
>>>> 22:11 To: Tomcat Users List Subject: Re: Problem with APR
>>>> library - Tomcat 7
>>>> 
>>>> Dejan,
>>>> 
>>>> On 5/18/15 3:53 PM, Dejan Stamenov wrote:
>>>>> The error below the warning message is saying that the APR 
>>>>> library is missing from my server.
>>>> 
>>>> Okay.
>>>> 
>>>>> That's why I am sure I need the APR library for Tomcat 7.
>>>> 
>>>> Well, you can use a different type of connector that *does
>>>> not* require the APR connector. You *chose* to use the APR
>>>> connector, and now you need both APR and tcnative to get that
>>>> to work. I'm asking you about your initial decision: are you
>>>> sure you need the APR-based connector?
>>>> 
>>>>> I have seen Mark message, but had some work and didn't
>>>>> tried it today. Till tomorrow, I will give you answer if
>>>>> that was the case and worked, or I need further help.
>>>> 
>>>> Building the APR-based connector on Linux should be very
>>>> easy. If you have the various packages installed via your
>>>> package manager, then building tcnative is a typical two-step
>>>> process to build: "configure", "make".
>>>> 
>>>> -chris
>>>> 
>>>>> -----Original Message----- From: Christopher Schultz 
>>>>> [mailto:chris@christopherschultz.net] Sent: 18 May, 2015
>>>>> 21:46 To: Tomcat Users List Subject: Re: Problem with APR
>>>>> library - Tomcat 7
>>>> 
>>>>> Dejan,
>>>> 
>>>>> On 5/17/15 3:22 PM, Dejan Stamenov wrote:
>>>>>> I am working on a project where I need to install SSL 
>>>>>> certificates on Tomcat 7 server for my Java application.
>>>>>> I have been experimenting around, I have set up the
>>>>>> connector in the server.xml file, but when I look into
>>>>>> the logs I can see this:
>>>> 
>>>>>> http://prntscr.com/76a98v
>>>> 
>>>>> Warning-level message. Are you sure you need tcnative?
>>>> 
>>>>> The error after the warning is more troubling. What's the
>>>>> full stack trace for /that/?
>>>> 
>>>>>> For the connector to be working, I needed to install APR 
>>>>>> library. I did so, following this guide here: 
>>>>>> http://www.techsww.com/tutorials/libraries/apr/installation/insta
lli
>
>>>>>> 
n
>>>> 
>>>>>> 
> g
>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>> _apach
>>>> 
>>>> 
>>>>> e_portable_runtime_library_on_ubuntu_linux.php
>>>> 
>>>>> It's much easier to do "apt-get install libapr" than
>>>>> whatever it is you are doing, here.
>>>> 
>>>>>> In my case, I use the apr-1.5.2 version. Also, in the
>>>>>> configure -prefix part I have specified the URL that is
>>>>>> shown on my server error log, i.e.
>>>>>> /usr/lib/x86_64-linux-gnu. After server reboot, I still
>>>>>> get the same error. Have been looking around the internet
>>>>>> how to solve this, but only found a couple of open 
>>>>>> questions on Stack Overflow/Exchange with no answers in
>>>>>> them.
>>>> 
>>>>> As Mark says, tcnative is merely APR-based. You need
>>>>> libapr, then you need to build tcnative yourself, from
>>>>> source, from the links he provided .
>>>> 
>>>>> I'll ask again: are you sure you need tcnative?
>>>> 
>>>>> -chris
>>>> 
>>>>> ------------------------------------------------------------------
- ---
>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> 
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
>>>> 
>>>> 
>>>> -------------------------------------------------------------------
- --
>>>>
>>>>
>
>>>> 
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
>>>> 
>> 
>> ---------------------------------------------------------------------
>>
>> 
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
> 
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVW0D1AAoJEBzwKT+lPKRYwl0P/Aj5pnjTPAWleqeztqBSZdXU
f3pgv32wBv4C9Nb6xqPWlqNqdP2GvKkx9kk0aafjdBnJS6J3HDc/OcIOqoOzrjqB
Q9f+oVfvgdNeS2TdFozaS+hJSbmgTeuf8PpMbdL0aHnOSEltyhooRZRJaVwShDVN
qSRqVGCiGSOJFVUaoo3R5p2GGR75sh7cNGpdgaKS+naqSbHUNBTXVu/fQ+umIEv0
jB8Z/s9Cbx0iz5nQh5TYMWBecjhsWly3PICCUHEiPipsjN0ORpCcqlesjNHLbg3z
IBqkIj2YfVUh6nfEi48OVafzPi4M6UpoAEoaBUz7PeBYQhVbcs5c7WLO/Nqn1IBF
2rN6HC3TMunx9Am8Nu0m2vap7mJ4a3VScCw2n4wJVYf+nZwkTzajHVjbg6tTjcCg
KYcVcGnxrPjdsOdUPVkGQUWKd5+gxES6bKhIjoDJWk6UUifSHnQphVPQvx7aTTqS
vqRX628EdrZkKJfh2mik3E4toeTC2ZvfPj+h0znueUK3kA3Yv2rU+OzxX6DZA2kn
lFH2YpgAuOdPMTxNBhWf8sXFApqQnKc+FH0T8FTL8MrE/33QFFwH7XlaIHfMA73X
oG6Uc6cwAyJTMK5i7sjxVJRZCCyTzuEpLdWzDAVpKK9rCtz5GPsNPIzkBnyeyegW
iSI5tOax4E5SpVNn1ay4
=9J+t
-----END PGP SIGNATURE-----

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


RE: Problem with APR library - Tomcat 7

Posted by Dejan Stamenov <de...@outlook.com>.
Hello Chris,

First, I have downloaded the APR library from here: http://apache.sunsite.ualberta.ca/apr/apr-1.5.2.tar.gz  . Following this tutorial: http://www.techsww.com/tutorials/libraries/apr/installation/installing_apache_portable_runtime_library_on_ubuntu_linux.php , I have installed this library into /usr/lib/x86_64-linux-gnu.
After that, I have downloaded the tcnative library from the links Mark provided. Also, following the same links I run this config command:
./configure --with-apr=/usr/lib/x86_64-linux-gnu
            --with-java-home=/usr/lib/jvm/java-7-openjdk-amd64 
            --with-ssl=yes
            --prefix=/usr/lib/x86_64-linux-gnu

That --prefix location is where the error log file is expecting for the library to be found.
Here is the error log:

May 19, 2015 2:59:58 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1973 ms
May 19, 2015 2:59:58 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
May 19, 2015 2:59:58 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
May 19, 2015 2:59:58 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
May 19, 2015 3:00:02 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
May 19, 2015 3:00:02 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4014 ms
May 19, 2015 3:06:39 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
May 19, 2015 3:06:39 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-apr-8443"]
May 19, 2015 3:06:39 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
May 19, 2015 3:06:39 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
May 19, 2015 3:06:39 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
May 19, 2015 3:06:39 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-apr-8443"]
May 19, 2015 3:06:39 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-apr-8443"]
May 19, 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false]
May 19, 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false]
May 19, 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false]
May 19, 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false]
May 19, 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
May 19, 2015 3:07:08 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false]
May 19, 2015 3:07:09 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
May 19, 2015 3:07:10 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
May 19, 2015 3:07:10 PM org.apache.catalina.core.StandardService initInternal
SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8443]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-8443]]
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:813)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:638)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:663)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)
Caused by: org.apache.catalina.LifecycleException: The configured protocol [org.apache.coyote.http11.Http11AprProtocol] requires the APR/native library which is not available
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:972)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    ... 12 more

May 19, 2015 3:07:10 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1689 ms
May 19, 2015 3:07:10 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
May 19, 2015 3:07:10 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
May 19, 2015 3:07:10 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
May 19, 2015 3:07:14 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
May 19, 2015 3:07:14 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3972 ms

That is what I have done so far.

> Date: Tue, 19 May 2015 09:20:21 -0400
> From: chris@christopherschultz.net
> To: users@tomcat.apache.org
> Subject: Re: Problem with APR library - Tomcat 7
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> Dejan,
> 
> On 5/18/15 4:15 PM, Dejan Stamenov wrote:
> > I am sure I need the APR connector as I need to specify my server 
> > certificate, my private key and also a chain of other certificates
> > that signed my server certificate. I haven't found any other
> > connecter that can do this except APR, or I have missed something?
> 
> You are mistaken. All of Tomcat's connectors provide TLS capabilities.
> 
> If you want to know what you are missing, please provide two things:
> 
> 1. Complete list of steps you went through to try to install tcnative
> (including download, unzip, copy, including all file paths used for
> everything including what CATALINA_HOME and CATALINA_BASE values are).
> 
> 2. The whole log file from a clean run (starting with no log file),
> with the text copied and pasted into a message. Nobody wants to go to
> another web site and read text out of an image. Besides, it means that
> the mailing list archives are worthless for this thread, since nobody
> will be able to see that image after a few days/months.
> 
> Remember that this mailing list is part of the Tomcat community and
> not your own personal help desk. The answered provided to you are
> expected to benefit the entire community, not just you specifically.
> 
> - -chris
> 
> > -----Original Message----- From: Christopher Schultz
> > [mailto:chris@christopherschultz.net] Sent: 18 May, 2015 22:11 To:
> > Tomcat Users List Subject: Re: Problem with APR library - Tomcat 7
> > 
> > Dejan,
> > 
> > On 5/18/15 3:53 PM, Dejan Stamenov wrote:
> >> The error below the warning message is saying that the APR
> >> library is missing from my server.
> > 
> > Okay.
> > 
> >> That's why I am sure I need the APR library for Tomcat 7.
> > 
> > Well, you can use a different type of connector that *does not*
> > require the APR connector. You *chose* to use the APR connector,
> > and now you need both APR and tcnative to get that to work. I'm
> > asking you about your initial decision: are you sure you need the
> > APR-based connector?
> > 
> >> I have seen Mark message, but had some work and didn't tried it
> >> today. Till tomorrow, I will give you answer if that was the case
> >> and worked, or I need further help.
> > 
> > Building the APR-based connector on Linux should be very easy. If
> > you have the various packages installed via your package manager,
> > then building tcnative is a typical two-step process to build:
> > "configure", "make".
> > 
> > -chris
> > 
> >> -----Original Message----- From: Christopher Schultz 
> >> [mailto:chris@christopherschultz.net] Sent: 18 May, 2015 21:46
> >> To: Tomcat Users List Subject: Re: Problem with APR library -
> >> Tomcat 7
> > 
> >> Dejan,
> > 
> >> On 5/17/15 3:22 PM, Dejan Stamenov wrote:
> >>> I am working on a project where I need to install SSL
> >>> certificates on Tomcat 7 server for my Java application. I have
> >>> been experimenting around, I have set up the connector in the
> >>> server.xml file, but when I look into the logs I can see this:
> > 
> >>> http://prntscr.com/76a98v
> > 
> >> Warning-level message. Are you sure you need tcnative?
> > 
> >> The error after the warning is more troubling. What's the full
> >> stack trace for /that/?
> > 
> >>> For the connector to be working, I needed to install APR
> >>> library. I did so, following this guide here: 
> >>> http://www.techsww.com/tutorials/libraries/apr/installation/installi
> n
> >
> >>> 
> g
> > 
> >>> 
> >>> 
> >>> 
> > _apach
> > 
> > 
> >> e_portable_runtime_library_on_ubuntu_linux.php
> > 
> >> It's much easier to do "apt-get install libapr" than whatever it
> >> is you are doing, here.
> > 
> >>> In my case, I use the apr-1.5.2 version. Also, in the configure
> >>>  -prefix part I have specified the URL that is shown on my
> >>> server error log, i.e. /usr/lib/x86_64-linux-gnu. After server
> >>> reboot, I still get the same error. Have been looking around
> >>> the internet how to solve this, but only found a couple of open
> >>> questions on Stack Overflow/Exchange with no answers in them.
> > 
> >> As Mark says, tcnative is merely APR-based. You need libapr, then
> >> you need to build tcnative yourself, from source, from the links
> >> he provided .
> > 
> >> I'll ask again: are you sure you need tcnative?
> > 
> >> -chris
> > 
> >> ---------------------------------------------------------------------
> >
> >> 
> > 
> > 
> > 
> > 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
> > 
> > 
> > ---------------------------------------------------------------------
> >
> > 
> 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
> > 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
> Comment: GPGTools - http://gpgtools.org
> 
> iQIcBAEBCAAGBQJVWziVAAoJEBzwKT+lPKRYk2sQAIqy7jTdK3yDezHrAXYKrBKo
> mn69ZsSj1FfCuX6RKjHH1vEmCwKsD+QN0lnn3upEHIzqyoxOZURNncsi8kdVCmNK
> oBGz5UV6PlN5vZyqio3SlM1ryuurLOSg6jFj42pCh+m0kWOmT7+lmmddH0YEpSI5
> 5uneXQF9Tg6D426X7UMG1L5qnf43c8Gy/j0VPPowNhX5YYmQxdwTcd01FkYY39Tp
> UVSL9k/e8SmT9uTdY/9GsdIA/XfWa76LfM9OfiXPRO/tXY1J07Cc0iX0TefW8TLj
> JDIUVJ1PDEvGDas9fjizs+NquyiQH8RHopY4MsygFADW6rw6UcL/LuNDT5LVXCZ1
> dATbQpMhGlB89tmB/6q/PtnIdL4Vmd6oIl6qdXlopkivuSfsEmrz+aDydE7rK0sr
> n4Dq/MEy/QlzAElwQBLIl1jCh9durr2J5cKUf2f2H6bMnSjMseXNPtMSNxEeZYiI
> TVFxHA0lzOIr2pvUyufPsS56wjpfd2o11W8iPg3SeWslaIFRLsn0G27BeXRAnJex
> DBgutbthZCWltuPaaVnqXLnUA0WMAq50SNwmJ+9eb8fP8nvnOeMi6k+6WyyhR/D8
> q8kOYcFBl8oXnRgI1uWaFO/+vdzy+0YerbfOzlnYEiLlRF3dUh6An/yb8nttSrRl
> MXh+xXcpE10tnLnI157r
> =HRz8
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
 		 	   		  

Re: Problem with APR library - Tomcat 7

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Dejan,

On 5/18/15 4:15 PM, Dejan Stamenov wrote:
> I am sure I need the APR connector as I need to specify my server 
> certificate, my private key and also a chain of other certificates
> that signed my server certificate. I haven't found any other
> connecter that can do this except APR, or I have missed something?

You are mistaken. All of Tomcat's connectors provide TLS capabilities.

If you want to know what you are missing, please provide two things:

1. Complete list of steps you went through to try to install tcnative
(including download, unzip, copy, including all file paths used for
everything including what CATALINA_HOME and CATALINA_BASE values are).

2. The whole log file from a clean run (starting with no log file),
with the text copied and pasted into a message. Nobody wants to go to
another web site and read text out of an image. Besides, it means that
the mailing list archives are worthless for this thread, since nobody
will be able to see that image after a few days/months.

Remember that this mailing list is part of the Tomcat community and
not your own personal help desk. The answered provided to you are
expected to benefit the entire community, not just you specifically.

- -chris

> -----Original Message----- From: Christopher Schultz
> [mailto:chris@christopherschultz.net] Sent: 18 May, 2015 22:11 To:
> Tomcat Users List Subject: Re: Problem with APR library - Tomcat 7
> 
> Dejan,
> 
> On 5/18/15 3:53 PM, Dejan Stamenov wrote:
>> The error below the warning message is saying that the APR
>> library is missing from my server.
> 
> Okay.
> 
>> That's why I am sure I need the APR library for Tomcat 7.
> 
> Well, you can use a different type of connector that *does not*
> require the APR connector. You *chose* to use the APR connector,
> and now you need both APR and tcnative to get that to work. I'm
> asking you about your initial decision: are you sure you need the
> APR-based connector?
> 
>> I have seen Mark message, but had some work and didn't tried it
>> today. Till tomorrow, I will give you answer if that was the case
>> and worked, or I need further help.
> 
> Building the APR-based connector on Linux should be very easy. If
> you have the various packages installed via your package manager,
> then building tcnative is a typical two-step process to build:
> "configure", "make".
> 
> -chris
> 
>> -----Original Message----- From: Christopher Schultz 
>> [mailto:chris@christopherschultz.net] Sent: 18 May, 2015 21:46
>> To: Tomcat Users List Subject: Re: Problem with APR library -
>> Tomcat 7
> 
>> Dejan,
> 
>> On 5/17/15 3:22 PM, Dejan Stamenov wrote:
>>> I am working on a project where I need to install SSL
>>> certificates on Tomcat 7 server for my Java application. I have
>>> been experimenting around, I have set up the connector in the
>>> server.xml file, but when I look into the logs I can see this:
> 
>>> http://prntscr.com/76a98v
> 
>> Warning-level message. Are you sure you need tcnative?
> 
>> The error after the warning is more troubling. What's the full
>> stack trace for /that/?
> 
>>> For the connector to be working, I needed to install APR
>>> library. I did so, following this guide here: 
>>> http://www.techsww.com/tutorials/libraries/apr/installation/installi
n
>
>>> 
g
> 
>>> 
>>> 
>>> 
> _apach
> 
> 
>> e_portable_runtime_library_on_ubuntu_linux.php
> 
>> It's much easier to do "apt-get install libapr" than whatever it
>> is you are doing, here.
> 
>>> In my case, I use the apr-1.5.2 version. Also, in the configure
>>>  -prefix part I have specified the URL that is shown on my
>>> server error log, i.e. /usr/lib/x86_64-linux-gnu. After server
>>> reboot, I still get the same error. Have been looking around
>>> the internet how to solve this, but only found a couple of open
>>> questions on Stack Overflow/Exchange with no answers in them.
> 
>> As Mark says, tcnative is merely APR-based. You need libapr, then
>> you need to build tcnative yourself, from source, from the links
>> he provided .
> 
>> I'll ask again: are you sure you need tcnative?
> 
>> -chris
> 
>> ---------------------------------------------------------------------
>
>> 
> 
> 
> 
> 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
> 
> 
> ---------------------------------------------------------------------
>
> 
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
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVWziVAAoJEBzwKT+lPKRYk2sQAIqy7jTdK3yDezHrAXYKrBKo
mn69ZsSj1FfCuX6RKjHH1vEmCwKsD+QN0lnn3upEHIzqyoxOZURNncsi8kdVCmNK
oBGz5UV6PlN5vZyqio3SlM1ryuurLOSg6jFj42pCh+m0kWOmT7+lmmddH0YEpSI5
5uneXQF9Tg6D426X7UMG1L5qnf43c8Gy/j0VPPowNhX5YYmQxdwTcd01FkYY39Tp
UVSL9k/e8SmT9uTdY/9GsdIA/XfWa76LfM9OfiXPRO/tXY1J07Cc0iX0TefW8TLj
JDIUVJ1PDEvGDas9fjizs+NquyiQH8RHopY4MsygFADW6rw6UcL/LuNDT5LVXCZ1
dATbQpMhGlB89tmB/6q/PtnIdL4Vmd6oIl6qdXlopkivuSfsEmrz+aDydE7rK0sr
n4Dq/MEy/QlzAElwQBLIl1jCh9durr2J5cKUf2f2H6bMnSjMseXNPtMSNxEeZYiI
TVFxHA0lzOIr2pvUyufPsS56wjpfd2o11W8iPg3SeWslaIFRLsn0G27BeXRAnJex
DBgutbthZCWltuPaaVnqXLnUA0WMAq50SNwmJ+9eb8fP8nvnOeMi6k+6WyyhR/D8
q8kOYcFBl8oXnRgI1uWaFO/+vdzy+0YerbfOzlnYEiLlRF3dUh6An/yb8nttSrRl
MXh+xXcpE10tnLnI157r
=HRz8
-----END PGP SIGNATURE-----

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


RE: Problem with APR library - Tomcat 7

Posted by Dejan Stamenov <de...@outlook.com>.
Chris,

I am sure I need the APR connector as I need to specify my server certificate, my private key and also a chain of other certificates that signed my server certificate. I haven't found any other connecter that can do this except APR, or I have missed something?

-----Original Message-----
From: Christopher Schultz [mailto:chris@christopherschultz.net] 
Sent: 18 May, 2015 22:11
To: Tomcat Users List
Subject: Re: Problem with APR library - Tomcat 7

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Dejan,

On 5/18/15 3:53 PM, Dejan Stamenov wrote:
> The error below the warning message is saying that the APR library is 
> missing from my server.

Okay.

> That's why I am sure I need the APR library for Tomcat 7.

Well, you can use a different type of connector that *does not* require the APR connector. You *chose* to use the APR connector, and now you need both APR and tcnative to get that to work. I'm asking you about your initial decision: are you sure you need the APR-based connector?

> I have seen Mark message, but had some work and didn't tried it today. 
> Till tomorrow, I will give you answer if that was the case and worked, 
> or I need further help.

Building the APR-based connector on Linux should be very easy. If you have the various packages installed via your package manager, then building tcnative is a typical two-step process to build: "configure", "make".

- -chris

> -----Original Message----- From: Christopher Schultz 
> [mailto:chris@christopherschultz.net] Sent: 18 May, 2015 21:46 To:
>  Tomcat Users List Subject: Re: Problem with APR library - Tomcat
> 7
> 
> Dejan,
> 
> On 5/17/15 3:22 PM, Dejan Stamenov wrote:
>> I am working on a project where I need to install SSL certificates on 
>> Tomcat 7 server for my Java application. I have been experimenting 
>> around, I have set up the connector in the server.xml file, but when 
>> I look into the logs I can see this:
> 
>> http://prntscr.com/76a98v
> 
> Warning-level message. Are you sure you need tcnative?
> 
> The error after the warning is more troubling. What's the full stack 
> trace for /that/?
> 
>> For the connector to be working, I needed to install APR library. I 
>> did so, following this guide here:
>> http://www.techsww.com/tutorials/libraries/apr/installation/installin
g
>
>>
>>
>> 
_apach
> 
> 
> e_portable_runtime_library_on_ubuntu_linux.php
> 
> It's much easier to do "apt-get install libapr" than whatever it is  
> you are doing, here.
> 
>> In my case, I use the apr-1.5.2 version. Also, in the configure 
>> -prefix part I have specified the URL that is shown on my server  
>> error log, i.e. /usr/lib/x86_64-linux-gnu. After server reboot, I 
>> still get the same error. Have been looking around the internet how 
>> to solve this, but only found a couple of open questions on Stack 
>> Overflow/Exchange with no answers in them.
> 
> As Mark says, tcnative is merely APR-based. You need libapr, then you 
> need to build tcnative yourself, from source, from the links he  
> provided .
> 
> I'll ask again: are you sure you need tcnative?
> 
> -chris
> 
> ---------------------------------------------------------------------
>
>
>
> 
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
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVWkdWAAoJEBzwKT+lPKRYLGQQAJuPWAkHAlK4waYaQSLMJ7QQ
Oy4j7mnAzEUn+17keeERyGCJCJIoJ2+CagZXB8frkmOS0M58wlT45rMFuH87VrXt
AzoRVHM/2czT615Ngkbf7KC9Y3oixUyO3gmlM2cLeUT3LOSFoQt7rjOrGu/0G2LI
R/38Fb4Nv+IVwgQKA8Rl0TnJDMMh30rxzJXlQfmSY0UbLUKCsNuFyxsL14M17TY8
95qxlhxPjlffZqTzlF97EX3YXn/0LO3lY4xj9/egR5Eq10mBinCjRhMEe1VdUAg4
lfKag0/yA0ngSozinhxWqnDBbSKl2JXaTaAUa1ESyCV8hvvIwdtAzgdzDWCgpBqP
Xey8Ph7BUTHbhZ2RTZwDJRtBD2PO3E9xZbkQLs2xZruCr6tVdg3eQjpR/e227I45
AQMihdoCCM8K/IFSDuWBN0owRa0aoAsiCEJlMvfixA7H+gGYDlzEj5Idq3uKDGU3
in8Ffyc4yXPjALrvMgOCtALENmJIvxikt/R/E22FvgHADlCxRVaMeWg+yPZZoJpb
G+nZGeRAPwTZC5l49eh+Z0vLKWmRlX0T80G1H36S1n0o8rDMizQNGlDb0MT4uJWf
czC6dpI+pTjEENTv7BvDtsfNsa9Wz0B+P2h0dO6SBMWjnPAlAcexSdD9ua4GkfET
z8XNUo+ksV0zRfwO5w9a
=nW0D
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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: Problem with APR library - Tomcat 7

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Dejan,

On 5/18/15 3:53 PM, Dejan Stamenov wrote:
> The error below the warning message is saying that the APR library 
> is missing from my server.

Okay.

> That's why I am sure I need the APR library for Tomcat 7.

Well, you can use a different type of connector that *does not* require
the APR connector. You *chose* to use the APR connector, and now you
need both APR and tcnative to get that to work. I'm asking you about
your initial decision: are you sure you need the APR-based connector?

> I have seen Mark message, but had some work and didn't tried it 
> today. Till tomorrow, I will give you answer if that was the case
> and worked, or I need further help.

Building the APR-based connector on Linux should be very easy. If you
have the various packages installed via your package manager, then
building tcnative is a typical two-step process to build: "configure",
"make".

- -chris

> -----Original Message----- From: Christopher Schultz 
> [mailto:chris@christopherschultz.net] Sent: 18 May, 2015 21:46 To:
>  Tomcat Users List Subject: Re: Problem with APR library - Tomcat
> 7
> 
> Dejan,
> 
> On 5/17/15 3:22 PM, Dejan Stamenov wrote:
>> I am working on a project where I need to install SSL
>> certificates on Tomcat 7 server for my Java application. I have
>> been experimenting around, I have set up the connector in the 
>> server.xml file, but when I look into the logs I can see this:
> 
>> http://prntscr.com/76a98v
> 
> Warning-level message. Are you sure you need tcnative?
> 
> The error after the warning is more troubling. What's the full
> stack trace for /that/?
> 
>> For the connector to be working, I needed to install APR
>> library. I did so, following this guide here: 
>> http://www.techsww.com/tutorials/libraries/apr/installation/installin
g
>
>>
>>
>> 
_apach
> 
> 
> e_portable_runtime_library_on_ubuntu_linux.php
> 
> It's much easier to do "apt-get install libapr" than whatever it is
>  you are doing, here.
> 
>> In my case, I use the apr-1.5.2 version. Also, in the configure 
>> -prefix part I have specified the URL that is shown on my server
>>  error log, i.e. /usr/lib/x86_64-linux-gnu. After server reboot,
>> I still get the same error. Have been looking around the
>> internet how to solve this, but only found a couple of open
>> questions on Stack Overflow/Exchange with no answers in them.
> 
> As Mark says, tcnative is merely APR-based. You need libapr, then 
> you need to build tcnative yourself, from source, from the links he
>  provided .
> 
> I'll ask again: are you sure you need tcnative?
> 
> -chris
> 
> ---------------------------------------------------------------------
>
>
>
> 
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
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVWkdWAAoJEBzwKT+lPKRYLGQQAJuPWAkHAlK4waYaQSLMJ7QQ
Oy4j7mnAzEUn+17keeERyGCJCJIoJ2+CagZXB8frkmOS0M58wlT45rMFuH87VrXt
AzoRVHM/2czT615Ngkbf7KC9Y3oixUyO3gmlM2cLeUT3LOSFoQt7rjOrGu/0G2LI
R/38Fb4Nv+IVwgQKA8Rl0TnJDMMh30rxzJXlQfmSY0UbLUKCsNuFyxsL14M17TY8
95qxlhxPjlffZqTzlF97EX3YXn/0LO3lY4xj9/egR5Eq10mBinCjRhMEe1VdUAg4
lfKag0/yA0ngSozinhxWqnDBbSKl2JXaTaAUa1ESyCV8hvvIwdtAzgdzDWCgpBqP
Xey8Ph7BUTHbhZ2RTZwDJRtBD2PO3E9xZbkQLs2xZruCr6tVdg3eQjpR/e227I45
AQMihdoCCM8K/IFSDuWBN0owRa0aoAsiCEJlMvfixA7H+gGYDlzEj5Idq3uKDGU3
in8Ffyc4yXPjALrvMgOCtALENmJIvxikt/R/E22FvgHADlCxRVaMeWg+yPZZoJpb
G+nZGeRAPwTZC5l49eh+Z0vLKWmRlX0T80G1H36S1n0o8rDMizQNGlDb0MT4uJWf
czC6dpI+pTjEENTv7BvDtsfNsa9Wz0B+P2h0dO6SBMWjnPAlAcexSdD9ua4GkfET
z8XNUo+ksV0zRfwO5w9a
=nW0D
-----END PGP SIGNATURE-----

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


RE: Problem with APR library - Tomcat 7

Posted by Dejan Stamenov <de...@outlook.com>.
Hello Chris,

The error below the warning message is saying that the APR library is missing from my server. That's why I am sure I need the APR library for Tomcat 7. I have seen Mark message, but had some work and didn't tried it today. Till tomorrow, I will give you answer if that was the case and worked, or I need further help.

-----Original Message-----
From: Christopher Schultz [mailto:chris@christopherschultz.net] 
Sent: 18 May, 2015 21:46
To: Tomcat Users List
Subject: Re: Problem with APR library - Tomcat 7

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Dejan,

On 5/17/15 3:22 PM, Dejan Stamenov wrote:
> I am working on a project where I need to install SSL certificates on 
> Tomcat 7 server for my Java application. I have been experimenting 
> around, I have set up the connector in the server.xml file, but when I 
> look into the logs I can see this:
> 
> http://prntscr.com/76a98v

Warning-level message. Are you sure you need tcnative?

The error after the warning is more troubling. What's the full stack trace for /that/?

> For the connector to be working, I needed to install APR library. I 
> did so, following this guide here:
> http://www.techsww.com/tutorials/libraries/apr/installation/installing
_apach
>
> 
e_portable_runtime_library_on_ubuntu_linux.php

It's much easier to do "apt-get install libapr" than whatever it is you are doing, here.

> In my case, I use the apr-1.5.2 version. Also, in the configure 
> -prefix part I have specified the URL that is shown on my server error 
> log, i.e. /usr/lib/x86_64-linux-gnu. After server reboot, I still get 
> the same error. Have been looking around the internet how to solve 
> this, but only found a couple of open questions on Stack 
> Overflow/Exchange with no answers in them.

As Mark says, tcnative is merely APR-based. You need libapr, then you need to build tcnative yourself, from source, from the links he provided .

I'll ask again: are you sure you need tcnative?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVWkF0AAoJEBzwKT+lPKRYOOYQAI7ZOAd7q5Rzc/ybBqYPIpsp
h6tm7yobGea7+xafTqwscsawZB8nQhmhtismzriqmAgWYk1Y+NzmFGkWZmR24wLn
O+ThtqKY6gSDwTWXNpMEeRSkNccO1Mi5pW5hYURvkjxhPxriEbWpO38nqVDxlFzX
EoRoLmVo72Ccl/z835tWISlhSf34TS4SdEY6Kh0Np/zbOOSTLOa65f1KlqfbXX0w
LgHREmtKKyUu2TmCWTGX0GH31PI7LnXOkLlbwRtrtb5d6RANdiaN5PuHIJH2Ka2q
ktg+YaVuqqVrZepu4QhfPidk6knzh3ePkoFWHqWIG5W8Ze22YrZkDRU4zn1IIL00
dxTNtPpZ1tgM1DSy2Sfhr4JW7EOex1qNwTAAWWWnUqKvaoeEkIlGiWWTrP4RGOAM
PtEzZHrc5s/nh2cSy/DpO8a2AGylib5jqmByGp91WOkFu9CQeBqDBZ0FvELsco5T
MKFo4DURyA0IWfG6xwjRmOIDVMB1h4/9BOm+1g9jrWveVZzd+KWbWVhu5iG8gOhf
hamx0Uc672H/sVyw8hXfo+YinNcKFGf94o/GUTGefl4ZKbzOE5Ycwq1b1EVCVRyp
sMNW4fdc6XSKMlzBb4DBxtWgnoiI5e+ElomJfGZSiKIYw6SpyDbZQHDn0yMi24Vn
pB3XSPYn9fMJ/xf8u8MH
=AjpR
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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: Problem with APR library - Tomcat 7

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Dejan,

On 5/17/15 3:22 PM, Dejan Stamenov wrote:
> I am working on a project where I need to install SSL certificates
> on Tomcat 7 server for my Java application. I have been
> experimenting around, I have set up the connector in the server.xml
> file, but when I look into the logs I can see this:
> 
> http://prntscr.com/76a98v

Warning-level message. Are you sure you need tcnative?

The error after the warning is more troubling. What's the full stack
trace for /that/?

> For the connector to be working, I needed to install APR library. I
> did so, following this guide here: 
> http://www.techsww.com/tutorials/libraries/apr/installation/installing
_apach
>
> 
e_portable_runtime_library_on_ubuntu_linux.php

It's much easier to do "apt-get install libapr" than whatever it is
you are doing, here.

> In my case, I use the apr-1.5.2 version. Also, in the configure
> -prefix part I have specified the URL that is shown on my server
> error log, i.e. /usr/lib/x86_64-linux-gnu. After server reboot, I
> still get the same error. Have been looking around the internet how
> to solve this, but only found a couple of open questions on Stack
> Overflow/Exchange with no answers in them.

As Mark says, tcnative is merely APR-based. You need libapr, then you
need to build tcnative yourself, from source, from the links he provided
.

I'll ask again: are you sure you need tcnative?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVWkF0AAoJEBzwKT+lPKRYOOYQAI7ZOAd7q5Rzc/ybBqYPIpsp
h6tm7yobGea7+xafTqwscsawZB8nQhmhtismzriqmAgWYk1Y+NzmFGkWZmR24wLn
O+ThtqKY6gSDwTWXNpMEeRSkNccO1Mi5pW5hYURvkjxhPxriEbWpO38nqVDxlFzX
EoRoLmVo72Ccl/z835tWISlhSf34TS4SdEY6Kh0Np/zbOOSTLOa65f1KlqfbXX0w
LgHREmtKKyUu2TmCWTGX0GH31PI7LnXOkLlbwRtrtb5d6RANdiaN5PuHIJH2Ka2q
ktg+YaVuqqVrZepu4QhfPidk6knzh3ePkoFWHqWIG5W8Ze22YrZkDRU4zn1IIL00
dxTNtPpZ1tgM1DSy2Sfhr4JW7EOex1qNwTAAWWWnUqKvaoeEkIlGiWWTrP4RGOAM
PtEzZHrc5s/nh2cSy/DpO8a2AGylib5jqmByGp91WOkFu9CQeBqDBZ0FvELsco5T
MKFo4DURyA0IWfG6xwjRmOIDVMB1h4/9BOm+1g9jrWveVZzd+KWbWVhu5iG8gOhf
hamx0Uc672H/sVyw8hXfo+YinNcKFGf94o/GUTGefl4ZKbzOE5Ycwq1b1EVCVRyp
sMNW4fdc6XSKMlzBb4DBxtWgnoiI5e+ElomJfGZSiKIYw6SpyDbZQHDn0yMi24Vn
pB3XSPYn9fMJ/xf8u8MH
=AjpR
-----END PGP SIGNATURE-----

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