Centos7 安装 Openssl 和 Nginx

news/2024/10/26 10:46:43/

1. Openssl 回退低版本安装openssl-1.0.0h

openssl 默认安装版本:openssl version

OpenSSL 1.0.2k-fips 26 Jan 2017

所有版本的openssl

yum install gcctar -zxvf openssl-1.0.0h.tar.gz./config --prefix=/usr/local/ssl# 错误处理wget https://www.cpan.org/src/5.0/perl-5.28.0.tar.gz #下载压缩包tar -zxvf perl-5.28.0.tar.gzcd perl-5.28.0./Configure -des -Dprefix=$HOME/localperlmakemake testmake install# 回到openssl目录:
[root@localhost openssl-1.0.0h]# make && make install#安装完成# 3. 将旧的openssl执行文件及目录重命令mv -f /usr/bin/openssl /usr/bin/openssl.oldmv -f /usr/include/openssl /usr/include/openssl.old# 4. 修改软链,指向新版本的openssl路径ln -s /usr/local/ssl/bin/openssl /usr/bin/opensslln -s /usr/local/ssl/include/openssl /usr/include/openssl# 5. 添加so库的路径,添加完成之后,运行ldconfig ,将新增的so 文件缓存到/etc/ld.so.cache中echo "/usr/local/ssl/lib">>/etc/ld.so.confldconfig -v# 6. 执行查看版本openssl版本[root@localhost openssl-1.0.0h]# openssl version -aOpenSSL 1.0.0h 12 Mar 2012built on: Fri Sep 13 09:27:03 CST 2024platform: linux-x86_64# 7. 完成

2. 升级安装新版本openssl

yum install gcc
yum -y install perl-IPC-Cmd
yum install perl-Data-Dumpertar  -zxvf openssl-3.3.1.tar.gz 
cd openssl-3.3.1/
./config   --prefix=/opt/openssl-3.3.1
make
make installvim /etc/profile # 添加如下内容
export PATH=/opt/openssl-3.3.1/bin:$PATH
export LD_LIBRARY_PATH=/opt/openssl-3.3.1/lib:$LD_LIBRARY_PATH#执行 
source /etc/profile

3. 密openssl安装

一、下载openssl国密版:https://www.gmssl.cn/gmssl/index.jsp

1) 下载gmssl_openssl_1.1_b7.tar.gz到/root/下

2) 解压 tar xzfm gmssl_openssl_1.1_b7.tar.gz -C /usr/local

3) 下载nginx-1.18.0.tar.gz到/root/下

4) 解压 tar xzfm nginx-1.18.0.tar.gz

5) 进入目录 cd /root/nginx-1.18.0,安装 pcre pcre-devel zlib等依赖库

命令:yum install -y pcre pcre-devel

命令:yum install -y zlib zlib-devel

4. 安装Nginx

(1)官网下载Nginx Nginx官网

(2) 解压

 tar zxvf nginx-1.24.0.tar.gz 

(3)开始编译,执行./configure

  1. 备注:nginx使用yum源安装,可能导致业务上很多需要的功能模块没有开启,还是按需自己编译比较合适。

  2. ./configure --help #查看./configure 支持哪些参数#--prefix=/usr/local/nginx --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_stub_status_module# ./configure --prefix=/usr/local/nginx --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_stub_status_module --with-openssl=/opt/openssl-3.3.1/bin/openssl --with-openssl-opt='enable-tls1_3'# ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_stub_status_module./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_stub_status_module --with-openssl=/usr/local/ssl#[ error ]./configure: error: the HTTP rewrite module requires the PCRE library.yum -y install pcre-devel#[ error ]./configure: error: the HTTP gzip module requires the zlib library.yum install -y zlib-develmakemake install

    出现找不到目录的错误:nginx 安装目录中的 auto/lib/openssl/conf 去掉.openssl

 # 打开环境变量配置文件

vim /etc/profile

# 在文件末尾添加如下内容,指向nginx的安装目录

PATH=$PATH:/usr/local/nginx/sbin

# 重新加载使修改生效

source /etc/profile


http://www.ppmy.cn/news/1542092.html

相关文章

用PHP写一个EACO(drc20)写一个和狗狗币,比特币,avax, bnb,eth,sol,usdt,等全球前30大数字货币的兑换去中心化小程序。

创建一个简单的PHP小程序,用于EACO(DRC20)与全球前30大数字货币(如狗狗币、比特币、AVAX、BNB、ETH、SOL、USDT等)进行去中心化兑换的功能,需要集成加密货币的API接口来获取实时汇率和执行兑换操作。以下是…

SSH流量秒变HTTPS —— 筑梦之路

背景说明 很多时候对外开放仅有80 443端口,若想要ssh服务器是比较困难的。这里介绍使用opensslHAProxy绕过限制。 解决思路 把SSH流量伪装成HTTPS流量,从443端口传输。 OpenSSL: 一个强大的开源加密工具包,我们用它来给SSH流量加密,让它看起来像HTTPS。 HAProxy…

Win/Mac/Android/iOS怎麼刪除代理設置?

設置代理設置的主要構成 IP 地址和端口 這些是代理伺服器配置的最基本組件。代理伺服器的IP地址引導互聯網流量,而端口號指定伺服器上的通信通道。 為什麼要刪除代理設置? 刪除代理設置通常是為了解決網路問題、提高速度、恢復安全性或過渡到新的網路…

【IEEE独立出版 | 厦门大学主办】第四届人工智能、机器人和通信国际会议(ICAIRC 2024)

第四届人工智能、机器人和通信国际会议(ICAIRC 2024)定于2024年12月27-29日在中国厦门举行。会议旨在为从事“人工智能、机器人和通信”研究的专家学者、工程技术人员、技术研发人员提供一个共享科研成果和前沿技术,了解学术发展趋势&#xf…

C#从零开始学习(用户界面)(unity Lab4)

这是书本中第四个unity Lab 在这次实验中,将学习如何搭建一个开始界面 分数系统 点击球,会增加分数 public void ClickOnBall(){Score;}在OneBallBehaviour类添加下列方法 void OnMouseDown(){GameController controller Camera.main.GetComponent<GameController>();…

提示词高级阶段学习day3.1什么是结构化 Prompt ?

什么是结构化 Prompt &#xff1f; 结构化的思想很普遍&#xff0c;结构化内容也很普遍&#xff0c;我们日常写作的文章&#xff0c;看到的书籍都在使用标题、子标题、段落、句子等语法结构。结构化 Prompt 的思想通俗点来说就是像写文章一样写 Prompt。 为了阅读、表达的方便…

Jmeter实际应用

环境准备 JDK1.8Jmeter 5.6.3 下载地址Jmeter 插件 下载地址 放到lib/ext下 常用命令 # 启动 sh jmeter# 集群模式下启动节点&#xff0c;不启动用不了集群 sh jmeter-server#生成ssl需要的证书, 这里会要求输入个密码&#xff0c;是要在jmeter中用的 keytool -import -ali…

使用 Cursor 和 Devbox 快速开发基于 Rust 的 WASM 智能合约

本教程以一个智能合约&#xff08;使用 NEAR 的一个官方 Fungible Tokens 来实现&#xff09;的例子来介绍一下 Devbox 的强大功能&#xff0c;轻松构建环境&#xff0c;轻松发布。 NEAR 是一个去中心化的应用平台&#xff0c;使用了分片技术的区块链。 免责申明&#xff1a;本…