SSL-Apache-config:กรณีศึกษาสอ.เบทาโกร
SSL-Apache-config:กรณีศึกษาสอ.เบทาโกร
Cert เป็นแบบ wildcard *.betrago.com
https://betagrocoop.betagro.com/webportal/
1.สิ่งที่ได้ รับจาก IT
2.config ที่ xampp
C:\xampp\apache\conf\extra\httpd-ssl.conf
2.1 แก้ port SSL จาก 4449 = 443
Line 36
Listen 443
2.2 แก้ config ssl
Line 80 2.2 แก้ config ssl
<VirtualHost _default_:443>
# General setup for the virtual host
DocumentRoot "C:/xampp/htdocs"
ServerName betragocoop.betrago.com:443
#ต้องตรงกับ domain ที่ cert ผูกไว้
ServerAdmin coop@betagro.com
#ส่วนนี้ต้องตรงกับที่ กำหนด
ErrorLog "C:/xampp/apache/logs/error.log"
TransferLog "C:/xampp/apache/logs/access.log"
Line 67 ให้ comment
#SSLPassPhraseDialog builtin
2.3 comment ค่าเดิม เพิ่มเติมค่า Path cert ใหม่
#SSLCertificateFile "conf/ssl.crt/server.crt"
SSLCertificateFile "D:/DigiCert_certs/certs/star_betagro_com.crt"
#SSLCertificateKeyFile "conf/ssl.key/server.key"
SSLCertificateKeyFile "D:/DigiCert_certs/certs/star_betagro_com.key"
#SSLCertificateChainFile "c:/Apache24/conf/server-ca.crt"
SSLCertificateChainFile "D:/DigiCert_certs/certs/DigiCertCA.crt"
2.4 แปลง .pfx เป็น .key
ในที่นี้ cert เราติดตั้งที่ D:\DigiCert_certs\certs\
ซึ่งต้องถามรหัสผ่านจาก ผู้สร้าง .pfx ให้ ในที่นี้ คือ password
เปิด cmd
SET PATH=C:\xampp\apache\bin;%PATH%พิมพ์
D:
Cd D:\DigiCert_certs\certs
openssl pkcs12 -in star_betagro_com.pfx -nocerts -out star_betagro_com.in.key
>>พิมพ์ รหัสผ่าน password
openssl pkcs12 -in star_betagro_com.pfx -clcerts -nokeys -out star_betagro_com.crt
>>พิมพ์ รหัสผ่าน password
openssl rsa -in star_betagro_com.in.key -out star_betagro_com.out.key
>>พิมพ์ รหัสผ่าน password
openssl rsa -in star_betagro_com.in.key -outform PEM -out star_betagro_com.out.pem.key
>>พิมพ์ รหัสผ่าน password
0 ความคิดเห็น: