#先復制以下的內容:
[ req ]
default_bits = 1024
distinguished_name= req_distinguished_name
[req_distinguished_name ]
C = 2 letterCountry Code, for example US
C_default =
ST = State orProvince
ST_default =
L = City
L_default =
O = OrganizationName
O_default =
OU = OrganizationalUnit Name, for example 'Marketing'
OU_default =
CN = your domainname, for example www.hogwarts.com
CN_default =
emailAddress = anemail address
emailAddress_default=
#創建文件,添加內容:
Vi /usr/local/resin/keys/openssl.conf
#先查看是不是已安裝
rpm -qa |grep openssl
#如果沒有輸出信息/提示沒有安裝的話:
yum install openssl
地址:http://slproweb.com/products/Win32OpenSSL.html,并且選擇1個版本安裝
#linux unix macosx
unix> openssl genrsa -des3 -out gryffindor.key 1024
#windows
win> cd D:\Downloads\OpenSSL-Win64\bin
win>genrsa -des3 -out gryffindor.key 1024
#linux unix macosx
unix> openssl req -config ./openssl.cnf -new -key gryffindor.key -x509 -out gryffindor.crt
#windows
win> cd D:\Downloads\OpenSSL-Win64\bin
win> req -config ./openssl.cnf -new -key gryffindor.key -x509 -out gryffindor.crt
#linux unix macosx
unix> openssl req -new -config ./openssl.cnf -key gryffindor.key -out gryffindor.csr
#windows
win> cd D:\Downloads\OpenSSL-Win64\bin
win> req -new -config ./openssl.cnf -key gryffindor.key -out gryffindor.csr
unix> cp gryffindor.* /usr/local/resin/keys
具體的實例以下(windows,linux輸入也可根據自己情況):
123456
1.創建1個私鑰。
openssl genrsa -des3 -out gryffindor.key 1024
123456
123456
2.創建簽名憑證。
輸入:123456
ZH
浙江
杭州
組織名
組織全名
域名
郵箱地址可以為空
3.創建憑證申請
123456
ZH
跟上面1致
效果:
這些是在keys文件中的文件。
#比如通過ssh工具
scp –r /workspace/yundai365_jcdl/WebRootroot@IP:/usr/local/resin/webapps/
加入的位置可以為:
………………………….中
加入內容:
UTF⑻
在linux下,通過bin/resin.sh start 和 bin/resin.sh stop 來控制服務。如果出現提示毛病:Error: Unable to access jarfile./../lib/resin.jar,遇到這個問題。由于通過在bin目錄下通過 ./resin.sh start 啟動了。
至此 resin https配置完成
上一篇 23種設計模式(4):建造者模式