怎样编译安装mod_gnutls

2020年10月29日 | 分类: 【技术】

【介绍】

参考:https://amon.org/mod_gnutls-old

【依赖】

GNUTLS:

参考:https://amon.org/gnutls

Python 3:

参考:https://amon.org/python

安装 yaml 模块:

pip install pyyaml

【安装】

参考:https://mod.gnutls.org/wiki/develop

下载:https://mod.gnutls.org/downloads/

wget https://mod.gnutls.org/downloads/mod_gnutls-0.11.0.tar.bz2 && tar -xjvf mod_gnutls-0.11.0.tar.bz2 && cd mod_gnutls-0.11.0
export LIBGNUTLS_CFLAGS="-I/usr/include/gnutls" LIBGNUTLS_LIBS="-L/usr/lib -lgnutls"
./configure --with-apxs=/usr/local/apache2/bin/apxs
make && make install

配置信息:

Configuration summary for mod_gnutls:

   * mod_gnutls version:        0.10.0
   * Apache Modules directory:  /usr/local/apache2/modules
   * GnuTLS Library version:
   * CFLAGS for GnuTLS:         -I/usr/include/gnutls
   * LDFLAGS for GnuTLS:        -L/usr/lib -lgnutls
   * SRP Authentication:        no
   * MSVA Client Verification:  no
   * Build documentation:       no

输出:

...
Libraries have been installed in:
   /usr/local/apache2/modules

输出:

编译安装完成。

【验证】

设置Apache,重启Apache之后,查看phpinfo:

...
Apache Environment
Variable	Value
HTTPS 	on
SSL_VERSION_LIBRARY 	GnuTLS/3.6.5
SSL_VERSION_INTERFACE 	mod_gnutls/0.9.0
SSL_PROTOCOL 	TLS1.3 
...

【排错】

make 时报错:gnutls_cache.c:38:10: fatal error: apr_escape.h: No such file or directory

先编译安装apr+apr-util:https://amon.org/apr

wget http://archive.apache.org/dist/apr/apr-1.6.3.tar.bz2 && tar -xjvf apr-1.6.3.tar.bz2 && cd apr-1.6.3 && ./configure –prefix=/usr –disable-static –with-installbuilddir=/usr/share/apr-1/build && make && make install
wget http://archive.apache.org/dist/apr/apr-util-1.6.1.tar.bz2 && tar -xjvf apr-util-1.6.1.tar.bz2 && cd apr-util-1.6.1 && ./configure –prefix=/usr –with-apr=/usr –with-gdbm=/usr –with-openssl=/usr –with-crypto && make && make install

注意:低版本缺失此文件。

问题解决!