|
1 | | -WARNING! |
| 1 | +The build process for ModSecurityIIS for Windows was a relatively complicated process. Understanding it required advanced knowledge of Windows and Unix environments. |
| 2 | +So the build process was refactored to make it easier for users to create their own builds with the automated batch scripts. |
2 | 3 |
|
3 | | -Building ModSecurityIIS on Windows is a relatively complicated process. Understanding it requires advanced knowledge of Windows and Unix environments. |
4 | | -Using the same versions of libraries as listed below is strongly recommended. |
| 4 | +* build_release.bat -> The main build script that calls all the others to have a working release |
| 5 | +* build_msi.bat -> Creates the MSI self-installer for easy deploy / removal / distribution |
5 | 6 |
|
| 7 | +* build_dependencies.bat -> Sets (and downloads if needed) all required dependencies |
| 8 | +* build_modsecurity.bat -> Builds ModSecurity (requires all depenedencies being set) |
| 9 | + |
| 10 | +* download_files.bat -> Downloads all required dependencies to the default Downloads folder |
| 11 | +** This script is disabled by default. If you want to enable it, uncomment the "@call download_files.bat" line on build_dependencies.bat |
| 12 | + |
| 13 | +The dependencies folder also includes a set o batch scripts which sets each dependency |
| 14 | +on its own. These scripts are called by the build_dependencies.bat script. |
| 15 | + |
| 16 | +Using the same versions of libraries as listed below is recommended. |
6 | 17 | -------------------------------------- |
7 | | -Tested on: |
8 | | - |
9 | | -Windows 7 x64 |
10 | | -Vistual Studio 2010 Ultimate SP1 |
11 | | -IIS enabled/installed |
12 | | - |
13 | | -cmake 2.8.7 |
14 | | -curl 7.24.0 |
15 | | -apache 2.2.22 or apache 2.4.3 |
16 | | -libxml2 2.7.7 |
17 | | -lua 5.1.5 |
18 | | -pcre 8.30 |
19 | | -zlib 1.2.7 |
20 | | -7-Zip |
| 18 | +Compilation Prerequisites: |
| 19 | + |
| 20 | +* Windows 7 x86_x64 (Should work on newer versions of Windows too) |
| 21 | +* Vistual Studio 2013 Express (Other versions should work, but you need to set the correct path for vcvars.bat scripts) |
| 22 | +* IIS enabled/installed |
| 23 | +* 7-Zip |
| 24 | + |
21 | 25 | -------------------------------------- |
22 | 26 |
|
23 | | -1. Create working directory c:\work and drop directory c:\drop |
24 | | -2. Sync SVN ModSecurity branch to c:\work\mod_security |
25 | | -3. Copy files from c:\work\mod_security\iis\winbuild to c:\work |
26 | | -4. Download and install cmake (unpack to c:\work\cmake-2.8.7-win32-x86) |
27 | | -5. Download and install 7-Zip |
28 | | -6. Adjust paths in c:\work\init.bat accordingly if needed |
29 | | -7. Download curl, apache, libxml2, lua, pcre and zlib, place them in zip files in c:\work |
30 | | - |
31 | | -curl-7.24.0.zip |
32 | | -httpd-2.2.22-win32-src.zip or (httpd-2.4.3.zip (source) and httpd-2.4.3-win32.zip + httpd-2.4.3-win64.zip (binaries)) |
33 | | -libxml2-2.7.7.zip |
34 | | -lua-5.1.5.zip |
35 | | -pcre-8.30.zip |
36 | | -zlib-1.2.7.zip |
37 | | - |
38 | | -Modify c:\work\build.bat accordingly (if other versions were used) |
39 | | - |
40 | | -8. Open cmd.exe window, go to c:\work and run buildall.bat |
41 | | -9. When done, the binaries, lib and pdb files should appear under c:\drop\x86 (32-bit) and c:\drop\amd64 (64-bit) |
42 | | -10. Open the VS ModSecurity IIS installer project |
43 | | -11. Copy new binaries to the installer's x86 and amd64 directories |
44 | | -12. Build installer from within VS |
| 27 | +The latest versions of ModSecurity dependencies known to work well are the following: |
| 28 | + |
| 29 | +cmake-3.8.2-win32-x86 |
| 30 | +pcre-8.40 (patch required and included on file "patch-pcre-8.40.vbs") |
| 31 | +zlib-1.2.11 |
| 32 | +libxml2-2.9.4 |
| 33 | +lua-5.3.4 |
| 34 | +curl-7.54.1 |
| 35 | +httpd-2.4.27 (bin-VC11) |
| 36 | +yajl-2.1.0 |
| 37 | +ssdeep-2.13 |
| 38 | + |
| 39 | +-------------------------------------- |
| 40 | + |
| 41 | +1. Create working directory (e.g. c:\work) and drop the latest clone from ModSecurity's 2.x Github (https://github.com/SpiderLabs/ModSecurity/archive/v2/master.zip) |
| 42 | +2. Make sure the prerequisites mentioned above are all set |
| 43 | +3. If you haven't download the dependency files before, uncomment the "@call download_files.bat" line on build_dependencies.bat to have them downloaded prior |
| 44 | +4. Open a command prompt (cmd.exe) and head to the "iis" folder inside ModSecurity tree working directory (e.g. cd c:\work\ModSecurity\iis) |
| 45 | +5. If you need to modify anything (e.g. paths, versions etc), carefully edit the batch files. |
| 46 | +6. Run build_release.bat |
| 47 | +7. When done, the binaries, lib and pdb files should appear under c:\work\ModSecurity\iis\release\x86 (32-bit) and c:\work\ModSecurity\iis\release\amd64 (64-bit) |
| 48 | +* At this point, if you had a previous installation of ModSecurity and would like to test you can place the x86 files to "C:\Windows\SysWOW64\inetsrv" and x64 files to "C:\Windows\System32\inetsrv" |
| 49 | + |
| 50 | +8. If all went well, you can build the MSI installer by running the build_msi.bat script. |
| 51 | + |
| 52 | +* The built installable package places the files to the correct folders, automatically configures the ModSecurity IIS native module and configures web.config to enable ModSecurity for all IIS sites. |