标签 版本 下的文章

CentOS7平滑升级Nginx版本并启用TLS1.3

一、升级Nginx

查看当前OpenSSL版本

openssl version

OpenSSL 1.0.2k-fips 26 Jan 2017

由于TLS1.3需要OpenSSL1.1.1及以上版本支持,如果版本过低,可参考升级OpenSSL版本

查看当前Nginx版本信息

/usr/local/nginx/sbin/nginx -V

nginx version: nginx/1.21.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --add-module=../nginx_mod_h264_streaming-2.2.7 --with-pcre=../pcre-8.43 --with-zlib=../zlib-1.2.11 --user=www --group=www --with-http_flv_module --with-http_stub_status_module --with-threads --with-http_ssl_module --with-openssl-opt='enable-tls1_3 enable-weak-ssl-ciphers' --with-http_v2_module --with-http_mp4_module --with-cc-opt=-O3

下载新版nginx、解压并进入解压后的目录

- 阅读剩余部分 -

为CentOS7升级gcc至10.x

yum -y install centos-release-scl
yum -y install devtoolset-10-gcc*
scl enable devtoolset-10 bash

需要注意的是scl命令启用只是临时的,退出shell或重启就会恢复原系统gcc版本。
如果要永久生效的话,执行:

echo "source /opt/rh/devtoolset-10/enable" >>/etc/profile