第一步 申請本地證書
1. openssl 之類的軟件我就不多說,系統自帶的,如果不帶,自己 yum 下
[root@e2fsck ~]# openssl genrsa -des3 -out e2fsck.org.key 2048Generating RSA private key, 1024 bit long modulus………..++++++………..++++++e is 65537 (0×10001)Enter pass phrase for e2fsck.org.key: 輸入密碼Verifying – Enter pass phrase for e2fsck.org.key: 輸入密碼[root@e2fsck ~]# openssl req -new -key e2fsck.org.key -out e2fsck.org.csrEnter pass phrase for e2fsck.org.key: 輸入密碼You are about to be asked to enter information that will be incorporatedinto your certificate request.What you are about to enter is what is called a Distinguished Name or a DN.There are quite a few fields but you can leave some blankFor some fields there will be a default value,If you enter ‘.', the field will be left blank.—–Country Name (2 letter code) [XX]:CNState or Province Name (full name) []:JSLocality Name (eg, city) [Default City]:SZOrganization Name (eg, company) [Default Company Ltd]:e2fsckOrganizational Unit Name (eg, section) []:e2fsck.orgCommon Name (eg, your name or your server's hostname) []:*.e2fsck.orgEmail Address []:root@e2fsck.orgPlease enter the following ‘extra' attributesto be sent with your certificate requestA challenge password []: 直接回車An optional company name []: 直接回車[root@e2fsck ~]# openssl rsa -in e2fsck.org.key -out e2fsck.org_nopass.keyEnter pass phrase for e2fsck.org.key: 輸入上面的密碼writing RSA key[root@e2fsck ~]# lse2fsck.org.csr e2fsck.org.key e2fsck.org_nopass.key
第二步 去 startssl 申請免費證書
1. 登錄官方網站 http://www.startssl.com/?app=0
2. 選擇 Control Panel(右上角) 然后選擇 Express Lane(最下面的大圖標)
3. 填寫注冊信息(盡量真實,不然難通過),然后就去郵件等,是 2 封郵件,第二封郵件帶一個地址,登錄即可
4. 進去后,做 下一步 之類的簡單事情后,選擇 Certificates Wizard
5. Certificate Target: 這里選擇 Web Server SSL/TLS Certificate
6. 這里選擇 Skip 因為 第一步 的時候配置好了
7. 這里把 第一步 中的 e2fsck.org.csr 內容粘貼到這里
8. 然后就是下一步,添加域名什么的簡單的事情
9. 最后看到一段代碼就是 crt 證書了,保存下來,我這里取名為 e2fsck.org.crt 然后把它放到 /usr/local/nginx/conf 目錄(你放哪隨便)
10. 為了使部分瀏覽器能夠識別證書,還得把 CA 根證書與我們的證書和并
[root@e2fsck ~]# cd /usr/local/nginx/conf/ #我這里把證書都放在了這個目錄[root@e2fsck conf]# wget http://cert.startssl.com/certs/ca.pem[root@e2fsck conf]# wget http://cert.startssl.com/certs/sub.class1.server.ca.pem[root@e2fsck conf]# cp e2fsck.org.crt e2fsck.org.bak #先備份下[root@e2fsck conf]# cat ca.pem sub.class1.server.ca.pem >> e2fsck.org.crt
新聞熱點
疑難解答