1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE document [
<!ENTITY project SYSTEM "project.xml">
]>
<document url="index.html">
&project;
<properties>
<author email="jfclere@apache.org">Jean-Frederic Clere</author>
<title>Documentation Index</title>
</properties>
<body>
<section name="Introduction">
<p>
The Apache Tomcat Native Library is an optional component for use with
Apache Tomcat that allows Tomcat to use certain native resources
for performance, compatibility, etc.
</p>
<p>
Specifically, the Apache Tomcat Native Library gives Tomcat access to
the Apache Portable Runtime (APR) library's network connection (socket)
implementation and random-number generator.
See the Apache Tomcat documentation for more information on how to
configure Tomcat to use the APR connector.
</p>
<p>
Features of the APR connector:
</p>
<ul>
<li>Non-blocking I/O for Keep-Alive requests (between requests)</li>
<li>Uses OpenSSL for TLS/SSL capabilities (if supported by linked APR library)</li>
<li>FIPS 140-2 support for TLS/SSL (if supported by linked OpenSSL library)</li>
<li>Support for IPv4, IPv6 and Unix Domain Sockets</li>
</ul>
</section>
<section name="Headlines">
<ul>
<li><a href="news/2026.html#20260211">11 February 2026 - <b>Tomcat-Native-1.3.6
released</b></a>
<p>The Apache Tomcat team is proud to announce the immediate availability of
Tomcat Native 1.3.6 Stable.</p>
<p>
The sources and the binaries for selected platforms are available from the
<a href="../download-native.cgi">Download page</a>.
</p>
<p>
Please see the <a href="miscellaneous/changelog.html">Changelog</a> for a full
list of changes.
</p>
<p>
Note: End of support for Tomcat Native 1.3.x has been announced as 31 March
2027.
</p>
</li>
</ul>
</section>
<section name="Building">
<subsection name="Requirements">
<p>
Build tc-native requires three components to be installed:
</p>
<ul>
<li>APR library</li>
<li>OpenSSL libraries</li>
<li>Java SE Development Kit (JDK)</li>
</ul>
<p>
In debian based Linux those dependencies could be installed by something like:
</p>
<source>apt-get install libapr1.0-dev libssl-dev</source>
<p>
In rpm based Linux those dependencies could be installed by something like:
</p>
<source>yum install apr-devel openssl-devel</source>
</subsection>
<subsection name="UNIX">
<p>
On all the POSIX systems (Linux, Solaris, HP-UX, AIX etc...) a well-known
configure and make is used to build tc-native.<br/>
In the jni/native runs:
</p>
<source>./configure --help</source>
<p>to read the description of all the parameters.</p>
<source
>./configure --with-apr=$HOME/APR \
--with-java-home=$JAVA_HOME \
--with-ssl=$HOME/OPENSSL \
--prefix=$CATALINA_HOME</source>
<p>
to create the includes and makefiles to be able to build tc-native.<br/>
Where:<br/>
<code>$HOME/APR</code> is something like /usr/bin/apr-1-config or the path where apr is
installed.<br/>
<code>$JAVA_HOME</code> is something /home/jfclere/JAVA/jdk1.7.0_80 path to a JDK
installation. Any JDK should work but it is advisable to use the same
JVM version the JVM you use with Tomcat.<br/>
<code>$HOME/OPENSSL</code> is the path where OpenSSL is installed.<br/>
<code>$CATALINA_HOME</code> is the path where the produced libraries will be
installed. Something like $HOME/apache-tomcat-8.0.47/<br/>
<br/>
The configure is able to guess most of OpenSSL standard installations.
So most of the time the following will be enough:
</p>
<source
>./configure --with-apr=/usr/bin/apr-1-config \
--with-java-home=/home/jfclere/JAVA/jdk1.7.0_80/ \
--with-ssl=yes \
--prefix=$CATALINA_HOME</source>
<p>
To build the libraries and install them:
</p>
<source>make && make install</source>
<p>
The libraries will be found in $CATALINA_HOME/lib
</p>
</subsection>
<subsection name="Windows">
<p>
Download the Windows sources of tc-native and extract them.
</p>
<p>
Obtain the Windows sources for
<a href="http://apr.apache.org/download.cgi">APR</a> and
<a href="https://www.openssl.org/source/">OpenSSL</a>. Apply the patches from
native/srclib and build APR and OpenSSL for your platform (X86 or X64).
</p>
<p>
Build with <source
>nmake -f NMAKEMakefile WITH_APR=... WITH_OPENSSL=... APR_DECLARE_STATIC=1</source>
</p>
<p>
More detailed instructions including the steps to create a standard release
distribution are provided on the <a
href="https://cwiki.apache.org/confluence/display/TOMCAT/Building+the+Tomcat+Native+Connector+binaries+for+Windows">Wiki</a>.
</p>
</subsection>
</section>
<section name="Install and tests">
<subsection name="Configuring Tomcat">
<p>
Apache Tomcat comes with the <code>AprLifecycleListener</code> enabled
by default. Still, you should check your <code>conf/server.xml</code>
to ensure that something like the following is present, and uncommented:
</p>
<source wrapped="true"
><![CDATA[<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />]]></source>
<p>
Please see the Apache Tomcat documentation for configuration specifics.
</p>
<p>
When using Unix Domain Sockets a cleanup is registered to delete the
socket on destruction of the socket, or shutdown of the application.
Should the application terminate abnormally, the socket deletion will
need to be handled by the caller or by the administrator.
</p>
</subsection>
<subsection name="UNIX">
<p>
Edit $CATALINA_HOME/bin/setenv.sh (creating the file if necessary) and add
the path to the tc-native libraries to LD_LIBRARY_PATH. Something like:
</p>
<source>LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CATALINA_HOME/lib
export LD_LIBRARY_PATH</source>
<p>
Start tomcat and check for the messages like this ones:
</p>
<source wrapped="true"
>Nov 29, 2020 12:27:41 PM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.x.y.
Nov 29, 2020 12:27:41 PM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true], UDS [true].
Nov 29, 2020 12:27:41 PM org.apache.coyote.http11.Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080</source>
<p>
Refer to the tomcat documentation to configure the connectors (See
<a href="http://tomcat.apache.org/tomcat-11.0-doc/apr.html">Tomcat 11.0.x</a>,
<a href="http://tomcat.apache.org/tomcat-10.1-doc/apr.html">Tomcat 10.1.x</a> and
<a href="http://tomcat.apache.org/tomcat-9.0-doc/apr.html">Tomcat 9.0.x</a>)
</p>
</subsection>
<subsection name="Windows">
<p>
Edit $CATALINA_BASE\bin\setenv.bat (creating the file if necessary) and add
the path to the tc-native libraries, apr and OpenSSL to PATH. For example:
</p>
<source wrapped="true"
>set PATH=%PATH;C:\cygwin\home\support\tomcat-native-current-win32-src\jni\native\Debug;C:\cygwin\home\support\tomcat-native-current-win32-src\jni\apr\Debug;C:\OpenSSL\lib\VC</source>
<p>
Start tomcat and check for the messages like this ones:
</p>
<source wrapped="true"
>Nov 29, 2020 2:48:17 PM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.x.y.
Nov 29, 2020 2:48:17 PM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [false], sendfile [true], accept filters [false], random [true], UDS [false].
Nov 29, 2020 2:48:18 PM org.apache.coyote.http11.Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080</source>
</subsection>
</section>
</body>
</document>
|