Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Amazon S3をWebサイト運営 (主にWordPressなど)で活用する

Amazon S3をWebサイト運営 (主にWordPressなど)で活用する

JAWS-UG Kobe 2016/06/14

75486cbfd37125f121cf4a6c5614601c?s=128

Hidetaka Okamoto
PRO

June 14, 2016
Tweet

More Decks by Hidetaka Okamoto

Other Decks in Technology

Transcript

  1. A m a z o n S 3 Λ We

    b αΠ τ ӡ Ӧ ʢ ओ ʹ Wo rd P re s s ͳ Ͳ ʣ Ͱ ׆ ༻ ͢ Δ J A W S - U G K O B E 2 0 1 6 / 0 6 / 1 4
  2. ࿩ ͢ ͜ ͱ • Static Website Hosting • WordPress

    with S3 • StaticPressࣄྫ঺հ
  3. ࿩ ͞ ͳ ͍ ͜ ͱ • S3ʹ͍ͭͯͷৄࡉ • StaticPressͷ࢖͍ํ

    • ӈͷࣸਅʹ͍ͭͯ
  4. Ԭ ຊ ल ߴ • Digitalcube ΤϯδχΞ • WordBenchژ౎ϞσϨʔλ •

    Reactͱ͔AWS SDKͰJSͿΜ ·Θ͠ • Πϕϯτʹଠޑ࣋ͪࠐΉ΍ͭ
  5. ͱ Γ ͋ ͑ͣ S 3 ʹ w e b

    αΠ τ Λ Ξ οϓ ͯ͠ Έ Δ
  6. ࠓ ճ Ξ οϓ ͢ Δ ϑ Ν Πϧ .

    ᵓ ᴷ ᴷ i m a g e . p n g ᵓ ᴷ ᴷ i n d e x . h t m l ᵋ ᴷ ᴷ s t y l e . c s s
  7. όέ ο τ ͷ ࡞ ੒

  8. $ a w s s 3 m b s 3

    : / / m y b u c k e t - - re g i o n u s - w e s t - 1
  9. ϑ Ν Πϧ ͷ Ξ οϓ ϩ ʔ υ

  10. $ a w s s 3 s y n c

    . s 3 : / / j a w s - u g - k o b e \ - - a c l p u b l i c - re a d u p l o a d : . / i n d e x . h t m l t o s 3 : / / j a w s - u g - k o b e / i n d e x . h t m l u p l o a d : . / s t y l e . c s s t o s 3 : / / j a w s - u g - k o b e / s t y l e . c s s u p l o a d : . / i m a g e . p n g t o s 3 : / / j a w s - u g - k o b e / i m a g e . p n g
  11. $ a w s s 3 s y n c

    . s 3 : / / j a w s - u g - k o b e \ - - a c l p u b l i c - re a d u p l o a d : . / i n d e x . h t m l t o s 3 : / / j a w s - u g - k o b e / i n d e x . h t m l u p l o a d : . / s t y l e . c s s t o s 3 : / / j a w s - u g - k o b e / s t y l e . c s s u p l o a d : . / i m a g e . p n g t o s 3 : / / j a w s - u g - k o b e / i m a g e . p n g
  12. - - a c l p u b l i

    c - re a d Λ ͭ ͚ ๨ Ε Δ ͱ 4 0 3 Τϥ ʔ ʹ ͳ Δ
  13. ੩ త W E B αΠ τ ϗ ε ςΟ

    ϯ ά ͷ ༗ ޮ Խ
  14. $ a w s s 3 w e b s

    i t e s 3 : / / j a w s - u g - k o b e / \ - - i n d e x - d o c u m e n t i n d e x . h t m l \ - - e r ro r- d o c u m e n t e r ro r. h t m l
  15. Finishedʂ

  16. S 3 Λ ࢖ ͏ ϝ Ϧ ο τ •

    ֹ݄10ԁલޙͱ֨҆ • SLA 99.9%ͷؤৎ͞ • EC2ΑΓϝϯςָ͕ • ༰ྔແ੍ݶʢ̍ϑΝΠϧ5TBʣ
  17. ͜ Μ ͳ ͱ ͜ Ζ ʹ S 3

  18. ͱ ͋ Δ ܳ ೳ ਓ ͷ We b αΠ

    τ h t t p : / / o t o t a k e . c o m /
  19. ͱ ͋ Δ ܳ ೳ ਓ ͷ We b αΠ

    τ h t t p : / / f u k u y u k i . n e t / p o s t - 8 0 5 /
  20. Wo rd P re s s w i t h

    A m a z o n S 3
  21. Wo rd P re s s w i t h

    S 3 • ϝσΟΞϑΝΠϧΛS3΁ • αΠτͦͷ΋ͷΛS3΁ • FSΛϚ΢ϯτ
  22. Wo rd P re s s w i t h

    S 3 • ϝσΟΞϑΝΠϧΛS3΁ • αΠτͦͷ΋ͷΛS3΁ • FSΛϚ΢ϯτ ɹˠࠓ೔͸৮Εͳ͍
  23. Wo rd P re s s ͷ ϝ σΠ Ξ

    ϑ Ν Πϧ Λ S 3 ΁
  24. N e p h i l a c l a

    v a t a ( བྷ ৽ ් ) h t t p s : / / j a . w o rd p re s s . o rg / p l u g i n s / n e p h i l a - c l a v a t a /
  25. N e p h i l a c l a

    v a t a ( བྷ ৽ ් ) • WordPressͷϝσΟΞΛS3΁ • EBSʹ΋อଘ͢ΔͷͰ࡟আ͠ ͯ΋ࣄނΒͳ͍ • աڈͷը૾΋ࣗಈͰɹɹɹ Ξοϓϩʔυ
  26. S 3 όέ ο τ Λ ࡞ ੒

  27. ੩ త We b αΠ τ ϗ ε ςΟ ϯ

    ά Λ O N
  28. Wo rd P re s s - > S 3

    ͷ I A M ࡞ ੒
  29. Wo rd P re s s - > S 3

    ͷ I A M ࡞ ੒
  30. ϓ ϥ άΠ ϯ Λ ༗ ޮ Խ

  31. η ο τΞ οϓ

  32. S 3 ʹ Ξ οϓ ϩ ʔ υ ͞ Ε

    ͨ ༷ ࢠ
  33. Wo rd P re s s αΠ τ ͦ ͷ

    ΋ ͷ Λ S 3 ΁
  34. S t a t i c P re s s

    h t t p : / / j a . s t a t i c p re s s . n e t /
  35. S t a t i c P re s s

    • WordPressαΠτΛHTMLʹ • ੩తԽ͞Ε͍ͯΔͷͰS3ʹ ΞοϓϩʔυͰ͖Δ • WordPressαΠτΛS3Ͱɹɹ ϗετ͢Δ͜ͱ͕Մೳʹ
  36. S t a t i c P re s s

    Λ ࢖ ͏ ͱ ྑ ͍ έ ʔε • ߋ৽ස౓͕গͳ͍αΠτͰαʔό୅Λઅ໿͍ͨ͠ • ߋ৽ͷऴΘͬͨαΠτͳͷͰϝϯςφϯεͨ͘͠ͳ͍ • WordPressͷηΩϡϦςΟϦεΫා͍ • ͪΐͬͱมΘͬͨWordPressӡ༻΍ͬͯΈ͍ͨ
  37. S t a t i c P re s s

    Λ ࢖ ͏ ϝ Ϧ ο τ • ੩తԽͨ͠ϑΝΠϧΛS3ʹ͋͛Ε͹EC2͕ෆཁ • ੩తԽ͍ͯ͠ΔͷͰɺWordPressͷϝϯςෆཁ • PHP / MySQLແ͠ͳͷͰηΩϡϦςΟϦεΫ͕ݮΔ
  38. S t a t i c P re s s

    ӡ ༻ Πϝ ʔ δ • ϩʔΧϧαʔόʹWP • AWS SDK΍AWS CLIͰS3΁ • Route53͸S3΁໊લղܾ
  39. https://firegoby.jp/archives/6221

  40. https://dogmap.jp/2013/02/06/s3-hosting/

  41. S t a t i c P re s s

    Λ ࢖ ͏ σϝ Ϧ ο τ • PHP / MySQL͕࢖͑ͳ͍ͷͰϑΥʔϜ΍ݕࡧ͕ਏ͍ • ߋ৽ = StaticPressͰͷ࠶ߏங + S3Ξοϓϩʔυͳͷ Ͱɺසൟʹߋ৽͢ΔαΠτͩͱ൥ࡶ • ෳ਺ਓͰฤू͢Δͱ͖ɺWPͷઃஔ৔ॴʹ໎͏ • ·ͩ҆ఆ൛Ͱͳ͍ͷͰͨ·ʹόάΔ
  42. https://github.com/megumiteam/staticpress

  43. We n e e d P u l l R

    e q u e s t !
  44. S t a t i c P re s s

    ར ༻ ࣄ ྫ
  45. http://www.kyoso.co.jp/ ߋ৽ස౓ͷগͳ͍WebαΠτ

  46. http://kobe2011.wordcamp.jp/ ΋͏ߋ৽͞Εͳ͍WebαΠτ

  47. http://creator.dwango.co.jp/ ηΩϡϦςΟతʹWordPressΛ ֎͔ΒΞΫηεͤͨ͘͞ͳ͍৔߹

  48. http://creator.dwango.co.jp/1847.html

  49. ͋ ɺ ͦ ͏ ͍ ͑ ͹

  50. ͜ Μ ͳ ϋ ϯζ Φ ϯ ͋ Δ Β

    ͠ ͍Ͱ ͢ h t t p s : / / j a w s u g o s a k a . d o o r k e e p e r. j p / e v e n t s / 4 6 3 4 3
  51. · ͱ Ί

  52. · ͱ Ί • Amazon S3ͷʮ੩తWebαΠτϗεςΟϯάʯ͸ศར • WordPressͷΑ͏ͳCMSʹ΋࢖͑Δ • ߋ৽͠ͳ͘ͳͬͨαΠτ͸StaticPressͰӬ୅ڙཆ

  53. https://www.ipa.go.jp/security/ciadr/vul/20140619-oldcms.html

  54. · ͱ Ί • Amazon S3ͷʮ੩తWebαΠτϗεςΟϯάʯ͸ศར • WordPressͷΑ͏ͳCMSʹ΋࢖͑Δ •ߋ৽͠ͳ͘ͳͬͨαΠτ͸ StaticPressͰӬ୅ڙཆ

  55. T H A N K S ! • Static Website

    Hosting • WordPress with S3 • StaticPressࣄྫ঺հ