1. 判断是否有安装openssl

运行命令 operssl version

[root@localhost logs]# openssl version
OpenSSL 1.0.2k-fips  26 Jan 2017
[root@localhost logs]#

如果有以上内容说输出明你已经安装了operssl不用再安装(跳过步骤2),如果没有请进行步骤2的操作
openssl介绍:
OpenSSL是一个开放源代码的软件库包,应用程序可以使用这个包来进行安全通信,避免窃听,同时确认另一端连接者的身份。这个包广泛被应用在互联网的网页服务器上

2. 安装operssl

运行命令 yum -y install operssl openssl-devel

[root@localhost logs]# yum -y install operssl openssl-devel
已加载插件:fastestmirror
Determining fastest mirrors* base: mirrors.njupt.edu.cn* extras: mirrors.163.com* updates: mirrors.njupt.edu.cn
base                                                                                                                                                                              | 3.6 kB  00:00:00
docker-ce-stable                                                                                                                                                                  | 3.5 kB  00:00:00
extras                                                                                                                                                                            | 2.9 kB  00:00:00
updates                                                                                                                                                                           | 2.9 kB  00:00:00
(1/4): updates/7/x86_64/primary_db                                                                                                                                                | 120 kB  00:00:00
(2/4): extras/7/x86_64/primary_db                                                                                                                                                 | 165 kB  00:00:00
(3/4): base/7/x86_64/group_gz                                                                                                                                                     | 153 kB  00:00:00
(4/4): base/7/x86_64/primary_db                                                                                                                                                   | 6.1 MB  00:00:02
没有可用软件包 operssl。
软件包 1:openssl-devel-1.0.2k-19.el7.x86_64 已安装并且是最新版本
无须任何处理

注意:我这里已经时最新版本即没有进行安装操作

3. 判断nginx 是否安装了ssl模块

cd 到nginx的sbin目录下运行命令 ./nginx -V

[root@localhost sbin]# ./nginx -V
nginx version: nginx/1.16.1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
configure arguments: --prefix=/usr/local/nginx/nginx --add-module=./fastdfs-nginx-module-master/src/
[root@localhost sbin]#

查看输出的内容是否有
–with-http_ssl_module
如果有则表没nginx已经安装了ssl模块,如果没有请进行步骤4的操作

4. nginx安装ssl模块

cd到nginx的主目录下,即目录中有configure这个这个文件的目录
首先复制./nginx -V输出的信息中
configure arguments:后面的信息我这里为 --prefix=/usr/local/nginx/nginx --add-module=./fastdfs-nginx-module-master/src/
再其后面添加上 --with-http_ssl_module这段命令即
–prefix=/usr/local/nginx/nginx --add-module=./fastdfs-nginx-module-master/src/ --with-http_ssl_module
再运行如下命令

./configure --prefix=/usr/local/nginx/nginx --add-module=./fastdfs-nginx-module-master/src/ --with-http_ssl_module
注意 ./configure 后的信息即为上面的信息
命令解释:

  1. –prefix=xxx 为当前nginx的安装路径,我这里为/usr/local/nginx/nginx
  2. –add-module=./fastdfs-nginx-module-master/src/ 为fastdfs-nginx模块
  3. -with-http_ssl_module 为安装ssl模块
[root@localhost nginx]# ./configure --add-module=--with-http_ssl_module
checking for OS+ Linux 3.10.0-1062.4.3.el7.x86_64 x86_64
checking for C compiler ... found+ using GNU C compiler+ gcc version: 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
checking for gcc -pipe switch ... found
checking for -Wl,-E switch ... found
... ... ...

运行完以上命令后再运行make命令

[root@localhost nginx]# make
make -f objs/Makefile
make[1]: 进入目录“/usr/local/nginx/nginx”
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \-o objs/src/core/nginx.o \src/core/nginx.c... ... ...

将objs目录下的nginx拷贝到sbin目录中并运行一下命令
并运行如下命令 ./nginx -V

[root@localhost objs]# cp nginx ../sbin/
[root@localhost objs]#
[root@localhost objs]# cd ../sbin/
[root@localhost sbin]# ./nginx -V
nginx version: nginx/1.16.1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx/nginx --with-http_ssl_module
[root@localhost sbin]#

有输出 --with-http_ssl_module 说明ssl安装成功

nginx安装openssl相关推荐

  1. Nginx安装配置OpenSSL

    这里写自定义目录标题 Nginx安装配置OpenSSL Nginx安装配置OpenSSL 1.安装 yum install openssl openssl-devel -y 2.切换到源包 bash ...

  2. nginx安装 问题 1

    ./configure: error: the HTTP rewrite module requires the PCRE library 有时候,我们需要单独安装nginx,来处理大量的下载请求.单 ...

  3. Centos nginx 安装 源码方式安装

    以 yum 方式安装 Nginx https://andyoung.blog.csdn.net/article/details/118802486 安装所需插件 1.安装gcc gcc是linux下的 ...

  4. nginx 安装 虚拟主机

    nginx 安装 安装nginx依赖的库 [root@localhost src]# yum -y install gcc pcre pcre-devel zlib zlib-devel openss ...

  5. 查找nginx安装的路径以及相关安装操作命令

    Linux环境下,怎么确定Nginx是以那个config文件启动的?  [root@localhost ~]# ps -ef | grep nginx root 21196 1 0 23:40 ? 0 ...

  6. nginx安装及编译参数详解

    1.centos下Yum安装 Nginx yum list|grep nginx 发现没有可用的结果 通过创建下面的文件在系统中添加nginx仓库的yum配置 vi /etc/yum.repos.d/ ...

  7. Nginx安装echo模块

    echo-nginx-module 模块可以在Nginx中用来输出一些信息,可以用来实现简单接口或者排错. 项目地址:https://github.com/openresty/echo-nginx-m ...

  8. Nginx安装及其编译命令、详细教程

    文章目录 安装 依赖环境 Nginx安装 1. 下载 2. 解压 3. 配置安装信息 4. 编译安装 5. 启动 命令 命令 启动 停止 从容停止 快速停止 强制停止所有nginx进程 平滑重启 安装 ...

  9. linux nginx 安装stream,Centos7下Nginx简单搭建与stream模块简单配置

    一:Nginx安装 搭建环境:Centos 7 需要软件包:openssl.zlib.pcre.nginx (软件包下载地址个人网盘可能会失效:https://pan.baidu.com/s/1qYN ...

最新文章

  1. java中关于try、catch、finally中的细节分析
  2. 2021-01-07 matlab数值分析 线性方程组的迭代解法 高斯-赛德尔迭代法
  3. Single Area OSPF
  4. Js计算间隔天数和Date对象
  5. Nginx命令配置到系统环境
  6. 路由(二)——动态路由简介与RIP协议
  7. MySQL通过添加索引解决线上数据库服务器压力大问题
  8. es6笔记6^_^generator
  9. iOS开发-View中frame和bounds区别
  10. 真正能挣钱的分析模型有哪些?这三个你绝对要学会
  11. pk8/pem秘钥转keystore格式
  12. Zircon DDK入门指南
  13. Google离去,百度就能制衡?
  14. 《引爆点》——读书笔记
  15. java中超过int的最大范围
  16. DeepFool笔记:对原理的理解和公式推导(多分类)
  17. 《用事实说话》阅读心得
  18. 4个单词,谷歌返回16个SQL注入漏洞
  19. Lua 公历转农历--打表法
  20. MyCat的使用及其项目实战

热门文章

  1. MQ admin 账号登陆失败,RabbitMQ admin 账户默认密码,RabbitMQ 添加admin 账户
  2. 三国杀java游戏_计算机毕业课程设计源码-131Java三国杀游戏控制台版本
  3. HTML+css制作一个简单八卦阵
  4. 关于PC客户端软件开发的一些思考
  5. Datawhale 零基础入门数据挖掘- 建模与调参
  6. compareTo 时间比较
  7. html表头固定原理,表头固定(利用jquery实现原理介绍)
  8. 罗格宣布:俄罗斯索契赢得2014年冬奥会举办权
  9. Jfinal微信公众账号开发笔记
  10. mysql不同情况下加锁类型实验 record lock 和 gap lock