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
350
大高生へのメッセージ(令和6年度「大高未来塾」) / Messages to Current Students
kentaro
0
240
「始め方」の始め方 / How to Start Starting Things
kentaro
5
860
Dynamic IoT Applications and Isomorphic IoT Systems Using WebAssembly
kentaro
1
1.3k
わたしがこのところハマっている「ライセンスフリー無線」のご紹介 / An Invitation to License-Free Radio
kentaro
1
500
先行きの見えなさを楽しさに変える ーVUCA時代のキャリア論と絶対他力主義ー / How to develop your career in the VUCA era
kentaro
7
5.4k
組織の生産性を高める意思決定の構造と方法 / 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
「隙間家具OSS」に至る道/Fujiwara Tech Conference 2025
fujiwara3
7
6.5k
カップ麺の待ち時間(3分)でわかるPartyRockアップデート
ryutakondo
0
140
ドメイン駆動設計の実践により事業の成長スピードと保守性を両立するショッピングクーポン
lycorptech_jp
PRO
13
2.3k
RubyでKubernetesプログラミング
sat
PRO
4
160
DMMブックスへのTipKit導入
ttyi2
1
110
Unsafe.BitCast のすゝめ。
nenonaninu
0
200
【NGK2025S】動物園(PINTO_model_zoo)に遊びに行こう
kazuhitotakahashi
0
240
WantedlyでのKotlin Multiplatformの導入と課題 / Kotlin Multiplatform Implementation and Challenges at Wantedly
kubode
0
250
.NET 最新アップデート ~ AI とクラウド時代のアプリモダナイゼーション
chack411
0
200
Copilotの力を実感!3ヶ月間の生成AI研修の試行錯誤&成功事例をご紹介。果たして得たものとは・・?
ktc_shiori
0
350
[IBM TechXchange Dojo]Watson Discoveryとwatsonx.aiでRAGを実現!事例のご紹介+座学②
siyuanzh09
0
110
.NET AspireでAzure Functionsやクラウドリソースを統合する
tsubakimoto_s
0
190
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
133
9k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
Speed Design
sergeychernyshev
25
740
The Power of CSS Pseudo Elements
geoffreycrofte
74
5.4k
How to Ace a Technical Interview
jacobian
276
23k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
Designing for Performance
lara
604
68k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
How STYLIGHT went responsive
nonsquared
96
5.3k
VelocityConf: Rendering Performance Case Studies
addyosmani
327
24k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Mobile First: as difficult as doing things right
swwweet
222
9k
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ͦͷͷΑΓγεςϜͷ ෳࡶੑͷํ͕ ܧଓతʹόʔδϣϯΞοϓͰ ͖Δ͜ͱ͕େ