Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
How to Continuously Upgrade Web Services Writte...
Search
Kentaro Kuribayashi
September 14, 2013
Technology
13
7.7k
How to Continuously Upgrade Web Services Written in PHP
PHP Conference 2013 #phpconf2013
Kentaro Kuribayashi
September 14, 2013
Tweet
Share
More Decks by Kentaro Kuribayashi
See All by Kentaro Kuribayashi
Bidirectional Quadratic Voting Leveraging Issue-Based Matching
kentaro
2
320
大高生へのメッセージ(令和6年度「大高未来塾」) / Messages to Current Students
kentaro
0
230
「始め方」の始め方 / How to Start Starting Things
kentaro
5
840
Dynamic IoT Applications and Isomorphic IoT Systems Using WebAssembly
kentaro
1
1.2k
わたしがこのところハマっている「ライセンスフリー無線」のご紹介 / An Invitation to License-Free Radio
kentaro
1
480
先行きの見えなさを楽しさに変える ーVUCA時代のキャリア論と絶対他力主義ー / How to develop your career in the VUCA era
kentaro
7
5.1k
組織の生産性を高める意思決定の構造と方法 / How to do make decision rapidly and effectively
kentaro
41
22k
キャリアを時間・空間軸で考える / Thinking about your career from both time and space viewpoints
kentaro
15
16k
WEB+DB PRESSで特集記事を書く方法 / How to Become an Author of WEB+DB PRESS
kentaro
7
1.5k
Other Decks in Technology
See All in Technology
UI State設計とテスト方針
rmakiyama
2
620
Turing × atmaCup #18 - 1st Place Solution
hakubishin3
0
490
祝!Iceberg祭開幕!re:Invent 2024データレイク関連アップデート10分総ざらい
kniino
3
310
.NET 9 のパフォーマンス改善
nenonaninu
0
1k
watsonx.ai Dojo #5 ファインチューニングとInstructLAB
oniak3ibm
PRO
0
170
alecthomas/kong はいいぞ / kamakura.go#7
fujiwara3
1
300
AWS re:Invent 2024で発表された コードを書く開発者向け機能について
maruto
0
190
どちらを使う?GitHub or Azure DevOps Ver. 24H2
kkamegawa
0
840
kargoの魅力について伝える
magisystem0408
0
210
多領域インシデントマネジメントへの挑戦:ハードウェアとソフトウェアの融合が生む課題/Challenge to multidisciplinary incident management: Issues created by the fusion of hardware and software
bitkey
PRO
2
110
Google Cloud で始める Cloud Run 〜AWSとの比較と実例デモで解説〜
risatube
PRO
0
110
小学3年生夏休みの自由研究「夏休みに Copilot で遊んでみた」
taichinakamura
0
170
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
32
6.3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Being A Developer After 40
akosma
87
590k
Mobile First: as difficult as doing things right
swwweet
222
9k
How GitHub (no longer) Works
holman
311
140k
Making Projects Easy
brettharned
116
5.9k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Why Our Code Smells
bkeepers
PRO
335
57k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
How STYLIGHT went responsive
nonsquared
95
5.2k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Transcript
PHPΞϓϦέʔγϣϯͷ ܧଓతόʔδϣϯΞοϓ @kentaro
@kentaro Rubyist / Perl Monger Vimmer (Vimྺ6 Kentaro Kuribayashi paperboy&co.
ٕज़ج൫νʔϜ
ͪɾͪͺʔ ͱ͍͏ݴ༿ͷ࢝ऀ
None
None
None
େม͓ੈʹͳ͓ͬͯΓ·͢
શࣾతٕज़ج൫ ͷඋ ৽ٕज़ͱ͔ ։ൃϓϩηεͷ վળ εΫϥϜͱ͔ طଘαʔϏεͷ վળ
શࣾతٕज़ج൫ ͷඋ ৽ٕज़ͱ͔ ։ൃϓϩηεͷ վળ εΫϥϜͱ͔ طଘαʔϏεͷ վળ
ͱ͜ΖͰ
http://php.net/archive/2013.php#id2013-07-11-1
དྷ(2014)ʹऴྃ
Ͳ͏͢Δʁ
มԽʹରԠ͢Δ
ڥมԽ͢Δ ࣌ڥͷมԽ ϏδωεڥͷมԽ ৫తڥͷมԽ ٕज़తڥͷมԽ
OSSมԽ͢Δ PHPൃల͍ͯ͘͠ 5.5.3←ΠϚίί ͍ΖΜͳػೳ ηΩϡϦςΟϑΟοΫε
OSSͷίετ ιϑτΣΞͷඅ༻ແྉ ಋೖɾӡ༻ʹؔ͢Δඅ༻ͦ ΕͳΓʹ͔͔Δ ಛʹӡ༻ʹؔͯ͠ όʔδϣϯΞοϓ
ΤίγεςϜ PHPΛߏ͢Δͷݴޠͦͷ ͷ͚ͩͰͳ͍ ίϛϡχςΟͰͷؔੑɺ ͦΕΒ͕ੜΈग़͢ϥΠϒϥ ϦɺυΩϡϝϯτ
5.3.2 ӽ͑ΒΕͳ͍น 5.2
ศརπʔϧ ͍Ζ͍ΖͳϥΠϒϥϦɺศར πʔϧ composer newrelic etc. 5.3Ҏલແࢹͷ
์ஔ͢Δͱʜ ݹ͍ॻ͖ํʹͻ͖ͣΒΕΔ ηΩϡϦςΟతʹϠό͍
։ൃεϐʔυ↓↓ ศརϥΠϒϥϦɾπʔϧ͕ ͑ͳ͍ ϨΨγʔίʔυͷ૿Ճ ·͢·͢εϐʔυ͕Լ ΠϊϕʔγϣϯͷδϨϯϚ
ͦͷ͋ͨΓͷ͜ͱ શ෦͜͜ʹॻ͔ Ε͍ͯ·͢ ඞಡ
WebαʔϏεͷ ܧଓతվળ
όʔδϣϯΞοϓ ίʔυΛมߋ͢Δ͚ͩͳΒͦ Μͳʹ͘͠ͳ͍ Ұ͚ͩΔʹɺ࣌ؒΛ ͔͚ΕͳΜͱ͔ͳΔ ͔࣮͠͠ࡍʹɺԿܧଓ తʹߋ৽͠ͳ͚ΕͳΒͳ͍
WebαʔϏεͷ໋॓ ڥৗʹมԽ͠ଓ͚Δ ͍·5.4, 5.5Ͱɺ͍ͣΕό ʔδϣϯΞοϓ͠ͳ͚Εͳ Βͳ͍ มԽʹରԠ͠ଓ͚Δඞཁ
ඞཁͳͷ αʔόͷߏཧ PHPϥΠϒϥϦͷཧ แׅతͳςετ ࣗಈσϓϩΠڥ ϞχλϦϯάͷΈ
ඞཁͳͷ αʔόͷߏཧ PHPϥΠϒϥϦͷཧ แׅతͳςετ ࣗಈσϓϩΠڥ ϞχλϦϯάͷΈ
✗ ઃఆϑΝΠϧ ύοέʔδ ϛυϧΣΞ 1)1ϥΠϒϥϦ ιʔείʔυ αʔό खಈͰ͍ΖΜͳ ͷ͕ಥͬࠐ· Ε͍ͯΔঢ়ଶ
;Θ͚͢Δ ઃఆϑΝΠϧ ύοέʔδ ϛυϧΣΞ 1)1ϥΠϒϥϦ ιʔείʔυ etc.
ઃఆϑΝΠϧ αʔό ύοέʔδ ϛυϧΣΞ ιʔείʔυ γεςϜ ◦ ߏཧ͕͠ ͔ͬΓ͞Εͯ ͍Δঢ়ଶ
ߏཧΛ࢝ΊΔ
ํ ͍͖ͳΓશ෦ΛཧԼʹ͓͜ ͏ͱ͠ͳ͍ ຊ൪ڥʹద༻͢Δ ࠓಈ͍͍ͯΔຊ൪Λյ͞ͳ͍ Ͱ͖Δͱ͜Ζ͔Βগͮͭ͠
ຊޠͰಡΊΔ། ҰͷPuppetೖ ॻ Ϟμϯ͔࣮ͭફత ͳ༰ ඞಡ
ֶश๏ ຊΛॻ͘ͱΑ͍ ిࢠॻ੶ ࣗͷษڧʹͳΔ पғʹಡΜͰΒͬͯΊ ΒΕΔ ৽ଔΧϦΩϡϥϜͷҰ෦
πʔϧͷಋೖ Puppet, Chef, Ansible... ͲΕΛ͍͍ͬͯ ࣮ࡍʹཧɾӡ༻Ͱ͖͍ͯΔ ͜ͱ͕େࣄ ೖهࣄଟ͍͕ɺͦΕ͚ͩ Ͱ࣮ફ͍͠
࣮ફతಋೖ๏ ·ͣͳʹ͔ͻͱͭͰ͍͍ ͔Β؆୯ͳઃఆϑΝΠϧ͔Β ຊ൪ڥ͔Βίϐʔͯ͘͠Δ ϦϙδτϦʹίϛοτ ͜ͷϑΝΠϧʹ͍ͭͯઈର ʹखಈͰߋ৽͠ͳ͍
࠷ݶॻ͍ͯʜ
ద༻͢Δʂ
Ͱ͖Δ͚ͩ؆୯ʹ Chef Serverͱ͔ puppetmasterͱ͔ͩΔ͍ knife-solocapistranoͰద ༻Ͱ͖ΔΑ͏ʹ͢Δ ࠷ॳʹͦ͏͍͏ΈΛ࡞Δ
։ൃڥ
։ൃڥΛݟ͢ ୭͔͕ߏஙͨ͠ڞ༻αʔό ୭͔͕ߏஙͨ͠VM ୭͔͕ߏஙͨ͠AMI ʮൿͷλϨʯ
։ൃڥͰҭͯΔ εϞʔϧελʔτͰຊ൪ద༻ Ͱ͖ΔΑ͏ʹͳͬͨΒɺ։ൃ ڥͰຊ֨తʹҭ͍ͯͯ͘ յΕͯҰൃͰ࡞ΓͤΔ͜ ͱ͕େࣄ ୭ͰڥߏஙͰ͖ΔΑ͏ʹ
Vagrant Box࡞ͬͯΞϯνύλ ϯ ʮൿͷλϨʯ ΠϝʔδΛ͍·Θ͞ͳ͍ ߏཧπʔϧΛΘͳ͍ Vagrantͷར༻ʹҙຯͳ͠
ίʔυͷஔ
Vagrantfile
DevOps ΞϓϦέʔγϣϯ։ൃऀ PuppetϚχϑΣετΛॻ͘ γεςϜߏ1VQQFUͰɺ PHPϥΠϒϥϦཧ composerͰ
composer PHPϥΠϒϥϦͷཧΞϓ Ϧ։ൃऀͷ αʔόଆͷґଘϚχϑΣε τͰཧ
ϚχϑΣετͷద༻
ຊ൪ڥͷద༻ ࠷ॳߏཧπʔϧ͚ͩͰ ߏஙͰ͖ͳ͍͍ͯ͘ গͮͭ͠ɺద༻ൣғΛ૿͠ ͍ͯ͘→શ෦ ٕज़తෛ࠴Λগ͠ͰݮΒ͢
͜ͷຊʹશ෦ॻ͔ Ε͍ͯ·͢ ඞಡ
PHPͷόʔδϣϯΞοϓ
ݴޠʹؔ͢Δ ݴޠͷมߋʹΑΔ ඇޓͳมߋ ґଘϥΠϒϥϦ͕ඇରԠ ٽ͖ͳ͕Β͢ ಛʹ͍͍ํ๏ͳͲͳ͍
ෳࡶੑΛॖݮ͢Δ mod_php + Apache͔Β PHP-FPM Apacheͱͷີ݁߹ΛΊΔ όʔδϣϯͷΈ߹ΘͤΛݮ Β͢→ߋ৽͘͢͢͠Δ
xbuild
xbuild PHPରԠ͍ͯ͠Δ xbuildΛgit cloneͯ͠ɺ php-installίϚϯυΛୟ͘ ͚ͩ
None
supervisor
֤όʔδϣϯΛ༻ҙ ܥhttp://example.com:5300/ ܥhttp://example.com:5400/ ܥhttp://example.com:5500/
όʔδϣϯͷΓସ͑ ͕Μͬͯݕূ͢Δ ʮ͍͚ΔʂʯͱͳͬͨΒɺϑ ϩϯτͷϦόʔεϓϩΩγͷ ͖ઌΛม͑Δ͚ͩ
·ͱΊ
มԽʹܧଓతʹରԠ͠ଓ͚Δ ͷWebαʔϏεͷ໋॓ ߏཧΛɺখ͍͞ͱ͜Ζ͔ ΒɺޮՌతʹ࢝ΊΔ PHPͦͷͷΑΓγεςϜͷ ෳࡶੑͷํ͕ ܧଓతʹόʔδϣϯΞοϓͰ ͖Δ͜ͱ͕େ