Tag Archives: centos

Build mod_jk for centos

This post https://www.centos.org/modules/newbb/viewtopic.php?topic_id=33416 tells you everything you need to know. I’ve reduced it to a script:

#!/bin/bash
# Build the mod_jk apache tomcat connector from src tarball and install it
#
set -x
srcball=$1
if [ -z "$srcball" ]; then
    echo The source tarball was not given - expected something like \"tomcat-connectors-versionxxx-src\" to be passed as parameter
    exit 1
fi

pushd /tmp
    curl http://mirror.rmg.io/apache//tomcat/tomcat-connectors/jk/$srcball.tar.gz -O

    if [ ! -f /tmp/$srcball.tar.gz ]
    then
      echo $srcball.tar.gz not found in /tmp/. Couldn\'t build mod_jk
      exit 2 
    fi

    tar xvf $srcball.tar.gz
    cd $srcball/native
    ./configure --with-apxs=/usr/sbin/apxs
    make
    cp ./apache-2.0/mod_jk.so /etc/httpd/modules/
popd