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

Virtual Hostの落とし穴にハマった件 / fjord-lt-6

3c635ac67557f954b04d37a24254f436?s=47 beco
January 23, 2021

Virtual Hostの落とし穴にハマった件 / fjord-lt-6

Fjord Boot Camp ⚡初めてのLT会 Vol.6
2021/01/23 Sat.

3c635ac67557f954b04d37a24254f436?s=128

beco

January 23, 2021
Tweet

Transcript

  1. 7JSUVBM)PTUͷ ʹϋϚͬͨ݅ མͱ݀͠ 'KPSE#PPU$BNQ⚡ॳΊͯͷ-5ձ7PM ΂͜!CFDPMPNPDIJ

  2.  ΂͜!CFDPMPNPDIJ ϑϦʔϥϯεͷσβΠφʔ ࡀͱࡀͷϚοϚ ظੜͰ͢

  3. ϑΟϤϧυϒʔτΩϟϯϓडߨͷ͖͔͚ͬ  • ʰ3VCZ௒ೖ໳ʱ ΦϒδΣΫτ͞Μͷ࡞ը୲౰ • ڭՊॻͱͯ͠࢖ΘΕ͍ͯΔ৔ॴͰֶ΂͹ ؒҧ͍ͳ͍

  4. ࠓ೔࿩͢ϓϥΫςΟε

  5. /HJOY ΤϯδϯΤοΫε

  6. /HJOY 7JSUVBM)PTUυϝΠϯFUD ΤϯδϯΤοΫε

  7. ˢ3VCZɾ)551 ˣσʔλϕʔε

  8. ౰࣌ͷ೔ใ 

  9. ౰࣌ͷ೔ใ        

  10. ౰࣌ͷ೔ใ        

  11. ౰࣌ͷ೔ใ  ͋ʔ-FUT&ODSZQU׬શʹཧղͨ͠Θʙ ຊ౰ʹʁ ӕͰͨ͠ʙʂ

  12. ࢲͷεΩϧ  • /HJOYͷଘࡏ͸஌͍ͬͯͨ • "QBDIF Ξύον ͳΒ΍ͬͨ͜ͱ͕͋Δ • ϩʔΧϧ؀ڥͷߏங

    • $.4ʢ8PSE1SFTTʣ • IUUQEDPOGΈ͍ͨͳ಺༰ॻ͘Μ͡ΌΖʁ
  13. ͭ·͖ͣϦετ   ͘͞Βͷ714ʹ44)઀ଓͰ͖ͳ͍  /HJOY͕࠶ىಈͰ͖ͳ͍  44-Խ͍ͯ͠ͳ͍ͷʹIUUQTʙʹͳͬͯ͠·͏ ൪֎ɿ/HJOYͱॻ͍ͯʮΤϯδϯΤοΫεʯͱಡΉ͜ͱ 

    ଞʹ΋͍ΖΜͳͱ͜ΖͰͭ·͍ͣͨ ͱΓ͋͑ͣͭʹ͠·ͨ͠
  14.  ͘͞Βͷ714ʹ 44)઀ଓͰ͖ͳ͍ མͱ݀͠

  15. ެ։伴ొ࿥ͨ͠͸ͣͳͷʹ 1FSNJTTJPOEFOJFEʁʁʁ  $ ssh -p (ϙʔτ൪߸) beco@***.***.**.** beco@***.***.**.**: Permission

    denied (publickey). $ ssh-add -K ~/.ssh/sakura_rsa Identity added: /Users/beco/.ssh/sakura_rsa (beco@beco-mbp.local) • 1$্ཱͪ͛ͷͨͼɺ͘͞Β༻ͷ伴Λొ࿥͠௚͢Ӌ໨ʹ
  16. ݪˍҼ  • (JU)VCͷ44)઀ଓͷઃఆͰTTIDPOpHΛॻ͖׵͑ͨ Host * AddKeysToAgent yes UseKeychain yes

    IdentityFile ~/.ssh/id_ed25519
  17. ղܾʂ  • *EFOUJUZ'JMFʹ͘͞Β༻ͷϑΝΠϧΛ௥Ճ Host * AddKeysToAgent yes UseKeychain yes

    IdentityFile ~/.ssh/id_ed25519 IdentityFile ~/.ssh/sakura_rsa ←௥Ճɻ
  18. 5IBOLTJLVNBU͞Μ  • IUUQTCPPUDBNQGKPSEKQSFQPSUT • େώϯτʹͳΔίϝϯτΛ࢒ͯ͘͠Ε·ͨ͠

  19.  /HJOY͕࠶ىಈͰ͖ͳ͍ མͱ݀͠

  20. /HJOYΛ࠶ىಈͤ͞Α͏ͱͨ͠Βʜ  $ sudo /etc/init.d/nginx start [....] Starting nginx (via

    systemctl): nginx.serviceJob for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details. failed!
  21. Ͳ͜Λؒҧ͑ͨͷ͔XBLBSBO 

  22. ղܾʂ  $ sudo nginx -t nginx: the configuration file

    /etc/nginx/nginx.conf syntax is ok nginx: [emerg] open() "/home/demo/public_html/ becolomochi.page/log/access.log" failed (2: No such file or directory) nginx: configuration file /etc/nginx/nginx.conf test failed UUFTUDPOpHVSBUJPOBOEFYJUͱͷ͜ͱɻ ؒҧ͑ͯͨʂ
  23. 5IBOLTઌਓͷ஌ܙ  • ϒϩά΍೔ใΛॻ͍ͯ͘Εͯ͋Γ͕ͱ͏ • ࢲ΋ॻ͖·͢

  24.  44-Խ͍ͯ͠ͳ͍ͷʹ IUUQTʙʹͳͬͯ͠·͏ མͱ݀͠

  25. ϨΞέʔε ଟ෼  • QBHFͱ͍͏(PPHMF%PNBJOTͷυϝΠϯ • աڈʹऔͬͯ͋ͬͯ࢖͍ͬͯͳ͔ͬͨ • ʮͪΐ͏Ͳ͍͍΍͜Ε࢖ͬͪΌ͑ʙʯ •

    མͱ݀͠ʂʂʂʂʂ
  26. දࣔͰ͖ͳ͍  • IUUQCFDPMPNPDIJQBHFͰϒϥ΢βͰΞΫηε • ·ͩ44-ͷઃఆΛ͍ͯ͠ͳ͍ঢ়ଶ • IUUQTCFDPMPNPDIJQBHFʹͳͬͯ͠·͏

  27. ݪˍҼ  • QBHF͕)454ϓϦϩʔυରԠͷυϝΠϯͩͬͨ • ཁ͸࠷ॳ͔Β)5514ʹͯ͘͠ΕΔ͋Γ͕͍ͨػೳ • ࠷ॳ͔Β҆શr(PPHMF%PNBJOTͱ͍͏ϖʔδΛࢀর • IUUQTEPNBJOTHPPHMFJOUMKB@KQUMETFDVSJUZ

    • )5514USJDU5SBOTQPSU4FDVSJUZ8JLJQFEJB • IUUQTKBXJLJQFEJBPSHXJLJ)551@4USJDU@5SBOTQPSU@4FDVSJUZ
  28. ղܾʂ  • ผͷυϝΠϯ࢖ͬͨXXX

  29. 5IBOLT0BLCPX͞Μ  • 5XJUUFSͰͭͿ΍͍͍ͯͨΒ൓Ԡͯ͠ ͩͬͨ͘͞ • IUUQTUXJUUFSDPNCFDPMPNPDIJ TUBUVT ͷεϨ

  30. ·ͱΊʂ

  31. ҙࣝ͢Δͱ͍͍ͳͱࢥͬͨ͜ͱ  • Θ͔Βͳ͍͜ͱΛݴޠԽ͢Δ͜ͱ • खॱΛॻ͍͍ͯ͘͜ͱ • ࣗ෼Ͱ΋ௐ΂ଓ͚Δ͜ͱ ͳΔ΂͘ެࣜΛݟΔʂʣ •

    ώϯτΛͩͬͨ͘͞օ͞Μຊ౰ʹ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ • Ҏ্Ͱ͢ʂ