为 Apache 构建 mod_nss

为 Apache 构建 mod_nss

我需要在 SLES 11 SP 4 上为 Apache 2.4.27 编译 mod_nss,因为对我来说这是目前启用 TLS 1.2 的唯一选项。我知道使用旧版操作系统很麻烦,所以这只是一个临时解决方案,因为 SLES 11 不支持 OpenSSL 1.X,所以我不能像往常一样使用 mod_ssl。

我拥有的:

  • Apache 2.4.27(从源安装到 /opt/apache2)
  • Apache 源代码位于 /tmp/apache2_build/httpd-2.4.27
  • Mod_nss源代码:https://releases.pagure.org/mod_nss/
  • 操作系统:SLES 11 SP 4
  • 从软件包先决条件安装(mozilla-nss-devel-3.47.1-38.12.1、mozilla-nspr-devel-4.23-29.9.1)

我在做什么:

cd <mod_nss_sourcecode_dir>
autoreconf -ivf
./configure --with-apxs=/opt/apache2/bin/apxs
gmake all install

最后一个命令返回以下输出:

gmake  all-am
gmake[1]: Entering directory `/tmp/apache2_build/httpd-2.4.27/modules/mod_nss-mod_nss1018'
/bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I.  -I/opt/apache2/include -I/usr/include/nspr4   -I/usr/include/nss3 -I/usr/include/nspr4    -I/usr/include/apr-1  -I/usr/include/nspr4    -g -O2 -Werror=implicit-function-declaration -DLINUX -D_REENTRANT -D_GNU_SOURCE -DENABLE_CHACHA20 -DENABLE_SERVER_DHE -DNSS_SUPPORTS_TLS_1_3 -MT mod_nss.lo -MD -MP -MF .deps/mod_nss.Tpo -c -o mod_nss.lo mod_nss.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/opt/apache2/include -I/usr/include/nspr4 -I/usr/include/nss3 -I/usr/include/nspr4 -I/usr/include/apr-1 -I/usr/include/nspr4 -g -O2 -Werror=implicit-function-declaration -DLINUX -D_REENTRANT -D_GNU_SOURCE -DENABLE_CHACHA20 -DENABLE_SERVER_DHE -DNSS_SUPPORTS_TLS_1_3 -MT mod_nss.lo -MD -MP -MF .deps/mod_nss.Tpo -c mod_nss.c  -fPIC -DPIC -o .libs/mod_nss.o
In file included from /opt/apache2/include/httpd.h:44,
                 from mod_nss.h:20,
                 from mod_nss.c:16:
/opt/apache2/include/ap_config.h:136:16: error: os.h: No such file or directory
In file included from mod_nss.c:16:
mod_nss.h:28:21: error: mod_ssl.h: No such file or directory
mod_nss.c:253: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
mod_nss.c:254: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
mod_nss.c: In function ‘nss_proxy_enable’:
mod_nss.c:310: error: ‘othermod_proxy_enable’ undeclared (first use in this function)
mod_nss.c:310: error: (Each undeclared identifier is reported only once
mod_nss.c:310: error: for each function it appears in.)
mod_nss.c:313: error: implicit declaration of function ‘othermod_proxy_enable’
mod_nss.c: In function ‘nss_engine_disable’:
mod_nss.c:339: error: ‘othermod_engine_disable’ undeclared (first use in this function)
mod_nss.c:340: error: implicit declaration of function ‘othermod_engine_disable’
mod_nss.c: In function ‘nss_register_hooks’:
mod_nss.c:588: error: ‘othermod_proxy_enable’ undeclared (first use in this function)
mod_nss.c:588: error: ‘apr_OFN_ssl_proxy_enable_t’ undeclared (first use in this function)
mod_nss.c:588: error: expected expression before ‘)’ token
mod_nss.c:589: error: ‘othermod_engine_disable’ undeclared (first use in this function)
mod_nss.c:589: error: ‘apr_OFN_ssl_engine_disable_t’ undeclared (first use in this function)
mod_nss.c:589: error: expected expression before ‘)’ token
mod_nss.c:595: error: ‘apu__opt’ undeclared (first use in this function)
gmake[1]: *** [mod_nss.lo] Error 1
gmake[1]: Leaving directory `/tmp/apache2_build/httpd-2.4.27/modules/mod_nss-mod_nss1018'
gmake: *** [all] Error 2

之前我遇到过与缺少操作系统我通过创建从 apache 源目录到 /opt 中的 apache 安装的符号链接来修复这些问题: /opt/apache2 屏幕截图 我该怎么做才能解决这个问题?我尝试使用以下方法将路径添加到“/tmp/apache2_build/”目录--包括=范围

答案1

mod_nss.h 确实包含 mod_ssl.h,因此您需要输入一个包含路径。

您可以在 Apache 源的 modules/ssl 目录中找到它。

相关内容