Amazon S3でWordPressを動かす

Amazon S3でWordPressを動かす

【WordPress特別セミナー】StaticPress × S3 × Vagrant 勉強会
の講演資料
http://atnd.org/events/43607

Twitterまとめ
http://togetter.com/li/576298

■共演の方々の資料
WordPress サイトの 長期的メンテナンス
http://www.slideshare.net/naokomc/wordpress-27138322

現場視点で語るstaticpress開発の背景と事例
http://www.slideshare.net/megumithemes/staticpress-27139158

StaticPress
http://www.slideshare.net/wokamoto1973/staticpress

Amazon S3による静的Webサイトホスティング
http://www.slideshare.net/horiyasu/amazon-s3web-27138902

仮想マシンざっくり解説と実践Vagrant
http://www.slideshare.net/YukihikoSawanobori/staticpress-seminor-vagrantpublic

0ec58a040e1e4e959c8566484b4bba19?s=128

Yuichiro MASUI

October 13, 2013
Tweet

Transcript

  1. Amazon S3Ͱ WordPressΛಈ͔͢ Yuichiro MASUI @masuidrive Sunday, October 13, 13

  2. @masuidrive • Yuichiro MASUI - Ichi • Open source developer,

    Ruby fun • Pukiwiki, Ruby on Rails tutorial movie in Japanese, IKEA hacker • Furo-grammer (Coding in hot tub) • FrogApps / Toreta. CTO // ex-Appcelerati Sunday, October 13, 13
  3. Sunday, October 13, 13

  4. Hi! I’m @masuidrive. • Yuichiro MASUI - Ichi • Open

    source developer, Ruby fun • Pukiwiki, Ruby on Rails tutorial movie in Japanese, IKEA hacker • Furo-grammer (Coding in hot tub) • FrogApps, Inc. CTO // ex-Appcelerati Sunday, October 13, 13
  5. Hi! I’m @masuidrive. • Yuichiro MASUI - Ichi • Open

    source developer, Ruby fun • Pukiwiki, Ruby on Rails tutorial movie in Japanese, IKEA hacker • Furo-grammer (Coding in hot tub) • FrogApps, Inc. CTO // ex-Appcelerati ϛΠϧ Sunday, October 13, 13
  6. Hi! I’m @masuidrive. • Yuichiro MASUI - Ichi • Open

    source developer, Ruby fun • Pukiwiki, Ruby on Rails tutorial movie in Japanese, IKEA hacker • Furo-grammer (Coding in hot tub) • FrogApps, Inc. CTO // ex-Appcelerati Sunday, October 13, 13
  7. Sunday, October 13, 13

  8. Sunday, October 13, 13

  9. Sunday, October 13, 13

  10. Sunday, October 13, 13

  11. Sunday, October 13, 13

  12. Sunday, October 13, 13

  13. blog.masuidrive.jp • ॻ͘ͷ͸ࢲҰਓ • ίϝϯτ͸ͦΕ΄Ͳ࢖͍ͬͯͳ͍ • WordPressͳͲͷόʔδϣϯ͸೥1͙Β ͍Ͱؾ͕޲͍ͨͱ͖ʹVer. up! Sunday,

    October 13, 13
  14. αʔό৐ͬऔΓ • ੲ͔Βྑ͋͘Δ • ఆظతʹ࿩୊ʹ • ϝϯςΛ͍ͯ͠ͳ͍͜ͱ͕ݪҼ Sunday, October 13,

    13
  15. αʔόͷӡ༻͸େม • ΞϓϦɺϛυϧ΢ΤΞɺOSͷόʔδϣ ϯΞοϓ • σΟεΫͳͲͷো֐ • αʔόͷঢ়ଶ΍ॻ͖ࠐΈͷ؂ࢹ Sunday, October

    13, 13
  16. खؒΛݮΒ͍ͨ͠ • Ϩϯλϧϒϩά • PaaSɹ Sunday, October 13, 13

  17. ಈతͷඞཁੑ͸ʁ • هࣄ͸੩తͳHTMLͰ͍͍ͷͰ͸ʁ • ίϝϯτ͸͋·Γ͔ͭͳ͍͠ • τϥοΫόοΫ͸εύϜଟ͍ Sunday, October 13,

    13
  18. Sunday, October 13, 13

  19. PHPͱMySQLΛ࢖ͬͨಈతੜ੒ Sunday, October 13, 13

  20. HTMLੜ੒ܕϒϩά • Jekyll • Octopress Sunday, October 13, 13

  21. WordPress͔ΒҠߦ • طଘͷσʔλΛΠϯϙʔτ͸೉͍͠ • WPͷσʔλ͸HTMLʹͯ͠ઃஔʁ Sunday, October 13, 13

  22. WordPressΛHTMLԽ • wgetͱ͔curl࢖ͬͨΒWP͔ΒHTMLੜ੒ Ͱ͖Δ • ϒϩάຊମ͸ύεϫʔυͳͲΛ͔͚ͯ ੜ੒ͨ͠HTML͚ͩϢʔβʹެ։ Sunday, October 13,

    13
  23. ੜ੒ͨ͠HTMLΛެ։ • ಉ͡αΠτ্Ͱެ։͢Δͱϛυϧ΢Τ Ξͷ؅ཧΛ͠ͳ͚Ε͹͍͚ͳ͍ • WebͷϗεςΟϯάαʔϏεʹஔ͜͏ • ͦ͏ͳΕ͹Amazon S3 Sunday,

    October 13, 13
  24. Amazon S3 • ੈք࠷ߴ඼࣭ͷWebαʔό • Քಇ཰ 99.99% SLA(99.9%) • ࣗ෼ͷυϝΠϯΛ࢖༻Մೳ

    Sunday, October 13, 13
  25. Amazon S3 • Ξοϓϩʔυ͸ઐ༻ϓϩτίϧ • ༰ྔʴసૹྉ՝ۚ Sunday, October 13, 13

  26. WP͸ϓϥάΠϯ͕ॆ࣮ • wgetͱ͔࢖Θͳͯ͘΋ϓϥάΠϯͰ HTMLੜ੒Ͱ͖Δ෺͋ΔΜ͡Όແ͍ʁ Sunday, October 13, 13

  27. Sunday, October 13, 13

  28. ReallyStatic Sunday, October 13, 13

  29. StaticPress Sunday, October 13, 13

  30. ྆ϓϥάΠϯ • StaticPress / ReallyStatic • ϩʔΧϧʹ੩తHTMLΛੜ੒ • ReallyStatic •

    FTP/Amazon S3΁Ξοϓϩʔυ Sunday, October 13, 13
  31. StaticPressͷS3ରԠ Sunday, October 13, 13

  32. StaticPressͷS3ରԠ Sunday, October 13, 13

  33. Sunday, October 13, 13

  34. Sunday, October 13, 13

  35. ߟ͑ಘΔ໰୊఺ • ಈతͳॻ͖ࠐΈ • ಈతͳϓϥάΠϯ • ςʔϚ • ΞΫηεղੳ Sunday,

    October 13, 13
  36. ಈతͳॻ͖ࠐΈ • τϥοΫόοΫ • ίϝϯτ Sunday, October 13, 13

  37. ಈతͳϓϥάΠϯ • ౤ථ • A/Bςετ • SEOɹ • εϚʔτϑΥϯରԠ •

    ໰͍߹ΘͤϑΥʔϜ Sunday, October 13, 13
  38. ςʔϚ • User AgentΈͯ੾Γସ͍͑ͯΔ Sunday, October 13, 13

  39. ΞΫηεղੳ • ϓϥάΠϯͳͲͰຒΊࠐΉܗࣜ Sunday, October 13, 13

  40. ରԠํ๏ • ಈతͳॻ͖ࠐΈ • ಈతͳϓϥάΠϯ • ςʔϚ • ΞΫηεղੳ Sunday,

    October 13, 13
  41. ಈతͳॻ͖ࠐΈ • JavascriptͰຒΊࠐΉίϝϯτཝ • Facebook Comments • Disqus • Trackback͸࢖Θͳ͍

    Sunday, October 13, 13
  42. ಈతͳϓϥάΠϯ • ͖͋ΒΊΔ • Javascriptϕʔεʹॻ͖׵͑Δ • ରԠग़དྷΔΑ͏ʹؤுΔ Sunday, October 13,

    13
  43. ςʔϚ • URLͷม׵Λߦ͏෦෼ • ਖ਼͘͠ॻ͖׵͑Δ • User AgentͳͲͰ੾Γସ͑Δ෦෼ • Javascript΋͘͠͸responsiveʹ

    Sunday, October 13, 13
  44. ΞΫηεղੳ • Google AnalyticsͱΞΫηεϩάͰ Sunday, October 13, 13

  45. Sunday, October 13, 13

  46. Amazon S3 • URL rewriting΋αϙʔτ • ෳ਺ΞΧ΢ϯτൃߦ Sunday, October 13,

    13
  47. Amazon S3 http://blog.masuidrive.jp/index.php/2013/08/09/toreta/ ↓ http://blog.masuidrive.jp/2013/08/09/toreta/ Sunday, October 13, 13

  48. Sunday, October 13, 13

  49. ࢓্͛ • DNSΛมߋ • 1-2࣌ؒ଴ͭͱมߋ׬ྃ Sunday, October 13, 13

  50. αʔό͸Ͳ͏͢Δʁ • BasicೝূΛ͔͚͓ͯ͘ • ϩʔΧϧʹҠઃ͢Δ Sunday, October 13, 13

  51. BasicೝূΛ͔͚Δ • ݩͷαʔόΛઃஔͨ͠··શମʹBasic ೝূΛ͔͚Δ • Basicೝূͷಥഁ͸ࠔ೉ • ϗετ໊Λద੾ʹ͢Ε͹ਪଌ͸ࠔ೉ Sunday, October

    13, 13
  52. ϩʔΧϧʹҠઃ͢Δ • αʔόΛެ։͢Δඞཁ͸ͳ͍ͷͰϩʔ ΧϧʹҠઃ͢Δ • Ոαʔό͔ϥοϓτοϓ • ࣗ෼͔͠ॻ͔ͳ͍ͷͰϥοϓτοϓʹ ઃஔ Sunday,

    October 13, 13
  53. ϥοϓτοϓͰWP • OSXʹ͸ඪ४ͰApache+PHP͕ೖͬͯΔ • MySQLΛϩʔΧϧʹಋೖ • XAMPPͳͲͷύοέʔδ Sunday, October 13,

    13
  54. Sunday, October 13, 13

  55. Vagrant • Virtual MachineΛ؆୯ʹѻ͏ͨΊͷπʔ ϧ • VirtualBox΍VMwareͷϑϩϯτΤϯυ • ϗετͱͷϑΥϧμڞ༗ɺϙʔτϑΥ ϫʔυΛखܰʹͰ͖Δ

    Sunday, October 13, 13
  56. Vagrantfile Vagrant.configure("2") do |config| config.vm.box = "precise32" config.vm.box_url = "http://files.vagrantup.com/precise32.box"

    config.vm.network \ :forwarded_port, guest: 8080, host: 8080 config.vm.synced_folder "www", "/var/www/" end Sunday, October 13, 13
  57. VagrantͰUbuntuΛىಈ • vagrant up • vagrant ssh • vagrant halt

    • vagrant destroy Sunday, October 13, 13
  58. Vagrant্ʹ؀ڥߏங • Apache, PHP, MySQLΛΠϯετʔϧ • ApacheͷىಈϙʔτΛ8080ʹมߋ • DocumentRoot͸/var/wwwͷ·· Sunday,

    October 13, 13
  59. WPΛҠઃ • ϓϥάΠϯΛ࢖͍export • wordpressͷϑΥϧμΛϩʔΧϧͷwww ϑΥϧμʹμ΢ϯϩʔυ • Ubuntuͷ/var/www͔ΒΞΫηεՄೳ Sunday, October

    13, 13
  60. WPىಈ • http://localhost:8080ɹ • Wordpressͷॳظઃఆ • exportͨ͠σʔλΛಡΈࠐΈ Sunday, October 13,

    13
  61. ϒϩάΛॻ͘ʹ͸ • vagrant upɹ • http://localhost:8080/wp-adminɹ • ॻ͖ऴΘͬͨΒStaticPressͰbuild • vagrant

    halt Sunday, October 13, 13
  62. ͜Ε͔Β • StaticPressͰbuildͨ͠ΒMySQLͷσʔλ Λdump͢ΔΑ͏ʹ͍ͨ͠ • rebuild͕΋͏গ͠ૣ͘ͳΔ͏Ε͍͠ Sunday, October 13, 13