comodo 憑證核發的信件中,會有一個zip 壓縮檔附件
裡面會有包含以下幾個檔案
Root CA Certificate - AddTrustExternalCARoot.crt
Intermediate CA Certificate - COMODORSAAddTrustCA.crt
Intermediate CA Certificate - COMODORSADomainValidationSecureServerCA.crt
Your PositiveSSL Wildcard Certificate - STAR_example_com.crt
Apache:
1. mkdir -p /usr/local/etc/apache22/ssl/example.com/
2. 將所有檔案連同之前產生的 key 複製到該資料匣
3. cat COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt AddTrustExternalCARoot.crt > ssl-bundle.crt
4. 編輯apache 設定檔
SSLCertificateFile /usr/local/etc/apache22/ssl/example.com/STAR_example_com.crt
SSLCertificateKeyFile /usr/local/etc/apache22/ssl/example.com/example.com.key
SSLCertificateChainFile /usr/local/etc/apache22/ssl/example.com/ssl-bundle.crt
5. 重啟apache
apachectl restart
Nginx:
1. mkdir -p /etc/nginx/ssl/example.com/
2. 將所有檔案連同之前產生的 key 複製到該資料匣
3. cat STAR_example_com.crt COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt AddTrustExternalCARoot.crt > ssl-bundle.crt
4. 編輯nginx 設定檔
server {
listen 443 ssl;
server_name www.example.com
ssl on;
ssl_certificate /etc/nginx/ssl/example.com/ssl-bundle.crt;
ssl_certificate_key /etc/nginx/ssl/example.com/example.com.key;
5. 重啟nginx
systemctl restart nginx
不論是 apache 或是 nginx ,如果有多個virtualhost, 記得每個virtualhost 都要寫入憑證的設定
確定啟動都正常,並且可以正常瀏覽後
以下線上工具可以協助測試安裝的憑證是否正確
https://www.digicert.com/help/
https://www.sslshopper.com/ssl-checker.html
Nginx技術手札:網頁伺服器應用全攻略
作者: 苗澤
出版社:上奇資訊
出版日期:2017/02/23
語言:繁體中文
定價:580元
留言列表