SSL安装完全手册-亲测可用

1.安装openssl 相关基础软件 – 如已安装可跳过,配置nginx时报以下错误信息,是因为服务器安装openssl基础软件

/configure

时提示以下错误:

./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using –with-openssl= option.

解决方法:

执行以下命令:

yum -y install openssl openssl-devel
执行成功之后再执行
./configure

Configuration summary
+ using system PCRE library
+ using system OpenSSL library
+ md5: using OpenSSL library
+ sha1: using OpenSSL library
+ using system zlib library
+ jemalloc library is disabled

nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx dso module path: "/usr/local/nginx/modules/"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
看到最后这样的输出,就是配置成功了。

2.SSL证书安装指南

通过SSL证书服务购买并签发证书后,您可以通过SSL证书控制台将已签发的证书下载到本地,并根据需要将证书安装到要使用证书的环境。

前提条件

已通过SSL证书服务购买并签发下载证书。

在服务器上安装证书

通过SSL证书控制台下载证书到本地后,您还需要将已下载的证书上传到Web服务器并修改服务器的相关配置,才能使SSL证书生效。

不同Web服务器安装SSL证书的具体操作不同。以下内容介绍了在主流Web服务器上安装SSL证书的方法。

3.安装Nginx 配置SSL插件

通过SSL证书服务购买和签发证书后,您可以将已签发的证书下载并安装到Nginx(或Tengine)服务器上。本文介绍了下载SSL证书并在Nginx(或Tengine)服务器上安装证书的具体操作。

背景信息

本文以CentOS 8操作系统、Nginx 1.14.1服务器系统为例进行说明。由于服务器系统版本不同,您在操作过程中使用的命令可能会略有区别。

本文中出现证书文件名称的地方,统一使用cert-file-name为例进行描述。例如,本文中用到的证书文件为cert-file-name.pem、证书密钥文件为cert-file-name.key。

注意 您在实际操作过程中,需要根据示例代码中的提示,将cert-file-name替换成您的证书文件的名称。关于如何获取证书文件的名称,请参见步骤1。

步骤1:下载证书到本地

步骤2:(可选)在Nginx独立服务器上安装证书

步骤2:(可选)为Nginx虚拟主机配置SSL证书

步骤3:验证是否安装成功

证书安装完成后,您可通过访问证书的绑定域名验证该证书是否安装成功。放大查看复制代码

https://yourdomain.com #需要将yourdomain.com替换成证书绑定的域名。

如果网页地址栏出现小锁标志,表示证书已经安装成功。

不同类型证书安装成功后的效果不同,具体如下:

  • DV SSL、OV SSL数字证书部署在服务器上后,您的浏览器访问网站时,将会展示以下效果。

    DV/OV证书安装效果图

  • EV SSL数字证书部署在服务器上后,您的浏览器访问网站时,将会展示以下效果。

    EV证书安装效果图

如果验证时出现访问异常,请参照下表进行排查。放大查看

相关文档

原文链接:https://blog.csdn.net/zhenlong_qu/article/details/121074256

© 版权声明
THE END
喜欢就支持一下吧
点赞6 分享