大體流程:
1. 先建立一把 private key 預備提供給 SSL 憑證簽名要求所用;
2. 最後建立 SSL 憑證 (test certificates)。
建立憑證文件
[root@bird certs]# cd /etc/pki/tls/certs/
[root@bird certs]# make xxx.key
[root@bird certs]# mv xxx.key xxx.key.raw
[root@bird certs]# openssl rsa -in xxx.key.raw -out xxx.key
[root@bird certs]# rm -f xxx.key.raw
[root@bird certs]# chmod 400 xxx.key
[root@bird certs]# make xxx.crt SERIAL=隨即數字 (避免本機生成多個crt 瀏覽器識別時會有錯誤)
根據提示輸入
[root@bird certs]# ll xxx.*
-rw-------. 1 root root 1407 11月 26 07:53 xxx.crt
-r--------. 1 root root 1675 11月 26 07:49 xxx.key
修改ssl.conf內容 使用自制憑證
[root@www ~]# vim /etc/httpd/conf.d/ssl.conf
SSLCertificateFile /etc/pki/tls/certs/xxx.crt <==約在 105 行
SSLCertificateKeyFile /etc/pki/tls/certs/xxx.key <==約在 112 行
不過一般還是選擇購買