Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Building Tomcat from source on MacOS can require some additional work, especially if you want to build all of the optional items such as libtcnative.==

Building Tomcat

...

Building Tomcat itself is fairly straightforward. Simply download the source distribution of Tomcat and follow the indtructions instructions in the BUILDING.txt file bundled with the distribution.

...

  1. Xcode command-line tools, available from Apple's developer tools download site. Make sure you get the proper version for your XCode version (if you have XCode already installed) and your OS version (10.x)
  2. Wiki Markup

    Apache

    Portal

    Runtime

    (APR),

    available

    either

    directly

    from

    Apache

    (

    [

    APR

    downloads

    |https://apr.apache.org/download.cgi]

    )

    or

    by

    using

    [

    https://brew.sh/

    |brew]

    (

    {{

    brew

    install

    apr

    }}

    )


    1.

    (Optional)

    OpenSSL

    1.1.1

    (latest

    at

    the

    time

    of

    this

    writing),

    available

    either

    directly

    from

    OpenSSL

    (

    [|

    OpenSSL

    Downloads

    ]

    )

    or

    by

    using

    [

    brew

    |]

    ({{{brew

    install

    openssl1

Download and unpack the libtcnative sources:

...

Next, copy the APR libraries:

No Format
 $ cp -a$aR $APR_HOME/libexec/lib/* apache-tomcat-x.y.z-src/output/build/bin/

Finally, if you are using a custom OpenSSL build, copy those libraries as well:

No Format
 $ cp -a$aR $OPENSSL_HOME/lib/* apache-tomcat-x.y.z-src/output/build/bin/

Running Tomcat with libtcnative

Tomcat (really Java) needs to know where to find these native libraries. We do that by setting the java.library.path environment variable for the JVM during startup. The easiest way to do this is by setting CATALINA_OPTS on startup. This can be done by adding this line to bin/setenv.sh:

export CATALINA_OPTS="-Djava.library.path=$CATALINA_HOME/bin"

Then you can startup Tomcat as usual, either:

$ bin/startup.sh

or

$ bin/catalina.sh start