mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 11:16:33 +03:00
Improved IIS build process and more fixes to handle Apache 2.4.
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
###########################################################################
|
||||
|
||||
# Path to Apache httpd installation
|
||||
BASE = C:\Apache22
|
||||
BASE = %APACHE%
|
||||
|
||||
# Paths to required libraries
|
||||
PCRE = C:\work\pcre-8.30
|
||||
CURL = C:\work\curl-7.24.0
|
||||
PCRE = %PCRE%
|
||||
CURL = %CURL%
|
||||
|
||||
# Linking libraries
|
||||
LIBS = $(BASE)\lib\libapr-1.lib \
|
||||
@@ -24,7 +24,7 @@ CC = cL
|
||||
|
||||
MT = mt
|
||||
|
||||
DEFS = /nologo /O2 /W3 -DWIN32 -DWINNT -Dinline=APR_INLINE -D_CONSOLE
|
||||
DEFS = /nologo /O2 /W3 -DWIN32 -DWINNT -Dinline=APR_INLINE -D_CONSOLE -D$(VERSION)
|
||||
|
||||
EXE = mlogc.exe
|
||||
|
||||
|
@@ -1,115 +1,11 @@
|
||||
c:
|
||||
set WORK=c:\work
|
||||
set HTTPD=httpd-2.2.22
|
||||
set APACHE=c:\Apache22
|
||||
set PCRE=pcre-8.30
|
||||
set ZLIB=zlib-1.2.7
|
||||
set LIBXML2=libxml2-2.7.7
|
||||
set LUA=lua-5.1.5
|
||||
set CURL=curl-7.24.0
|
||||
|
||||
call build_apache.bat
|
||||
call build_pcre.bat
|
||||
call build_zlib.bat
|
||||
call build_libxml2.bat
|
||||
call build_lua.bat
|
||||
call build_curl.bat
|
||||
call build_module.bat
|
||||
|
||||
cd %WORK%
|
||||
rmdir /s /q %APACHE%
|
||||
rmdir /s /q %HTTPD%
|
||||
7z.exe x %HTTPD%-win32-src.zip
|
||||
fart.exe -r -i -C %WORK%\%HTTPD%\*.mak \x2Fmachine:x86 " "
|
||||
fart.exe -r -i -C %WORK%\%HTTPD%\*.mk.win \x2Fmachine:x86 " "
|
||||
copy /y %WORK%\libhttpd.mak %WORK%\%HTTPD%
|
||||
copy /y %WORK%\mod_ssl.mak %WORK%\%HTTPD%\modules\ssl
|
||||
copy /y %WORK%\apr.mak %WORK%\%HTTPD%\srclib\apr
|
||||
copy /y %WORK%\libapr.mak %WORK%\%HTTPD%\srclib\apr
|
||||
copy /y %WORK%\aprutil.mak %WORK%\%HTTPD%\srclib\apr-util
|
||||
copy /y %WORK%\libaprutil.mak %WORK%\%HTTPD%\srclib\apr-util
|
||||
copy /y %WORK%\dftables.mak %WORK%\%HTTPD%\srclib\pcre
|
||||
copy /y %WORK%\pcre.mak %WORK%\%HTTPD%\srclib\pcre
|
||||
cd %HTTPD%
|
||||
nmake -f Makefile.win installr
|
||||
SET HTTPD_BUILD=%WORK%\%HTTPD%
|
||||
IF NOT DEFINED FULLBUILD pause
|
||||
|
||||
cd %WORK%
|
||||
rmdir /s /q %PCRE%
|
||||
7z.exe x %PCRE%.zip
|
||||
cd %PCRE%
|
||||
CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=True
|
||||
NMAKE
|
||||
IF NOT DEFINED FULLBUILD pause
|
||||
|
||||
cd %WORK%
|
||||
rmdir /s /q %ZLIB%
|
||||
7z.exe x %ZLIB%.zip
|
||||
cd %ZLIB%
|
||||
nmake -f win32\Makefile.msc
|
||||
SET INCLUDE=%INCLUDE%;%WORK%\%ZLIB%
|
||||
SET LIB=%LIB%;%WORK%\%ZLIB%
|
||||
IF NOT DEFINED FULLBUILD pause
|
||||
|
||||
cd %WORK%
|
||||
rmdir /s /q %LIBXML2%
|
||||
7z.exe x %LIBXML2%.zip
|
||||
fart.exe -r -i -C %WORK%\%LIBXML2%\win32\*.* \x2Fopt:nowin98 " "
|
||||
cd %LIBXML2%\win32
|
||||
CSCRIPT configure.js iconv=no vcmanifest=yes zlib=yes
|
||||
NMAKE -f Makefile.msvc
|
||||
IF NOT DEFINED FULLBUILD pause
|
||||
|
||||
cd %WORK%
|
||||
rmdir /s /q %LUA%
|
||||
7z.exe x %LUA%.zip
|
||||
CD %LUA%\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
|
||||
IF NOT DEFINED FULLBUILD pause
|
||||
|
||||
cd %WORK%
|
||||
rmdir /s /q %CURL%
|
||||
7z.exe x %CURL%.zip
|
||||
copy /y CMakeLists.txt %CURL%
|
||||
CD %CURL%
|
||||
CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=True -DCURL_ZLIB=True
|
||||
%WORK%\fart.exe -r -C %WORK%\%CURL%\include\curl\curlbuild.h LLU ULL
|
||||
NMAKE
|
||||
IF NOT DEFINED FULLBUILD pause
|
||||
|
||||
cd %WORK%
|
||||
CD mod_security\apache2
|
||||
del *.obj *.dll *.lib
|
||||
NMAKE -f Makefile.win APACHE=C:\Apache22 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
|
||||
cd ..\iis
|
||||
nmake -f Makefile.win clean
|
||||
NMAKE -f Makefile.win APACHE=C:\Apache22 PCRE=%WORK%\%PCRE% LIBXML2=%WORK%\%LIBXML2% LUA=%WORK%\%LUA%\src VERSION=VERSION_IIS
|
||||
|
||||
cd %WORK%
|
||||
|
||||
copy /y %APACHE%\bin\libapr-1.dll %DROP%
|
||||
copy /y %APACHE%\bin\libapr-1.pdb %DROP%
|
||||
copy /y %APACHE%\lib\libapr-1.lib %DROP%
|
||||
copy /y %APACHE%\bin\libapriconv-1.dll %DROP%
|
||||
copy /y %APACHE%\bin\libapriconv-1.pdb %DROP%
|
||||
copy /y %APACHE%\lib\libapriconv-1.lib %DROP%
|
||||
copy /y %APACHE%\bin\libaprutil-1.dll %DROP%
|
||||
copy /y %APACHE%\bin\libaprutil-1.pdb %DROP%
|
||||
copy /y %APACHE%\lib\libaprutil-1.lib %DROP%
|
||||
copy /y %WORK%\%LIBXML2%\win32\bin.msvc\libxml2.dll %DROP%
|
||||
copy /y %WORK%\%LIBXML2%\win32\bin.msvc\libxml2.lib %DROP%
|
||||
copy /y %WORK%\%LUA%\src\lua5.1.dll %DROP%
|
||||
copy /y %WORK%\%LUA%\src\lua5.1.pdb %DROP%
|
||||
copy /y %WORK%\%LUA%\src\lua5.1.lib %DROP%
|
||||
copy /y %WORK%\%PCRE%\pcre.dll %DROP%
|
||||
copy /y %WORK%\%PCRE%\pcre.pdb %DROP%
|
||||
copy /y %WORK%\%PCRE%\pcre.lib %DROP%
|
||||
copy /y %WORK%\%ZLIB%\zlib1.dll %DROP%
|
||||
copy /y %WORK%\%ZLIB%\zlib1.pdb %DROP%
|
||||
copy /y %WORK%\%ZLIB%\zdll.lib %DROP%
|
||||
copy /y %WORK%\%CURL%\libcurl.dll %DROP%
|
||||
copy /y %WORK%\%CURL%\libcurl.pdb %DROP%
|
||||
copy /y %WORK%\%CURL%\libcurl_imp.lib %DROP%
|
||||
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%
|
||||
|
@@ -1,3 +1,4 @@
|
||||
SET APACHE24_ZIP=httpd-2.4.3-win32.zip
|
||||
mkdir %DROP%
|
||||
call vsvars32.bat
|
||||
call init.bat
|
||||
|
@@ -1,3 +1,4 @@
|
||||
SET APACHE24_ZIP=httpd-2.4.3-win64.zip
|
||||
mkdir %DROP%
|
||||
call vcvars64.bat
|
||||
call init.bat
|
||||
|
40
iis/winbuild/build_apache.bat
Normal file
40
iis/winbuild/build_apache.bat
Normal file
@@ -0,0 +1,40 @@
|
||||
cd %WORK%
|
||||
rmdir /s /q %APACHE%
|
||||
rmdir /s /q %HTTPD%
|
||||
IF NOT DEFINED BUILD_APACHE GOTO USE_APACHE_24
|
||||
7z.exe x %HTTPD%-win32-src.zip
|
||||
fart.exe -r -i -C %WORK%\%HTTPD%\*.mak \x2Fmachine:x86 " "
|
||||
fart.exe -r -i -C %WORK%\%HTTPD%\*.mk.win \x2Fmachine:x86 " "
|
||||
copy /y %WORK%\libhttpd.mak %WORK%\%HTTPD%
|
||||
copy /y %WORK%\mod_ssl.mak %WORK%\%HTTPD%\modules\ssl
|
||||
copy /y %WORK%\apr.mak %WORK%\%HTTPD%\srclib\apr
|
||||
copy /y %WORK%\libapr.mak %WORK%\%HTTPD%\srclib\apr
|
||||
copy /y %WORK%\aprutil.mak %WORK%\%HTTPD%\srclib\apr-util
|
||||
copy /y %WORK%\libaprutil.mak %WORK%\%HTTPD%\srclib\apr-util
|
||||
copy /y %WORK%\dftables.mak %WORK%\%HTTPD%\srclib\pcre
|
||||
copy /y %WORK%\pcre.mak %WORK%\%HTTPD%\srclib\pcre
|
||||
cd %HTTPD%
|
||||
nmake -f Makefile.win installr
|
||||
IF NOT DEFINED FULLBUILD pause
|
||||
GOTO END
|
||||
|
||||
:USE_APACHE_24
|
||||
set APACHE=%WORK%\Apache24
|
||||
del /q /f --*.*
|
||||
del /q /f readme.txt
|
||||
rmdir /s /q %APACHE%
|
||||
7z.exe x %APACHE24_ZIP%
|
||||
7z.exe x %HTTPD%.zip
|
||||
|
||||
:END
|
||||
copy /y %APACHE%\bin\libapr-1.dll %DROP%
|
||||
copy /y %APACHE%\bin\libapr-1.pdb %DROP%
|
||||
copy /y %APACHE%\lib\libapr-1.lib %DROP%
|
||||
copy /y %APACHE%\bin\libapriconv-1.dll %DROP%
|
||||
copy /y %APACHE%\bin\libapriconv-1.pdb %DROP%
|
||||
copy /y %APACHE%\lib\libapriconv-1.lib %DROP%
|
||||
copy /y %APACHE%\bin\libaprutil-1.dll %DROP%
|
||||
copy /y %APACHE%\bin\libaprutil-1.pdb %DROP%
|
||||
copy /y %APACHE%\lib\libaprutil-1.lib %DROP%
|
||||
SET HTTPD_BUILD=%WORK%\%HTTPD%
|
||||
cd %WORK%
|
14
iis/winbuild/build_curl.bat
Normal file
14
iis/winbuild/build_curl.bat
Normal file
@@ -0,0 +1,14 @@
|
||||
cd %WORK%
|
||||
rmdir /s /q %CURL%
|
||||
7z.exe x %CURL%.zip
|
||||
copy /y CMakeLists.txt %CURL%
|
||||
CD %CURL%
|
||||
CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=True -DCURL_ZLIB=True
|
||||
%WORK%\fart.exe -r -C %WORK%\%CURL%\include\curl\curlbuild.h LLU ULL
|
||||
NMAKE
|
||||
IF NOT DEFINED FULLBUILD pause
|
||||
cd %WORK%
|
||||
|
||||
copy /y %WORK%\%CURL%\libcurl.dll %DROP%
|
||||
copy /y %WORK%\%CURL%\libcurl.pdb %DROP%
|
||||
copy /y %WORK%\%CURL%\libcurl_imp.lib %DROP%
|
12
iis/winbuild/build_libxml2.bat
Normal file
12
iis/winbuild/build_libxml2.bat
Normal file
@@ -0,0 +1,12 @@
|
||||
cd %WORK%
|
||||
rmdir /s /q %LIBXML2%
|
||||
7z.exe x %LIBXML2%.zip
|
||||
fart.exe -r -i -C %WORK%\%LIBXML2%\win32\*.* \x2Fopt:nowin98 " "
|
||||
cd %LIBXML2%\win32
|
||||
CSCRIPT configure.js iconv=no vcmanifest=yes zlib=yes
|
||||
NMAKE -f Makefile.msvc
|
||||
IF NOT DEFINED FULLBUILD pause
|
||||
cd %WORK%
|
||||
|
||||
copy /y %WORK%\%LIBXML2%\win32\bin.msvc\libxml2.dll %DROP%
|
||||
copy /y %WORK%\%LIBXML2%\win32\bin.msvc\libxml2.lib %DROP%
|
14
iis/winbuild/build_lua.bat
Normal file
14
iis/winbuild/build_lua.bat
Normal file
@@ -0,0 +1,14 @@
|
||||
cd %WORK%
|
||||
rmdir /s /q %LUA%
|
||||
7z.exe x %LUA%.zip
|
||||
CD %LUA%\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
|
||||
IF NOT DEFINED FULLBUILD pause
|
||||
cd %WORK%
|
||||
|
||||
copy /y %WORK%\%LUA%\src\lua5.1.dll %DROP%
|
||||
copy /y %WORK%\%LUA%\src\lua5.1.pdb %DROP%
|
||||
copy /y %WORK%\%LUA%\src\lua5.1.lib %DROP%
|
16
iis/winbuild/build_module.bat
Normal file
16
iis/winbuild/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%
|
12
iis/winbuild/build_pcre.bat
Normal file
12
iis/winbuild/build_pcre.bat
Normal file
@@ -0,0 +1,12 @@
|
||||
cd %WORK%
|
||||
rmdir /s /q %PCRE%
|
||||
7z.exe x %PCRE%.zip
|
||||
cd %PCRE%
|
||||
CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=True
|
||||
NMAKE
|
||||
IF NOT DEFINED FULLBUILD pause
|
||||
cd %WORK%
|
||||
|
||||
copy /y %WORK%\%PCRE%\pcre.dll %DROP%
|
||||
copy /y %WORK%\%PCRE%\pcre.pdb %DROP%
|
||||
copy /y %WORK%\%PCRE%\pcre.lib %DROP%
|
13
iis/winbuild/build_zlib.bat
Normal file
13
iis/winbuild/build_zlib.bat
Normal file
@@ -0,0 +1,13 @@
|
||||
cd %WORK%
|
||||
rmdir /s /q %ZLIB%
|
||||
7z.exe x %ZLIB%.zip
|
||||
cd %ZLIB%
|
||||
nmake -f win32\Makefile.msc
|
||||
SET INCLUDE=%INCLUDE%;%WORK%\%ZLIB%
|
||||
SET LIB=%LIB%;%WORK%\%ZLIB%
|
||||
IF NOT DEFINED FULLBUILD pause
|
||||
cd %WORK%
|
||||
|
||||
copy /y %WORK%\%ZLIB%\zlib1.dll %DROP%
|
||||
copy /y %WORK%\%ZLIB%\zlib1.pdb %DROP%
|
||||
copy /y %WORK%\%ZLIB%\zdll.lib %DROP%
|
@@ -1,5 +1,7 @@
|
||||
set FULLBUILD=1
|
||||
|
||||
set DROP=c:\drop\amd64
|
||||
cmd.exe /c build64.bat
|
||||
|
||||
set DROP=c:\drop\x86
|
||||
cmd.exe /c build32.bat
|
||||
|
@@ -12,7 +12,7 @@ IIS enabled/installed
|
||||
|
||||
cmake 2.8.7
|
||||
curl 7.24.0
|
||||
apache 2.2.22
|
||||
apache 2.2.22 or apache 2.4.3
|
||||
libxml2 2.7.7
|
||||
lua 5.1.5
|
||||
pcre 8.30
|
||||
@@ -29,7 +29,7 @@ zlib 1.2.7
|
||||
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
|
||||
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
|
||||
@@ -38,7 +38,7 @@ 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 should appear under c:\drop\x86 (32-bit) and c:\drop\amd64 (64-bit)
|
||||
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
|
||||
|
@@ -1 +1,13 @@
|
||||
set PATH=%PATH%;c:\work\cmake-2.8.7-win32-x86\bin;"c:\program files\7-zip"
|
||||
|
||||
rem set BUILD_APACHE=YES
|
||||
set HTTPD=httpd-2.2.22
|
||||
IF NOT DEFINED BUILD_APACHE SET HTTPD=httpd-2.4.3
|
||||
|
||||
set WORK=c:\work
|
||||
set APACHE=c:\Apache22
|
||||
set PCRE=pcre-8.30
|
||||
set ZLIB=zlib-1.2.7
|
||||
set LIBXML2=libxml2-2.7.7
|
||||
set LUA=lua-5.1.5
|
||||
set CURL=curl-7.24.0
|
||||
|
Reference in New Issue
Block a user