存档在 ‘【技术】’ 分类

怎样编译安装mod_gnutls

2017年11月29日

【介绍】

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

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

【编译】

git clone https://mod.gnutls.org/git/mod_gnutls && cd mod_gnutls
autoreconf -fiv
export LIBGNUTLS_CFLAGS="-I/usr/include/gnutls" LIBGNUTLS_LIBS="-L/usr/lib -lgnutls" 
./configure --with-apxs=/usr/local/apache2/bin/apxs --with-apu-config=/usr/bin/apu-1-config
make && make install

输出:

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

编译安装完成。

怎样编译安装gnutls

2017年11月29日

【介绍】

官网:https://gitlab.com/gnutls/gnutls

参考:http://linuxfromscratch.org/blfs/view/svn/postlfs/gnutls.html
参考:http://gnutls.org/manual/gnutls.html

【编译】

依赖:Nettle-3.3
参考:https://amon.org/nettle

依赖:Certificate Authority Certificates
参考:http://amon.org/ca-bundle

依赖:libunistring-0.9.7
参考:https://amon.org/libunistring

依赖:libtasn1-4.12
参考:https://amon.org/libtasn1

依赖:p11-kit-0.23.9
参考:https://amon.org/p11-kit

wget https://www.gnupg.org/ftp/gcrypt/gnutls/v3.6/gnutls-3.6.1.tar.xz && xz -d gnutls-3.6.1.tar.xz && tar -xvf gnutls-3.6.1.tar && cd gnutls-3.6.1
export NETTLE_CFLAGS="-I/usr/include/nettle" NETTLE_LIBS="-L/usr/lib64 -lnettle" HOGWEED_CFLAGS="-I/usr/include/nettle" HOGWEED_LIBS="-L/usr/lib64 -lhogweed" P11_KIT_CFLAGS="-I/usr/include/p11-kit-1/p11-kit" P11_KIT_LIBS="-L/usr/lib -lp11-kit" LIBTASN1_CFLAGS="-I/usr/include" LIBTASN1_LIBS="-L/usr/lib -ltasn1" GMP_CFLAGS="-I/usr/local/include" GMP_LIBS="-L/usr/local/lib -lgmp"
./configure --prefix=/usr --with-default-trust-store-file=/etc/ssl/ca-bundle.crt --enable-gtk-doc --enable-openssl-compatibility --enable-local-libopts --with-included-unistring
make
make check
make install

make时报错:

./../pkcs11_int.h:27:28: fatal error: p11-kit/pkcs11.h: No such file or directory
 #include <p11-kit/pkcs11.h>

缺少还是没找到,那就复制过来:

cp -R /usr/include/p11-kit-1/p11-kit /root/gnutls-3.6.1/lib/p11-kit

输出:

----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib

...
/usr/bin/mkdir -p '/usr/lib/pkgconfig'
 /usr/bin/install -c -m 644 gnutls-dane.pc '/usr/lib/pkgconfig'
...
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib/guile/2.0
...
 /usr/bin/mkdir -p '/usr/share/guile/site/2.0/gnutls'

更新系统动态连接库配置:

echo /usr/lib >> /etc/ld.so.conf && ldconfig

查看版本:

gnutls-cli -v

输出:

gnutls-cli 3.6.1
Copyright (C) 2000-2017 Free Software Foundation, and others, all rights reserved.
This is free software. It is licensed for use, modification and
redistribution under the terms of the GNU General Public License,
version 3 or later <http://gnu.org/licenses/gpl.html>


Please send bug reports to:  <bugs@gnutls.org>

相关路径:

/usr/include/gnutls/gnutls.h
/usr/lib/libgnutls.so.30.8.1

环境参数:

LIBGNUTLS_CFLAGS="-I/usr/include/gnutls" LIBGNUTLS_LIBS="-L/usr/lib -lgnutls" 

编译安装完成。

怎样编译安装OpenSSL

2017年11月29日

参考:https://amon.org/openssl-2016

【卸载】

查看当前版本:

openssl version

卸载低版本:

如果有通过yum/rpm安装的openssl,需要先卸载:

rpm -e --nodeps openssl && rpm -e --nodeps openssl-devel

【编译】

流程A:编译安装OpenSSL

官网:https://www.openssl.org/
下载:https://www.openssl.org/source/
参考:http://linuxfromscratch.org/blfs/view/svn/postlfs/openssl.html

最新版本:OpenSSL 1.0.2m

wget http://www.openssl.org/source/openssl-1.0.2m.tar.gz && tar zxvf openssl-1.0.2m.tar.gz && cd openssl-1.0.2m
./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib shared zlib-dynamic
make && make test
sed -i 's# libcrypto.a##;s# libssl.a##;/INSTALL_LIBS/s#libcrypto.a##' Makefile
make MANSUFFIX=ssl install

输出:

...
installing libcrypto.so.1.0.0
installing libssl.so.1.0.0
make[1]: Entering directory `/usr/lib'
make[2]: Entering directory `/usr/lib'
make[2]: Leaving directory `/usr/lib'
make[2]: Entering directory `/usr/lib'
make[2]: Leaving directory `/usr/lib'
make[1]: Leaving directory `/usr/lib'
cp libcrypto.pc /usr/lib/pkgconfig
chmod 644 /usr/lib/pkgconfig/libcrypto.pc
cp libssl.pc /usr/lib/pkgconfig
chmod 644 /usr/lib/pkgconfig/libssl.pc
cp openssl.pc /usr/lib/pkgconfig
chmod 644 /usr/lib/pkgconfig/openssl.pc

更新系统动态连接库配置:

echo /usr/lib >> /etc/ld.so.conf && ldconfig

查看版本

查看版本(shell):

openssl version

输出:

OpenSSL 1.0.2m  2 Nov 2017

注意:需要重新编译php才能更新头信息

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

查看版本(phpinfo):

openssl
OpenSSL support 	enabled
OpenSSL Library Version 	OpenSSL 1.0.2l 26 Sep 2016
OpenSSL Header Version 	OpenSSL 1.0.2l 26 Sep 2016

显示版本已经一致。

如果不一致,可能是在升级OpenSSL之后,没有重新编译PHP。

相关文件路径:

/etc/ssl/openssl.cnf
/usr/include/openssl
/usr/lib/engines
/usr/lib/libssl.so.1.0.0
/usr/lib/libcrypto.so.1.0.0

安装完成。

编译B:编译安装OpenSSL

wget https://www.openssl.org/source/openssl-1.0.2k.tar.gz && tar -zxf openssl-1.0.2k.tar.gz && cd openssl-1.0.2k
./config --prefix=/usr/local/openssl -fPIC
make -j && make install

【报错】

编译spdylay时报错:

spdylay_ssl.h:36:25: fatal error: openssl/ssl.h: No such file or directory

只要yum安装openssl-devel即可解决问题,而且不与编译版的openssl冲突。

怎样使用阿里云ECS

2017年11月29日

【重装系统】

1. 选择ECS
2. 停止
3. 重新初始化磁盘

【更换公网IP】

参考:https://yq.aliyun.com/ask/1867
参考:http://www.cnblogs.com/flowerszhong/p/5703368.html

需要购买弹性公网IP服务?

WP主题:HelpGuru

2017年11月28日

官网:https://themeforest.net/item/helpguru-a-selfservice-knowledge-base-wordpress-theme/8465592
演示:

应用:http://openlaw.cn/

下载:https://www.freedownloadify.org/news/1495620/download-themeforest-helpguru-v1-7-0-a-self-service-knowledge-base-wordpress-theme-nulled-php
下载:https://www.ruluthemes.com/helpguru-v1-7-0-a-wordpress-self-service-knowledge-base-theme/
下载:http://vganull.com/themeforest-helpguru-v1-7-0-a-self-service-knowledge-base-wordpress-theme-8465592-free-downl
下载:http://ar-sh.com/helpguru-v170-a-self-service-knowledge-base-wordpress-theme