mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-16 01:22:18 +03:00
iis: Renamves winbuild to dependencies
Since the directory becomes all about dependencies there is no need to call it winbuild anymore.
This commit is contained in:
committed by
Felipe Zimmerle
parent
9f8cbf6ed8
commit
1447766e81
47
iis/dependencies/build_apache.bat
Normal file
47
iis/dependencies/build_apache.bat
Normal file
@@ -0,0 +1,47 @@
|
||||
@cd "%WORK_DIR%"
|
||||
@set APACHE=%WORK_DIR%\Apache24
|
||||
|
||||
@if NOT EXIST "%SOURCE_DIR%\%APACHE_BIN%" goto file_not_found_bin
|
||||
@if NOT EXIST "%SOURCE_DIR%\%APACHE_SRC%" goto file_not_found_src
|
||||
|
||||
@7z.exe x "%SOURCE_DIR%\%APACHE_BIN%"
|
||||
@if NOT (%ERRORLEVEL%) == (0) goto something_went_wrong
|
||||
|
||||
@7z.exe x "%SOURCE_DIR%\%APACHE_SRC%" -so | 7z.exe x -aoa -si -ttar
|
||||
@if NOT (%ERRORLEVEL%) == (0) goto something_went_wrong
|
||||
|
||||
:: Missing: %APACHE%\bin\libapr-1.pdb %APACHE%\bin\libapr-1.lib ?
|
||||
copy /y "%APACHE%\bin\libapr-1.dll" "%OUTPUT_DIR%"
|
||||
@if NOT (%ERRORLEVEL%) == (0) goto something_went_wrong_copy
|
||||
|
||||
:: Missing: %APACHE%\bin\libapriconv-1.pdb %APACHE%\lib\libapriconv-1.lib ?
|
||||
copy /y "%APACHE%\bin\libapriconv-1.dll" "%OUTPUT_DIR%"
|
||||
@if NOT (%ERRORLEVEL%) == (0) goto something_went_wrong_copy
|
||||
|
||||
:: Missing: %APACHE%\bin\libaprutil-1.pdb %APACHE%\lib\libaprutil-1.lib ?
|
||||
copy /y "%APACHE%\bin\libaprutil-1.dll" "%OUTPUT_DIR%"
|
||||
@if NOT (%ERRORLEVEL%) == (0) goto something_went_wrong_copy
|
||||
|
||||
@cd "%WORK_DIR%"
|
||||
|
||||
@exit /B 0
|
||||
|
||||
:something_went_wrong_copy
|
||||
@echo Something went wrong while trying to copy Apache binaries files.
|
||||
@goto failed
|
||||
|
||||
:file_not_found_bin
|
||||
@echo File not found: %SOURCE_DIR%\%APACHE_BIN%
|
||||
@goto failed
|
||||
|
||||
:file_not_found_src
|
||||
@echo File not found: %SOURCE_DIR%\%APACHE_SRC%
|
||||
@goto failed
|
||||
|
||||
:something_went_wrong
|
||||
@echo Something went wrong while unzip Apache files.
|
||||
@goto failed
|
||||
|
||||
:failed
|
||||
@exit /B 1
|
||||
|
||||
29
iis/dependencies/build_curl.bat
Normal file
29
iis/dependencies/build_curl.bat
Normal file
@@ -0,0 +1,29 @@
|
||||
cd "%WORK_DIR%"
|
||||
|
||||
@if NOT EXIST "%SOURCE_DIR%\%CURL%" goto file_not_found_bin
|
||||
|
||||
7z.exe x "%SOURCE_DIR%\%CURL%"
|
||||
|
||||
set CURL_DIR=%CURL:~0,-4%
|
||||
|
||||
copy /y CMakeLists.txt "%CURL_DIR%"
|
||||
CD "%CURL_DIR%"
|
||||
CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=True -DCURL_ZLIB=True
|
||||
"%WORK_DIR%\fart.exe" -r -C "%WORK_DIR%\%CURL_DIR%\include\curl\curlbuild.h" LLU ULL
|
||||
NMAKE
|
||||
|
||||
cd "%WORK_DIR%"
|
||||
|
||||
copy /y "%WORK_DIR%\%CURL_DIR%\lib\libcurl.dll" "%OUTPUT_DIR%"
|
||||
copy /y "%WORK_DIR%\%CURL_DIR%\lib\libcurl.pdb" "%OUTPUT_DIR%"
|
||||
copy /y "%WORK_DIR%\%CURL_DIR%\lib\libcurl_imp.lib" "%OUTPUT_DIR%"
|
||||
|
||||
exit /B 0
|
||||
|
||||
:file_not_found_bin
|
||||
@echo File not found: "%SOURCE_DIR%\%CURL%"
|
||||
@goto failed
|
||||
|
||||
:failed
|
||||
@exit /B 1
|
||||
|
||||
27
iis/dependencies/build_libxml2.bat
Normal file
27
iis/dependencies/build_libxml2.bat
Normal file
@@ -0,0 +1,27 @@
|
||||
cd "%WORK_DIR%"
|
||||
|
||||
@if NOT EXIST "%SOURCE_DIR%\%LIBXML2%" goto file_not_found_bin
|
||||
|
||||
@7z.exe x "%SOURCE_DIR%\%LIBXML2%" -so | 7z.exe x -aoa -si -ttar
|
||||
|
||||
set LIBXML2_DIR=%LIBXML2:~0,-7%
|
||||
|
||||
fart.exe -r -i -C "%WORK_DIR%\%LIBXML2_DIR%\win32\*.*" \x2Fopt:nowin98 " "
|
||||
cd "%LIBXML2_DIR%\win32"
|
||||
CSCRIPT configure.js iconv=no vcmanifest=yes zlib=yes
|
||||
NMAKE -f Makefile.msvc
|
||||
|
||||
cd "%WORK%"
|
||||
|
||||
copy /y "%WORK_DIR%\%LIBXML2_DIR%\win32\bin.msvc\libxml2.dll" "%OUTPUT_DIR%"
|
||||
copy /y "%WORK_DIR%\%LIBXML2_DIR%\win32\bin.msvc\libxml2.lib" "%OUTPUT_DIR%"
|
||||
|
||||
@exit /B 0
|
||||
|
||||
:file_not_found_bin
|
||||
@echo File not found: "%SOURCE_DIR%\%LIBXML2%"
|
||||
@goto failed
|
||||
|
||||
:failed
|
||||
@exit /B 1
|
||||
|
||||
30
iis/dependencies/build_lua.bat
Normal file
30
iis/dependencies/build_lua.bat
Normal file
@@ -0,0 +1,30 @@
|
||||
cd "%WORK_DIR%"
|
||||
|
||||
@if NOT EXIST "%SOURCE_DIR%\%LUA%" goto file_not_found_bin
|
||||
|
||||
@7z.exe x "%SOURCE_DIR%\%LUA%" -so | 7z.exe x -aoa -si -ttar
|
||||
|
||||
set LUA_DIR=%LUA:~0,-7%
|
||||
|
||||
cd "%LUA_DIR%\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
|
||||
|
||||
cd "%WORK_DIR%"
|
||||
|
||||
copy /y "%WORK_DIR%\%LUA_DIR%\src\lua5.1.dll" "%OUTPUT_DIR%"
|
||||
copy /y "%WORK_DIR%\%LUA_DIR%\src\lua5.1.pdb" "%OUTPUT_DIR%"
|
||||
copy /y "%WORK_DIR%\%LUA_DIR%\src\lua5.1.lib" "%OUTPUT_DIR%"
|
||||
|
||||
@exit /B 0
|
||||
|
||||
:file_not_found_bin
|
||||
@echo File not found: "%SOURCE_DIR%\%LUA%"
|
||||
@goto failed
|
||||
|
||||
:failed
|
||||
@exit /B 1
|
||||
|
||||
16
iis/dependencies/build_module.bat
Normal file
16
iis/dependencies/build_module.bat
Normal file
@@ -0,0 +1,16 @@
|
||||
cd %WORK%
|
||||
CD mod_security\apache2
|
||||
del *.obj *.dll *.lib
|
||||
NMAKE -f Makefile.win APACHE=%APACHE% PCRE=%WORK%\%PCRE% LIBXML2=%WORK%\%LIBXML2% LUA=%WORK%\%LUA%\src VERSION=VERSION_IIS
|
||||
cd ..\mlogc
|
||||
copy /y %WORK%\Makefile.win .
|
||||
nmake -f Makefile.win clean
|
||||
nmake -f Makefile.win APACHE=%APACHE% PCRE=%WORK%\%PCRE% CURL=%WORK%\%CURL% VERSION=VERSION_IIS
|
||||
cd ..\iis
|
||||
nmake -f Makefile.win clean
|
||||
NMAKE -f Makefile.win APACHE=%APACHE% PCRE=%WORK%\%PCRE% LIBXML2=%WORK%\%LIBXML2% LUA=%WORK%\%LUA%\src VERSION=VERSION_IIS
|
||||
cd %WORK%
|
||||
|
||||
copy /y %WORK%\mod_security\mlogc\mlogc.exe %DROP%
|
||||
copy /y %WORK%\mod_security\iis\modsecurityiis.dll %DROP%
|
||||
copy /y %WORK%\mod_security\iis\modsecurityiis.pdb %DROP%
|
||||
24
iis/dependencies/build_pcre.bat
Normal file
24
iis/dependencies/build_pcre.bat
Normal file
@@ -0,0 +1,24 @@
|
||||
cd "%WORK_DIR%"
|
||||
|
||||
@if NOT EXIST "%SOURCE_DIR%\%APACHE_BIN%" goto file_not_found_bin
|
||||
|
||||
7z.exe x "%SOURCE_DIR%\%PCRE%"
|
||||
set PCRE_DIR=%PCRE:~0,-4%
|
||||
|
||||
cd "%PCRE_DIR%"
|
||||
CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=True
|
||||
NMAKE
|
||||
cd "%WORK%"
|
||||
|
||||
copy /y "%WORK_DIR%\%PCRE_DIR%\pcre.dll" "%OUTPUT_DIR%"
|
||||
copy /y "%WORK_DIR%\%PCRE_DIR%\pcre.pdb" "%OUTPUT_DIR%"
|
||||
copy /y "%WORK_DIR%\%PCRE_DIR%\pcre.lib" "%OUTPUT_DIR%"
|
||||
echo "a"
|
||||
@exit /B 0
|
||||
|
||||
:file_not_found_bin
|
||||
@echo File not found: "%SOURCE_DIR%\%PCRE%"
|
||||
@goto failed
|
||||
|
||||
:failed
|
||||
@exit /B 1
|
||||
26
iis/dependencies/build_zlib.bat
Normal file
26
iis/dependencies/build_zlib.bat
Normal file
@@ -0,0 +1,26 @@
|
||||
cd "%WORK_DIR%"
|
||||
|
||||
@if NOT EXIST "%SOURCE_DIR%\%ZLIB%" goto file_not_found_bin
|
||||
|
||||
@7z.exe x "%SOURCE_DIR%\%ZLIB%" -so | 7z.exe x -aoa -si -ttar
|
||||
|
||||
set ZLIB_DIR=%ZLIB:~0,-7%
|
||||
|
||||
cd "%ZLIB_DIR%"
|
||||
nmake -f win32\Makefile.msc
|
||||
SET INCLUDE=%INCLUDE%;%WORK_DIR%\%ZLIB_DIR%
|
||||
SET LIB=%LIB%;%WORK_DIR%\%ZLIB_DIR%
|
||||
cd "%WORK_DIR%"
|
||||
|
||||
copy /y "%WORK_DIR%\%ZLIB_DIR%\zlib1.dll" "%OUTPUT_DIR%"
|
||||
copy /y "%WORK_DIR%\%ZLIB_DIR%\zlib1.pdb" "%OUTPUT_DIR%"
|
||||
copy /y "%WORK_DIR%\%ZLIB_DIR%\zdll.lib" "%OUTPUT_DIR%"
|
||||
|
||||
@exit /B 0
|
||||
|
||||
:file_not_found_bin
|
||||
@echo File not found: "%SOURCE_DIR%\%ZLIB%"
|
||||
@goto failed
|
||||
|
||||
:failed
|
||||
@exit /B 1
|
||||
BIN
iis/dependencies/fart.exe
Normal file
BIN
iis/dependencies/fart.exe
Normal file
Binary file not shown.
44
iis/dependencies/howto.txt
Normal file
44
iis/dependencies/howto.txt
Normal file
@@ -0,0 +1,44 @@
|
||||
WARNING!
|
||||
|
||||
Building ModSecurityIIS on Windows is a relatively complicated process. Understanding it requires advanced knowledge of Windows and Unix environments.
|
||||
Using the same versions of libraries as listed below is strongly recommended.
|
||||
|
||||
--------------------------------------
|
||||
Tested on:
|
||||
|
||||
Windows 7 x64
|
||||
Vistual Studio 2010 Ultimate SP1
|
||||
IIS enabled/installed
|
||||
|
||||
cmake 2.8.7
|
||||
curl 7.24.0
|
||||
apache 2.2.22 or apache 2.4.3
|
||||
libxml2 2.7.7
|
||||
lua 5.1.5
|
||||
pcre 8.30
|
||||
zlib 1.2.7
|
||||
7-Zip
|
||||
--------------------------------------
|
||||
|
||||
1. Create working directory c:\work and drop directory c:\drop
|
||||
2. Sync SVN ModSecurity branch to c:\work\mod_security
|
||||
3. Copy files from c:\work\mod_security\iis\winbuild to c:\work
|
||||
4. Download and install cmake (unpack to c:\work\cmake-2.8.7-win32-x86)
|
||||
5. Download and install 7-Zip
|
||||
6. Adjust paths in c:\work\init.bat accordingly if needed
|
||||
7. Download curl, apache, libxml2, lua, pcre and zlib, place them in zip files in c:\work
|
||||
|
||||
curl-7.24.0.zip
|
||||
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))
|
||||
libxml2-2.7.7.zip
|
||||
lua-5.1.5.zip
|
||||
pcre-8.30.zip
|
||||
zlib-1.2.7.zip
|
||||
|
||||
Modify c:\work\build.bat accordingly (if other versions were used)
|
||||
|
||||
8. Open cmd.exe window, go to c:\work and run buildall.bat
|
||||
9. When done, the binaries, lib and pdb files should appear under c:\drop\x86 (32-bit) and c:\drop\amd64 (64-bit)
|
||||
10. Open the VS ModSecurity IIS installer project
|
||||
11. Copy new binaries to the installer's x86 and amd64 directories
|
||||
12. Build installer from within VS
|
||||
Reference in New Issue
Block a user