1. 程式人生 > >https 之 ssl安全證書的獲取和安裝

https 之 ssl安全證書的獲取和安裝

基於便宜ssl生成ssl證書 然後再apace配置達到HTTPS協議 1.在便宜平臺註冊賬號 賬號可以選擇是否免費體驗ssl




2.在便宜平臺完成資訊後現在進入csr(自動生成)生成提交頁面

3.提交後有三種域名驗證方式 ( 推薦第三種) 總結就一個模式將獲取到的驗證檔案放在一個目錄下讓別人能夠在外網訪問到
4.請求訪問驗證檔案後等待(時間有點略長)成功後會返回給一個包含server.crt 和 server.key的資料夾
5.將server.crt和server.key放在你apace的配置檔案

*6.接下來配置 (重要) 1)配置 httpd.conf. 在 httpd.conf 中給下面幾句取消註釋: LoadModule socache_shmcb_module modules/mod_socache_shmcb.so LoadModule ssl_module modules/mod_ssl.so Include conf/extra/httpd-ssl.conf 2)對Apache的conf\extra目錄下的 httpd_ssl.conf 文進行配置  
在conf\extra目錄下,編輯 httpd_ssl.conf ###########################開始############################# #相同的部分沒給出Listen 443SSLPassPhraseDialog  builtin#SSLSessionCache "dbm:D:/Program/Apache Software/Apache2.2.17/logs/ssl_scache"SSLSessionCache "shmcb:D:/Program/Apache Software/Apache2.2.17/logs/ssl_scache(51200)"(以上2種請自行監測,如有一種導致伺服器啟動不了,就換成另一種)SSLSessionCacheTimeout  300       <VirtualHost _default_:443># General setup for the virtual host  DocumentRoot "D:/PHPStudy/WWW/phpSSL"  ServerName  phpssl.com:443  ErrorLog "D:/PHPStudy/Apache/logs/no-robots_error.log.txt"  TransferLog "D:/PHPStudy/Apache/logs/no-robots_access.log.txt"    SSLCertificateFile "D:/PHPStudy/Apache/conf/tian_server.crt"  SSLCertificateKeyFile "D:/PHPStudy/Apache/conf/tian_server.key"    CustomLog "D:/PHPStudy/Apache/logs/ssl_request.log" 
\"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" #################################結束################################## *注意路徑一定要是自己檔案的路徑,尤其是日誌檔案的路徑

7.重啟伺服器+測試