@@ -8,37 +8,37 @@ by Tom Donovam, 4/2/2011
8
8
9
9
Dependency | Tested with | Note
10
10
----|------|----
11
- Microsoft Visual Studio C++ | Visual Studio 2008 (aka VC9 ) |
12
- [ CMake build system] ( http://www.cmake.org/ ) | CMake v2 .8.0 |
13
- [ Apache 2.2 .x] ( http://httpd.apache.org/ ) | Apache 2.2.17 | Apache must be built from source using the same Visual Studio compiler as mod_security.
14
- [ PCRE, Perl Compatible Regular Expression library] ( http://www.pcre.org/ ) | PCRE v8.12
15
- [ LibXML2] ( http://xmlsoft.org/ ) | LibXML2 v2.7.7 | Note that LibXML2 v2.7.8 does not build correctly for Windows
16
- [ Lua Scripting Language] ( http://www.lua.org/ ) | Lua v5.1 .4
17
- [ cURL multiprotocol file transfer library] ( http://curl.haxx.se/ ) | cURL v7.21.4
11
+ Microsoft Visual Studio C++ | Visual Studio 2013 (aka VC12 ) |
12
+ [ CMake build system] ( http://www.cmake.org/ ) | CMake v3 .8.2 |
13
+ [ 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.
14
+ [ PCRE, Perl Compatible Regular Expression library] ( http://www.pcre.org/ ) | PCRE v8.40
15
+ [ LibXML2] ( http://xmlsoft.org/ ) | LibXML2 v2.9.4 |
16
+ [ Lua Scripting Language] ( http://www.lua.org/ ) | Lua v5.3 .4
17
+ [ cURL multiprotocol file transfer library] ( http://curl.haxx.se/ ) | cURL v7.54.0
18
18
19
19
20
20
## Before building
21
21
22
22
The directory where you build software from source ( `` C:\work `` in this exmaple)
23
23
must contain the Apache source you used to build the Apache web serverand the mod_security source
24
24
25
- Apache source is in C:\work\httpd-2.2.17 in this example.
26
- Apache has been installed to C:\Apache2217 in this example.
25
+ Apache source is in C:\work\httpd-2.4.27 in this example.
26
+ Apache has been installed to C:\Apache2427 in this example.
27
27
Mod_security source is in C:\work\mod_security in this example.
28
28
29
29
## Download and untar the prerequisite library sources:
30
30
31
- Download pcre-8.12 .tar.gz from ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
32
- untar it into C:\work\ creating C:\work\pcre-8.12
31
+ Download pcre-8.40 .tar.gz from ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
32
+ untar it into C:\work\ creating C:\work\pcre-8.40
33
33
34
- Download libxml2-2.7.7 .tar.gz from ftp://xmlsoft.org/libxml2/
35
- untar it into C:\work\ creating C:\work\libxml2-2.7.7
34
+ Download libxml2-2.9.4 .tar.gz from ftp://xmlsoft.org/libxml2/
35
+ untar it into C:\work\ creating C:\work\libxml2-2.9.4
36
36
37
- Download lua-5.1 .4.tar.gz from http://www.lua.org/ftp/
38
- untar it into C:\work\ creating C:\work\lua-5.1 .4
37
+ Download lua-5.3 .4.tar.gz from http://www.lua.org/ftp/
38
+ untar it into C:\work\ creating C:\work\lua-5.3 .4
39
39
40
- Download curl-7.21.4 .tar.gz from http://curl.haxx.se/download.html
41
- untar it into C:\work\ creating C:\work\curl-7.21.4
40
+ Download curl-7.54.0 .tar.gz from http://curl.haxx.se/download.html
41
+ untar it into C:\work\ creating C:\work\curl-7.54.0
42
42
43
43
## Setup your build environment:
44
44
@@ -49,12 +49,12 @@ must contain the Apache source you used to build the Apache web serverand the mo
49
49
3 . Set an environment variable to the Apache source code directory:
50
50
51
51
```
52
- SET HTTPD_BUILD=C:\work\httpd-2.2.17
52
+ SET HTTPD_BUILD=C:\work\httpd-2.4.27
53
53
```
54
54
55
55
### Optional:
56
56
57
- If OpenSSL and zlib support were included when you built Apache 2.2 , and you want them available to LibXML2 and cURL
57
+ If OpenSSL and zlib support were included when you built Apache 2.4 , and you want them available to LibXML2 and cURL
58
58
59
59
1 . Ensure that cURL and LibXML2 can find the OpenSSL and zlib includes and libraries that Apache was built with.
60
60
@@ -71,56 +71,54 @@ If OpenSSL and zlib support were included when you built Apache 2.2, and you wan
71
71
72
72
## Build
73
73
74
- ### PCRE-8.12
74
+ ### PCRE-8.40
75
75
76
- CD C:\work\pcre-8.12
76
+ CD C:\work\pcre-8.40
77
77
CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=True
78
78
NMAKE
79
79
80
- ### LibXML2-2.7.7
80
+ ### LibXML2-2.9.4
81
81
82
- Note: the more recent version: 2.7.8 does not build correctly on Windows)
83
-
84
- CD C:\work\libxml2-2.7.7\win32
82
+ CD C:\work\libxml2-2.9.4\win32
85
83
CSCRIPT configure.js iconv=no vcmanifest=yes zlib=yes
86
84
NMAKE -f Makefile.msvc
87
85
88
- ### Lua-5.1 .4
86
+ ### Lua-5.3 .4
89
87
90
- CD C:\work\lua-5.1 .4\src
88
+ CD C:\work\lua-5.3 .4\src
91
89
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
92
90
DEL lua.obj luac.obj
93
91
LINK /DLL /LTCG /DEBUG /OUT:lua5.1.dll *.obj
94
92
IF EXIST lua5.1.dll.manifest MT -manifest lua5.1.dll.manifest -outputresource:lua5.1.dll;2
95
93
96
- ### cURL-7.21.4
94
+ ### cURL-7.54.0
97
95
98
- CD C:\work\curl-7.21.4
96
+ CD C:\work\curl-7.54.0
99
97
CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=True -DCURL_ZLIB=True
100
98
NMAKE
101
99
102
- ### ModSecurity-2.6
100
+ ### ModSecurity-2.9.x
103
101
104
102
CD C:\work\mod_security\apache2
105
- NMAKE -f Makefile.win APACHE=C:\Apache2217 PCRE=C:\work\pcre-8.12 LIBXML2=C:\work\libxml2-2.7.7 LUA=C:\work\lua-5.1 .4\src
103
+ 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
106
104
107
105
## Install ModSecurity and run Apache
108
106
109
- Copy these five files to `` C:\Apache2217 \bin `` :
107
+ Copy these five files to `` C:\Apache2427 \bin `` :
110
108
111
- C:\work\pcre-8.12 \pcre.dll C:\Apache2217 \bin\
112
- C:\work\lua-5.1 .4\src\lua5.1.dll C:\Apache2217 \bin\
113
- C:\work\libxml2-2.7.7 \win32\bin.msvc\libxml2.dll C:\Apache2217 \bin\
114
- C:\work\curl-7.21.4 \libcurl.dll C:\Apache2217 \bin\
109
+ C:\work\pcre-8.40 \pcre.dll C:\Apache2427 \bin\
110
+ C:\work\lua-5.3 .4\src\lua5.1.dll C:\Apache2427 \bin\
111
+ C:\work\libxml2-2.9.4 \win32\bin.msvc\libxml2.dll C:\Apache2427 \bin\
112
+ C:\work\curl-7.54.0 \libcurl.dll C:\Apache2427 \bin\
115
113
C:\work\mod_security\apache2\mlogc-src\mlogc.exe
116
114
117
- Copy this one file to `` C:\Apache2217 \modules `` :
115
+ Copy this one file to `` C:\Apache2427 \modules `` :
118
116
119
117
C:\work\mod_security\apache2\mod_security2.so
120
118
121
- You may also copy `` C:\work\curl-7.21.4 \curl.exe `` to `` C:\Apache2217 \bin `` , if you want to use the cURL command-line program.
119
+ You may also copy `` C:\work\curl-7.54.0 \curl.exe `` to `` C:\Apache2427 \bin `` , if you want to use the cURL command-line program.
122
120
123
- Download the core rules from http://sourceforge.net/projects/mod-security/files/modsecurity-crs/0-CURRENT/ and unzip them into `` C:\Apache2217 \conf\modsecurity_crs ``
121
+ Download the core rules from http://sourceforge.net/projects/mod-security/files/modsecurity-crs/0-CURRENT/ and unzip them into `` C:\Apache2427 \conf\modsecurity_crs ``
124
122
125
123
Add configuration directives to your Apache conf\httpd.conf:
126
124
@@ -146,11 +144,11 @@ Add configuration directives to your Apache conf\httpd.conf:
146
144
Edit the top of `` C:\work\mod_security\apache2\mlogc-src\Makefile.win `` and set your local paths
147
145
148
146
# Path to Apache httpd installation
149
- BASE = C:\Apache2217
147
+ BASE = C:\Apache2427
150
148
151
149
# Paths to required libraries
152
- PCRE = C:\work\pcre-8.12
153
- CURL = C:\work\curl-7.21.4
150
+ PCRE = C:\work\pcre-8.40
151
+ CURL = C:\work\curl-7.54.0
154
152
155
153
# Linking libraries
156
154
LIBS = $(BASE)\lib\libapr-1.lib \
@@ -164,16 +162,16 @@ Build the ``mlogc.exe`` program:
164
162
CD C:\work\mod_security_trunk\mlogc
165
163
NMAKE -f Makefile.win
166
164
167
- Copy `` mlocg.exe `` to `` C:\Apache2217 \bin\ ``
165
+ Copy `` mlocg.exe `` to `` C:\Apache2427 \bin\ ``
168
166
169
- Create a new command file `` C:\Apache2217 \bin\mlogc.bat `` with one line:
167
+ Create a new command file `` C:\Apache2427 \bin\mlogc.bat `` with one line:
170
168
171
- C:\Apache2217 \bin\mlogc.exe C:\Apache2217 \conf\mlogc.conf
169
+ C:\Apache2427 \bin\mlogc.exe C:\Apache2427 \conf\mlogc.conf
172
170
173
- Create a new configuration file `` C:\Apache2217 \conf\mlogc.conf `` to control the piped-logging program `` mlogc.exe `` .
171
+ Create a new configuration file `` C:\Apache2427 \conf\mlogc.conf `` to control the piped-logging program `` mlogc.exe `` .
174
172
Here is an example `` conf\mlogc.conf `` :
175
173
176
- CollectorRoot "C:/Apache2217 /logs"
174
+ CollectorRoot "C:/Apache2427 /logs"
177
175
ConsoleURI "https://localhost:8888/rpc/auditLogReceiver"
178
176
SensorUsername "test"
179
177
SensorPassword "testtest"
@@ -193,4 +191,4 @@ Here is an example ``conf\mlogc.conf``:
193
191
194
192
Change the SecAuditLog directive in `` conf\httpd.conf `` to pipe the log data to mlogc instead of writing them to a file:
195
193
196
- SecAuditLog |C:/Apache2217 /bin/mlogc.bat
194
+ SecAuditLog |C:/Apache2427 /bin/mlogc.bat
0 commit comments