Skip to content

Instantly share code, notes, and snippets.

@pramoth
Created January 17, 2022 08:43
Show Gist options
  • Save pramoth/f6a98e3f899c2f7da90fa0e519319d54 to your computer and use it in GitHub Desktop.
Save pramoth/f6a98e3f899c2f7da90fa0e519319d54 to your computer and use it in GitHub Desktop.

IP Server

  • app (OPS1) 172.24.1.26
  • app (OPS2) 172.24.1.27
  • DB 172.24.4.22

SSL Installation

  1. copy file โดย scp key_store_file ops@172.24.1.26:~ โดยที่ key_store_file คือไฟล์ keystore .p12 , .jks ,.pfx
    • ตัวอย่างของในกรณีปี 2565 นี้คือ ไฟล์ SSL/pfx_for_iis_or_hardware/PFXCertificate.pfx ดังนั้น จึงใช้คำสั่ง scp SSL/pfx_for_iis_or_hardware/PFXCertificate.pfx ops@172.24.1.26:~ ซึ่งคือการ copy file PFXCertificate.pfx ที่เครื่อง local ไปยังเครื่องปลายทาง ที่ path /home/ops/
  2. remote เข้าไปที่เครื่อง 172.24.1.26 ด้วยคำสั่ง ssh ops@172.24.1.26 (ด้วย user ops)
  3. เปลี่ยนชื่อไฟล์จาก PFXCertificate.pfx เป็น ssl_keystore.pfx ด้วยคำสั่ง mv PFXCertificate.pfx ssl_keystore.pfx
  4. แก้ไขไฟล์ application.properties เปลี่ยนพาสเวิร์ดตามที่ให้มา
## แก้บรรทัดนี้ตรง xxx เท่านั้น
server.ssl.key-store-password=xxx # xxx คือพาสเวิร์ดของ keystore
  1. restart service ด้วยคำสั่งsudo systemctl restart ops
  2. ทำการ copy file config ต่างๆไปยังเครื่อง 172.24.1.27 ด้วยคำสั่ง scp application-prod.properties ssl_keystore.pfx ops@172.24.1.27:~
  3. remote เข้าไปที่เครื่อง 172.24.1.27 ด้วยคำสั่ง เพื่อทำการ restart service ssh ops@172.24.1.27 (ด้วย user ops)
  4. restart service เครื่อง 172.24.1.27 ด้วยคำสั่งsudo systemctl restart ops
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment