-
Notifications
You must be signed in to change notification settings - Fork 1.7k
chore: update Windows build to use PCRE2 as default #3491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v2/master
Are you sure you want to change the base?
Changes from 26 commits
d925bdc
d1b1956
b0dd255
e9c84a6
a4a5a5b
a3fb241
9b87f0f
394f3b7
7f07ffd
b495486
906eae5
2268276
6334d28
5aa007e
6d36425
191c51c
ef44728
932c83b
cf619f9
2fbcd90
0f5e0a1
ba624f3
4c52436
360691b
de2564f
76323ea
db46478
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,37 +8,41 @@ by Tom Donovam, 4/2/2011 | |||||
|
|
||||||
| Dependency | Tested with | Note | ||||||
| ----|------|---- | ||||||
| Microsoft Visual Studio C++ | Visual Studio 2013 (aka VC12) | | ||||||
| [CMake build system](http://www.cmake.org/) | CMake v3.8.2 | | ||||||
| [Apache 2.4.x](http://httpd.apache.org/) | Apache 2.4.27 | Apache must be built from source using the same Visual Studio compiler as mod_security. | ||||||
| [PCRE, Perl Compatible Regular Expression library](http://www.pcre.org/) | PCRE v8.40 | ||||||
| [LibXML2](http://xmlsoft.org/) | LibXML2 v2.9.4 | | ||||||
| [Lua Scripting Language](http://www.lua.org/) | Lua v5.3.4 | ||||||
| [cURL multiprotocol file transfer library](http://curl.haxx.se/) | cURL v7.54.0 | ||||||
| Microsoft Visual Studio C++ | Visual Studio 2019 (aka VS16) | | ||||||
| [CMake build system](http://www.cmake.org/) | CMake v4.2.3 | | ||||||
| [Apache 2.4.x](http://httpd.apache.org/) | Apache 2.4.66 | Apache must be built from source using the same Visual Studio compiler as mod_security. | ||||||
| [PCRE2, Perl Compatible Regular Expression library](https://www.pcre.org/) | PCRE2 v10.47 | ModSecurity v2 now uses PCRE2 by default (not legacy PCRE) | ||||||
| [LibXML2](http://xmlsoft.org/) | LibXML2 v2.15.1 | | ||||||
| [Lua Scripting Language](http://www.lua.org/) | Lua v5.4.8 | ||||||
| [cURL multiprotocol file transfer library](http://curl.haxx.se/) | cURL v8.18.0 | ||||||
| [zlib compression library](https://zlib.net/) | zlib v1.3.1 | ||||||
|
|
||||||
|
|
||||||
| ## Before building | ||||||
|
|
||||||
| The directory where you build software from source ( ``C:\work`` in this exmaple) | ||||||
| must contain the Apache source you used to build the Apache web serverand the mod_security source | ||||||
| The directory where you build software from source ( ``C:\work`` in this example) | ||||||
| must contain the Apache source you used to build the Apache web server and the mod_security source | ||||||
|
|
||||||
fzipi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| Apache source is in C:\work\httpd-2.4.27 in this example. | ||||||
| Apache has been installed to C:\Apache2427 in this example. | ||||||
| Apache source is in C:\work\httpd-2.4.66 in this example. | ||||||
| Apache has been installed to C:\Apache2466 in this example. | ||||||
| Mod_security source is in C:\work\mod_security in this example. | ||||||
|
|
||||||
| ## Download and untar the prerequisite library sources: | ||||||
|
|
||||||
| Download pcre-8.40.tar.gz from ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ | ||||||
| untar it into C:\work\ creating C:\work\pcre-8.40 | ||||||
| Download pcre2-10.47.zip from https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.47/ | ||||||
| unzip it into C:\work\ creating C:\work\pcre2-10.47 | ||||||
|
|
||||||
| Download libxml2-2.9.4.tar.gz from ftp://xmlsoft.org/libxml2/ | ||||||
| untar it into C:\work\ creating C:\work\libxml2-2.9.4 | ||||||
| Download libxml2-2.15.1.tar.gz from https://download.gnome.org/sources/libxml2/2.15/ | ||||||
| untar it into C:\work\ creating C:\work\libxml2-2.15.1 | ||||||
|
|
||||||
| Download lua-5.3.4.tar.gz from http://www.lua.org/ftp/ | ||||||
| untar it into C:\work\ creating C:\work\lua-5.3.4 | ||||||
| Download lua-5.4.8.tar.gz from http://www.lua.org/ftp/ | ||||||
| untar it into C:\work\ creating C:\work\lua-5.4.8 | ||||||
|
|
||||||
| Download curl-7.54.0.tar.gz from http://curl.haxx.se/download.html | ||||||
| untar it into C:\work\ creating C:\work\curl-7.54.0 | ||||||
| Download curl-8.18.0.zip from https://curl.se/download/ | ||||||
| unzip it into C:\work\ creating C:\work\curl-8.18.0 | ||||||
|
|
||||||
| Download zlib-1.3.1.tar.gz from https://github.com/madler/zlib/releases/download/v1.3.1/ | ||||||
| untar it into C:\work\ creating C:\work\zlib-1.3.1 | ||||||
|
|
||||||
| ## Setup your build environment: | ||||||
|
|
||||||
|
|
@@ -49,7 +53,7 @@ must contain the Apache source you used to build the Apache web serverand the mo | |||||
| 3. Set an environment variable to the Apache source code directory: | ||||||
|
|
||||||
| ``` | ||||||
| SET HTTPD_BUILD=C:\work\httpd-2.4.27 | ||||||
| SET HTTPD_BUILD=C:\work\httpd-2.4.66 | ||||||
| ``` | ||||||
|
|
||||||
| ### Optional: | ||||||
|
|
@@ -71,54 +75,58 @@ If OpenSSL and zlib support were included when you built Apache 2.4, and you wan | |||||
|
|
||||||
| ## Build | ||||||
|
|
||||||
| ### PCRE-8.40 | ||||||
| ### PCRE2-10.47 | ||||||
|
|
||||||
| CD C:\work\pcre-8.40 | ||||||
| CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=True | ||||||
| CD C:\work\pcre2-10.47 | ||||||
| CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=True -DPCRE2_BUILD_PCRE2_8=ON -DPCRE2_SUPPORT_JIT=ON | ||||||
| NMAKE | ||||||
|
|
||||||
| ### LibXML2-2.9.4 | ||||||
| Note: PCRE2 with JIT support provides better performance and fixes stack overflow issues present in older PCRE versions. | ||||||
|
|
||||||
| ### LibXML2-2.15.1 | ||||||
|
|
||||||
| CD C:\work\libxml2-2.9.4\win32 | ||||||
| CD C:\work\libxml2-2.15.1\win32 | ||||||
| CSCRIPT configure.js iconv=no vcmanifest=yes zlib=yes | ||||||
| NMAKE -f Makefile.msvc | ||||||
|
|
||||||
| ### Lua-5.3.4 | ||||||
| ### Lua-5.4.8 | ||||||
|
|
||||||
| CD C:\work\lua-5.3.4\src | ||||||
| CD C:\work\lua-5.4.8\src | ||||||
| CL /Ox /arch:SSE2 /GF /GL /Gy /FD /EHsc /MD /Zi /TC /wd4005 /D "_MBCS" /D "LUA_CORE" /D "LUA_BUILD_AS_DLL" /D "_CRT_SECURE_NO_WARNINGS" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_WIN32" /D "_WINDLL" /c *.c | ||||||
| DEL lua.obj luac.obj | ||||||
| LINK /DLL /LTCG /DEBUG /OUT:lua5.1.dll *.obj | ||||||
| IF EXIST lua5.1.dll.manifest MT -manifest lua5.1.dll.manifest -outputresource:lua5.1.dll;2 | ||||||
| LINK /DLL /LTCG /DEBUG /OUT:lua54.dll *.obj | ||||||
| IF EXIST lua54.dll.manifest MT -manifest lua54.dll.manifest -outputresource:lua54.dll;2 | ||||||
|
|
||||||
| ### cURL-7.54.0 | ||||||
| ### cURL-8.18.0 | ||||||
|
|
||||||
| CD C:\work\curl-7.54.0 | ||||||
| CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=True -DCURL_ZLIB=True | ||||||
| NMAKE | ||||||
| CD C:\work\curl-8.18.0\winbuild | ||||||
| SET ARCH=x64 | ||||||
| NMAKE /f Makefile.vc mode=dll ENABLE_WINSSL=yes MACHINE=%ARCH% WITH_ZLIB=dll | ||||||
|
|
||||||
| ### ModSecurity-2.9.x | ||||||
|
|
||||||
| CD C:\work\mod_security\apache2 | ||||||
| NMAKE -f Makefile.win APACHE=C:\Apache2427 PCRE=C:\work\pcre-8.40 LIBXML2=C:\work\libxml2-2.9.4 LUA=C:\work\lua-5.3.4\src | ||||||
| NMAKE -f Makefile.win APACHE=C:\Apache2466 PCRE=C:\work\pcre2-10.47 LIBXML2=C:\work\libxml2-2.15.1 LUA=C:\work\lua-5.4.8\src CURL=C:\work\curl-8.18.0 | ||||||
|
|
||||||
| ## Install ModSecurity and run Apache | ||||||
|
|
||||||
| Copy these five files to ``C:\Apache2427\bin``: | ||||||
| Copy these files to ``C:\Apache2466\bin``: | ||||||
|
|
||||||
| C:\work\pcre-8.40\pcre.dll C:\Apache2427\bin\ | ||||||
| C:\work\lua-5.3.4\src\lua5.1.dll C:\Apache2427\bin\ | ||||||
| C:\work\libxml2-2.9.4\win32\bin.msvc\libxml2.dll C:\Apache2427\bin\ | ||||||
| C:\work\curl-7.54.0\libcurl.dll C:\Apache2427\bin\ | ||||||
| C:\work\mod_security\apache2\mlogc-src\mlogc.exe | ||||||
| C:\work\pcre2-10.47\pcre2-8.dll C:\Apache2466\bin\ | ||||||
| C:\work\lua-5.4.8\src\lua54.dll C:\Apache2466\bin\ | ||||||
| C:\work\libxml2-2.15.1\win32\bin.msvc\libxml2.dll C:\Apache2466\bin\ | ||||||
| C:\work\curl-8.18.0\builds\libcurl-vc-x64-release-dll-zlib-dll-ipv6-sspi-schannel-obj-lib\libcurl.dll C:\Apache2466\bin\ | ||||||
| C:\work\mod_security\apache2\mlogc-src\mlogc.exe C:\Apache2466\bin\ | ||||||
|
||||||
| C:\work\mod_security\apache2\mlogc-src\mlogc.exe C:\Apache2466\bin\ | |
| C:\work\mod_security\mlogc\mlogc.exe C:\Apache2466\bin\ |
Uh oh!
There was an error while loading. Please reload this page.