一、首先必須已經安裝了Apache,接著進行下面步驟
1.首先切換到Apache的bin目錄
這裡的apache的目錄在D:\Program Files (x86)\Apache Software
Foundation\Apache2.2\
2.使用OpenSSL建立『server.key』私鑰檔案,並輸入自訂短密碼
openssl genrsa -des3 -out server.key 2048
3.使用私鑰去建立『server.csr』憑證請求檔
openssl req -new -key server.key -out
server.csr -config ..\conf\openssl.cnf
4.在建立憑證請求檔時會詢問相關資訊
Country Name (2 letter code) [AU]:所在國家簡寫
State or Province Name (full name)
[Some-State]:所在國家
Locality Name (eg, city) []:所在城市
Organization Name (eg, company) [Internet
Widgits Pty Ltd]:公司名稱
Organizational Unit Name (eg, section) []:組織名稱
Common Name (e.g. server FQDN or YOUR name)
[]:網址名稱
Email Address []:聯絡人信箱
5.使用憑證請求檔及私鑰檔去建立3650天的X.509格式憑證的CRT憑證檔
openssl x509 -req -days 3650
-in server.csr -signkey server.key -out server.crt
7.打開『httpd.conf』檔案找到以下兩句並取消註解
Include ./conf/extra/httpd-ssl.conf
<<這裡是ssl設定檔的位置>>
8.打開ssl設定檔,
#SSLSessionCache "shmcb:d:/Program Files
(x86)\Apache Software Foundation\Apache2.2\logs\ssl_scache(512000)"
二、可能遇到的問題
由於windows不支援加密解密所以在log會看到
SSLPassPhraseDialog
builtin is not supported on Win32 ................
解決方式:
1、複製 server.key 為 server.key.org
2、對 server.key.org 解密 openssl rsa -in server.key.org -out server.key 輸入密碼解密成功
3、打開 httpd-ssl.conf 找到 SSLPassPhraseDialog builtin 在前面加上#
2、對 server.key.org 解密 openssl rsa -in server.key.org -out server.key 輸入密碼解密成功
3、打開 httpd-ssl.conf 找到 SSLPassPhraseDialog builtin 在前面加上#
沒有留言:
張貼留言