本节演示如何从包含或不包含TLS的源代码安装Zabbix agent二进制文件(Windows)
以下步骤将帮助您从MS Windows 10(64位)上的源代码编译OpenSSL
e:\openssl-1.1.1> nasm --version NASM version 2.13.01 compiled on May 1 2017
e:\openssl-1.1.1> perl E:\openssl-1.1.1\Configure VC-WIN64A no-shared no-capieng no-srp no-gost no-dgram no-dtls1-method no-dtls1_2-method --api=1.1.0 --prefix=C:\OpenSSL-Win64-111-static --openssldir=C:\OpenSSL-Win64-111-static
e:\openssl-1.1.1> nmake e:\openssl-1.1.1> nmake test ... All tests successful. Files=152, Tests=1152, 501 wallclock secs ( 0.67 usr + 0.61 sys = 1.28 CPU) Result: PASS e:\openssl-1.1.1> nmake install_sw
'install_sw'仅安装软件组件(即库,头文件,但没有文档)。 如果需要所有内容,请使用“ nmake install”E:\pcre-8.41\build> nmake install
以下步骤将帮助您从MS Windows 10(64位)上的源代码编译Zabbix。 当使用/不支持TLS编译Zabbix时,唯一的不同是在步骤4中
$ git clone https://git.zabbix.com/scm/zbx/zabbix.git $ cd zabbix/ $ git checkout 5.0.1 -b 5.0.1 # replace 5.0.1 with the latest release available $ ./bootstrap.sh $ ./configure --enable-agent --enable-ipv6 --prefix=`pwd` $ make dbschema $ make dist
E:\zabbix-5.0.0\build\win32\project> nmake /K PCREINCDIR=E:\pcre-8.41-install\include PCRELIBDIR=E:\pcre-8.41-install\lib
E:\zabbix-5.0.0\build\win32\project> nmake /K -f Makefile_get TLS=openssl TLSINCDIR=C:\OpenSSL-Win64-111-static\include TLSLIBDIR=C:\OpenSSL-Win64-111-static\lib PCREINCDIR=E:\pcre-8.41-install\include PCRELIBDIR=E:\pcre-8.41-install\lib E:\zabbix-5.0.0\build\win32\project> nmake /K -f Makefile_sender TLS=openssl TLSINCDIR="C:\OpenSSL-Win64-111-static\include TLSLIBDIR="C:\OpenSSL-Win64-111-static\lib" PCREINCDIR=E:\pcre-8.41-install\include PCRELIBDIR=E:\pcre-8.41-install\lib E:\zabbix-5.0.0\build\win32\project> nmake /K -f Makefile_agent TLS=openssl TLSINCDIR=C:\OpenSSL-Win64-111-static\include TLSLIBDIR=C:\OpenSSL-Win64-111-static\lib PCREINCDIR=E:\pcre-8.41-install\include PCRELIBDIR=E:\pcre-8.41-install\lib
该过程类似于使用OpenSSL进行编译,但是您需要对 build\win32\project
目录中的文件进行一些小的更改:
CFLAGS = $(CFLAGS) /DHAVE_OPENSSL /DHAVE_OPENSSL_WITH_PSK</code>并替换为 CFLAGS = $(CFLAGS) /DHAVE_OPENSSL
/MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DYNAMICBASE:NO /PDB:$(TARGETDIR)\$(TARGETNAME).pdb</code>并替换为 /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DYNAMICBASE:NO /PDB:$(TARGETDIR)\$(TARGETNAME).pdb /NODEFAULTLIB:LIBCMT