Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Update paths

This page describes the process for building the isapi_redirectorredirect.dll (mod_jk) for Windows. This is the native plug-in for IIS that provides broadly the same functionality as mod_jk does for httpd.

These instructions assume that you have configured the common build environment.  

Building

While tcnative itself needs to be built last, we unpack it first because there are some patches in the tcnative source distribution that will need to be applied to both APR and OpenSSLThe isapi_redirector.dll requires no other external dependencies (it does depend on PCRE but this is included in the source). Obtain the tcnative source from one of:

E.g.: To build the latest 1.2.x development build from trunk

Obtain the source code:

 c:
 cd \
 svngit coclone https://svngithub.com/apache.org/repos/asf/tomcat/native/trunk/tomcat-connectors tomcat-nativejk-1.2.x
 cd tomcat-nativejk-1.2.x\native\srclib\apriis

 

Unpack APR 1.5.2 source distribution in this directory (C:\tomcat-native-1.2.x\native\srclib\apr).    

...


Build  isapi_redirector.dll:

 c:\cmsc\setenv.bat /x86  
nmake -f NMAKEmakefile BUILD_CPU=x86 APR_DECLARE_STATIC=1Makefile.vc    c c:\cmsc\setenv.bat /x64  nmake nmake -f NMAKEmakefile BUILD_CPU=x64 APR_DECLARE_STATIC=1    cd ..\openssl

...

Makefile.vc


Tomcat isapi_redirect DLLs may then be found in C:\tomcat-

...

jk-1.2.x\native\

...

Apply openssl-msvcrt.patch    

 c:\cmsc\setenv.bat /x86
 perl Configure VC-WIN32
 ms\do_nasm
 nmake -f ms\nt.mak
 move out32 out32-x86
 
 c:\cmsc\setenv.bat /x64
 perl Configure VC-WIN64A
 ms\do_win64a
 nmake -f ms\nt.mak clean
 nmake -f ms\nt.mak
 move out32 out32-x64

 

Keeping the various libraries in versioned directories saves having to rebuild them next time if the version remains unchanged.    

 cd ..
 set OPENSSL_VER=1.0.2g
set APR_VER=1.5.2
 
 mkdir \deps-x86\apr-%APR_VER%\include
 mkdir \deps-x86\apr-%APR_VER%\lib
 mkdir \deps-x86\openssl-%OPENSSL_VER%\include
 mkdir \deps-x86\openssl-%OPENSSL_VER%\lib
 xcopy /E \deps-x86 \deps-x64\
 
   
 xcopy /E apr\include \deps-x86\apr-%APR_VER%\include\
 xcopy /E apr\include \deps-x64\apr-%APR_VER%\include\
 
 copy apr\WINXP_X86_LIB_RELEASE\apr-1.lib \deps-x86\apr-%APR_VER%\lib
 copy apr\WINXP_X64_LIB_RELEASE\apr-1.lib \deps-x64\apr-%APR_VER%\lib
 
 xcopy /E openssl\inc32 \deps-x86\openssl-%OPENSSL_VER%\include\
 xcopy /E openssl\inc32 \deps-x64\openssl-%OPENSSL_VER%\include\
 
 copy openssl\out32-x86\*.lib \deps-x86\openssl-%OPENSSL_VER%\lib\
 copy openssl\out32-x64\*.lib \deps-x64\openssl-%OPENSSL_VER%\lib\
 
 copy openssl\out32-x86\openssl.exe \deps-x86\openssl-%OPENSSL_VER%\
 copy openssl\out32-x64\openssl.exe \deps-x64\openssl-%OPENSSL_VER%\
 
 cd ..
 SET JAVA_HOME=C:\Program Files\Java\jdk1.7.0_71
 
 c:\cmsc\setenv.bat /x86
 nmake -f NMAKEMakefile WITH_APR=C:\deps-x86\apr-%APR_VER% WITH_OPENSSL=C:\deps-x86\openssl-%OPENSSL_VER% APR_DECLARE_STATIC=1 ENABLE_OCSP=1
 move WINXP_X86_DLL_RELEASE WINXP_X86_OCSP_DLL_RELEASE
 nmake -f NMAKEMakefile WITH_APR=C:\deps-x86\apr-%APR_VER% WITH_OPENSSL=C:\deps-x86\openssl-%OPENSSL_VER% APR_DECLARE_STATIC=1
 
 c:\cmsc\setenv.bat /x64
 nmake -f NMAKEMakefile WITH_APR=C:\deps-x64\apr-%APR_VER% WITH_OPENSSL=C:\deps-x64\openssl-%OPENSSL_VER% APR_DECLARE_STATIC=1 ENABLE_OCSP=1
 move WINXP_X64_DLL_RELEASE WINXP_X64_OCSP_DLL_RELEASE
 nmake -f NMAKEMakefile WITH_APR=C:\deps-x64\apr-%APR_VER% WITH_OPENSSL=C:\deps-x64\openssl-%OPENSSL_VER% APR_DECLARE_STATIC=1

 

Tomcat Native Connector DLLs may then be found in C:\tomcat-native-1.2.x\native\WINXP_*_[OCSP_]DLL_RELEASE    

Construct the binary distributions    

...

iis\[x86|x64]_RELEASE

Construct the binary distributions    

 set VER=1.2.43
 mkdir tomcat-connectors-%VER%-windows-i386-iis
 copy ..\..\LICENSE tomcat-connectors-%VER%-windows-i386-iis\
 copy ..\..\NOTICE tomcat-connectors-%VER%-windows-i386-iis\
 copy README tomcat-connectors-%VER%-windows-i386-iis\
copy x86_RELEASE\isapi_redirect.dll tomcat-connectors-%VER%-windows-i386-iis\
 mkdir tomcat-connectors-%VER%-windows-x86_64-iis
 
copy ..\..\LICENSE tomcat-connectors-%VER%-windows-x86_64-iis\  copy ..\..\NOTICE tomcat-connectors-%VER%-windows-x86_64-iis\  copy README tomcat-connectors-%VER%-windows-x86_64-iis\
copy x64_RELEASE\isapi_redirect.dll tomcat-connectors-%VER%-windows-x86_64-iis\
 mkdir tomcat-connectors-%VER%-windows-i386-symbols
 copy ..\..\LICENSE tomcat-connectors-%VER%-windows-i386-symbols
copy ..\..\NOTICE tomcat-connectors-%VER%-windows-i386-symbols
copy x86_RELEASE\isapi_redirect.pdb tomcat-connectors-%VER%-windows-i386-symbols\
 mkdir tomcat-connectors-%VER%-windows-x86_64-symbols
 copy ..\..\LICENSE tomcat-connectors-%VER%-windows-x86_64-symbols
copy ..\..\NOTICE tomcat-connectors-%VER%-windows-x86_64-symbols
copy x64_RELEASE\isapi_redirect.pdb tomcat-connectors-%VER%-windows-x86_64-symbols\
 SET JAVA_HOME=C:\Java\adopt-8.0.242.09-x64
 set PATH=%PATH%;%JAVA_HOME%\bin
 cd tomcat-connectors-%VER%-windows-i386-iis
 jar -cMf ..\tomcat-connectors-%VER%-windows-i386-iis.zip *
 cd ..\tomcat-connectors-%VER%-windows-x86_64-iis
 jar -cMf ..\tomcat-connectors-%VER%-windows-x86_64-iis.zip *
 cd ..\tomcat-connectors-%VER%-windows-i386-symbols
 jar -cMf ..\tomcat-

...

connectors-%VER%-windows-

...

i386-

...

symbols.zip *

...


cd ..\tomcat-

...

connectors-%VER%-

...

windows-

...

x86_64-symbols
jar -cMf ..\tomcat-

...

connectors-%VER%-

...

windows-

...

x86_64-

...

symbols.zip *

...


The Windows binary distributions may then be found in C:\tomcat-nativejk-1.2.x\native\    iis

These need to be signed and hashed before uploading for the release vote.    

Beware of typos in the name and contents of hash files for OCSP binaries ("ocsp" vs "oscp"). Such typos happened.    

A correct example:    

tomcat-native-1.1.32-ocsp-win32-bin.zip.md5    

...

.

...

tomcat-native-1.1.32-ocsp-win32-bin.zip.sha1    

...

 

...