标签:
1.查看是否安装httpd和SSL(如果有就可以进行下一步)
[root @localhost ~]# rpm -qa | grep httpd httpd-tools- 2.2 . 15 - 47 .el6.centos. 4 .x86_64 [root @localhost ~]# rpm -qa | grep ssl openssl- 1.0 .1e- 42 .el6_7. 4 .x86_64 openssl-devel- 1.0 .1e- 42 .el6_7. 4 .x86_64 docbook-style-dsssl- 1.79 - 10 .el6.noarch mod_ssl- 2.2 . 15 - 47 .el6.centos. 4 .x86_64 nss_compat_ossl- 0.9 . 6 - 1 .el6.x86_64 |
2.生成服务器私钥
[root @localhost /]# cd /etc/pki/tls [root @localhost tls]# openssl genrsa -out server.key 1024 Generating RSA private key, 1024 bit long modulus .............++++++ ...........................++++++ e is 65537 ( 0x10001 ) |
3.用私钥server.key文件生成证书请求文件csr
[root @localhost tls]# openssl req - new -key server.key -out server.csr Country Name ( 2 letter code) [XX]:China string is too long , it needs to be less than 2 bytes long Country Name ( 2 letter code) [XX]:CN State or Province Name (full name) []:zhejiang Locality Name (eg, city) [Default City]:hangzhou Organization Name (eg, company) [Default Company Ltd]:CQ Organizational Unit Name (eg, section) []:cqxx Common Name (eg, your name or your server‘s hostname) []:www.jbhjbh.com Email Address []:cuilingli @jbhjbh .com |
上面的步骤完成之后会让你输入一个密码:
A challenge password []: An optional company name []: |
不用理他直接回车
4.生成证书文件
[root @localhost tls]# openssl x509 -days 365 -req -in server.csr -signkey server.key -out server.crt |
结果如下
Signature ok subject=/C=CN/ST=zhejiang/L=hangzhou/O=CQ/OU=cqxx/CN=www.jbhjbh.com/emailAddress=cuilingli @jbhjbh .com Getting Private key |
标签:
原文地址:http://www.cnblogs.com/CKiller/p/5355039.html