<b>Resin HTTPS </b><b>安裝指南</b>
一. 前提
請使用resin 的 2.x 版本,因為resin 3.x 隻有 professional 版本才支援 HTTPS。
二. 安裝步驟
1. 安裝openssl:
# tar –zxvf openssl-xxx.tar.gz
# cd openssl-xxx
# ./config –prefix=/usr/local/openssl shared
# make && make install
2. 安裝resin:
# mv resin-<version>.tar.gz /usr/local/src
# tar –zxvf resin-<version>.tar.gz
# cd resin-<version>
# ./configure \
–prefix=/usr/local/resin-<version> \
–enable-netscape-ssl \
–with-openssl=/usr/local/openssl
# make && make install
# cd /usr/local
# ln –s resin-<version> resin
3. 建立存放private key 和 certificate 的目錄
#export RESIN_HOME=/usr/local/resin
# mkdir $RESIN_HOME/keys
4. 生成private key 和 certificate
# export PATH=/usr/local/openssl/bin:$PATH
# cd $RESIN_HOME/keys
# openssl genrsa –des3 –out test.key 1024
請按提示輸入private key 的 passphrase(假設為mykey)
# openssl req –new –key test.key -x 509 –out test.crt
當提示輸入 private key 的 passprase 的時候,輸入mykey;
請按提示輸入 country, province, city, organization, distinct name(本機的FQDN) and email address.
如果要使用商業證書,那麼可以生成一個證書請求:
#openssl req -new -key test.key -out cert.csr
然後拿着這個檔案去數字證書頒發機構(即CA)申請一個數字證書。
5. 修改resin.conf
<http port='443'>
<ssl>openssl</ssl>
<certificate-file>keys/test.crt</certificate-file>
<certificate-key-file>keys/test.key</certificate-key-file>
<key-store-password>mykey</key-store-password>
</http>
6. 删除stderr.log和stdout.log, 啟動resin
三. 測試:
1. 檢視stdderr.log, 确定沒有錯誤提示,
檢視 stdout.log, 确定HTTPS在443端口上監聽.
2. #openssl s_client –host <本機的FQDN> -port 443
如果HTTPS在正常運作, 我們應該可以看到SSL的協商資訊.
3. 在浏覽器中使用HTTPS協定通路我們的HTTPS 站點, 如果HTTPS在正常運作,
我們該可以看到一個視窗, 提示我們說我們的HTTPS 站點的 certificate 有問題
(當然,如果使用的是商業證書,不會提示有問題), 點選”是”或”yes”, 就可以看到
我們的站點了.
注:FQDN, 全限定域名,形如 [url]www.cisco.com[/url]
本文轉自zkjian517 51CTO部落格,原文連結:http://blog.51cto.com/zoukejian/57021