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
260
大高生へのメッセージ(令和6年度「大高未来塾」) / Messages to Current Students
kentaro
0
200
「始め方」の始め方 / How to Start Starting Things
kentaro
5
790
Dynamic IoT Applications and Isomorphic IoT Systems Using WebAssembly
kentaro
1
1.1k
わたしがこのところハマっている「ライセンスフリー無線」のご紹介 / An Invitation to License-Free Radio
kentaro
1
440
先行きの見えなさを楽しさに変える ーVUCA時代のキャリア論と絶対他力主義ー / How to develop your career in the VUCA era
kentaro
7
4.8k
組織の生産性を高める意思決定の構造と方法 / How to do make decision rapidly and effectively
kentaro
39
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.4k
Other Decks in Technology
See All in Technology
AWS Lambda と Amazon SQS で「わかった気になれる」FreeRTOS 入門
soracom
PRO
2
150
From naive to advanced RAG: the complete guide
glaforge
0
680
太田博三(@usagisan2020)
otanet
0
150
エンジニアのドメイン知識獲得コストを低減するアプリケーションデザイン
ryo_nagata_
3
160
MobileActOsaka_241018.pdf
akaitadaaki
0
110
プログラミング写経のすすめ
natsutan
0
170
Amplify Gen 2ではじめる 生成AIアプリ開発入門
tsukuboshi
0
400
JAWS-UG 事務局 の「これまで」から みんなで「ここから」を考えよう
miu_crescent
2
140
VueとViteで作るUIコンポーネントライブラリ ~デザインシステムとプロダクトの理想的な分離を目指して~ / 20241019_cloudsign_VueFesJapan2024_1
bengo4com
8
4.5k
今日から始める技術的負債の解消
leveragestech
3
460
自然言語処理を役立てるのはなぜ難しいのか
pfn
PRO
17
4.5k
Amazon Managed Grafana で AWS IoT TwinMaker によるデジタルツインアプリケーションを動かしてみた
wakatsuki
0
120
Featured
See All Featured
Navigating Team Friction
lara
183
14k
How STYLIGHT went responsive
nonsquared
95
5.1k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
41
9.2k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
355
29k
Making Projects Easy
brettharned
115
5.9k
Ruby is Unlike a Banana
tanoku
96
11k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
37
1.8k
Automating Front-end Workflow
addyosmani
1365
200k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
92
16k
Code Reviewing Like a Champion
maltzj
519
39k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
The Pragmatic Product Professional
lauravandoore
31
6.2k
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ͦͷͷΑΓγεςϜͷ ෳࡶੑͷํ͕ ܧଓతʹόʔδϣϯΞοϓͰ ͖Δ͜ͱ͕େ