在 Linux 系统下安装和配置 Nginx·上篇
来源:靑龍一笑的博客 作者:靑龍一笑 发布时间:2017-01-06 12:49:57 点击量:1510 评论:0
一、使用 OpenSSL 建立自己的证书
[root@RicenOS ~]# mkdir -pv /opt/webca
[root@RicenOS ~]# cd /opt/webca/
[root@RicenOS ~]# cd /opt/webca/
1、生成 RSA 密钥
[root@RicenOS webca]# openssl genrsa -des3 -out ca.key 2048
以下输入并确认密码:P@ssw0rd
Enter pass phrase for ca.key:
Verifying - Enter pass phrase for ca.key:
Verifying - Enter pass phrase for ca.key:
2、生成一个不需要输入密码的密钥文件
[root@RicenOS webca]# openssl rsa -in ca.key -out ca_nopass.key
以下输入刚才设置的密码:P@ssw0rd
Enter pass phrase for ca.key:
3、生成一个证书请求:
[root@RicenOS webca]# openssl req -new -key ca.key -out ca.csr
以下输入刚才设置的密码:P@ssw0rd
Enter pass phrase for ca.key:
以下输入国家:CN
Country Name (2 letter code) [XX]:CN
以下输入省份:FuJian
State or Province Name (full name) []:FuJian
以下输入城市:XiaMen
Locality Name (eg, city) [Default City]:XiaMen
以下输入公司:RicenSoftwares
Organization Name (eg, company) [Default Company Ltd]:RicenSoftwares
以下输入部门(可以不填):Technology Department
Organizational Unit Name (eg, section) []:Technology Department
以下输入姓名(可以不填):Ricen
Common Name (eg, your name or your server's hostname) []:Ricen
以下输入邮箱:C.S.Ricen@ricensoftwares.com.cn
Email Address []:C.S.Ricen@ricensoftwares.com.cn
以下两项可以不填:
A challenge password []:
An optional company name []:
An optional company name []:
4、签发证书
[root@RicenOS webca]# openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt
以下输入前面设置的密码:P@ssw0rd
Enter pass phrase for ca.key:
未完,请继续浏览《在 Linux 系统下安装和配置 Nginx·中篇》
版权所有 © 2005-2023 靑龍一笑的博客 Powered by C.S.Ricen
Copyright © 2005-2023 by www.ricensoftwares.com.cn All Rights Reserved.
Copyright © 2005-2023 by www.ricensoftwares.com.cn All Rights Reserved.