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
Mac・Windows共通のPHP開発環境
Search
komagata
April 28, 2015
Programming
1
5.4k
Mac・Windows共通のPHP開発環境
vagrant + ansibleでPHP開発環境
komagata
April 28, 2015
Tweet
Share
More Decks by komagata
See All by komagata
FBCの紹介@RailsGirls
komagata
0
90
フィヨルドブートキャンプの紹介
komagata
0
270
プログラミングスクールでのOSS教育
komagata
0
240
FBCの紹介@RailsGIrls
komagata
0
2.1k
FBCのご紹介
komagata
0
310
Unlimited Web Services
komagata
1
1.5k
漬け水に浸かる
komagata
13
6.1k
迷わない道案内を簡単に作る Kulku
komagata
1
260
交換型インターンシップ
komagata
4
4.1k
Other Decks in Programming
See All in Programming
サーバーゆる勉強会 DBMS の仕組み編
kj455
1
300
Fibonacci Function Gallery - Part 2
philipschwarz
PRO
0
210
令和7年版 あなたが使ってよいフロントエンド機能とは
mugi_uno
10
5.1k
Jaspr Dart Web Framework 박제창 @Devfest 2024
itsmedreamwalker
0
150
Оптимизируем производительность блока Казначейство
lamodatech
0
950
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
540
Amazon Nova Reelの可能性
hideg
0
190
선언형 UI에서의 상태관리
l2hyunwoo
0
270
20241217 競争力強化とビジネス価値創出への挑戦:モノタロウのシステムモダナイズ、開発組織の進化と今後の展望
monotaro
PRO
0
280
盆栽転じて家具となる / Bonsai and Furnitures
aereal
0
1.8k
ゼロからの、レトロゲームエンジンの作り方
tokujiros
3
1k
Fixstars高速化コンテスト2024準優勝解法
eijirou
0
190
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.1k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
860
GitHub's CSS Performance
jonrohan
1030
460k
Fireside Chat
paigeccino
34
3.1k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
A Philosophy of Restraint
colly
203
16k
YesSQL, Process and Tooling at Scale
rocio
170
14k
Producing Creativity
orderedlist
PRO
343
39k
Transcript
.BDɾ8JOEPXTڞ௨ͷ 1)1։ൃڥ ۨܗਅ@߹ಉձࣾϑΟϤϧυ Twitter: @komagata blog: http://docs.komagata.org
ϨΨγʔ1)1ͱʑઓ͍ͬͯ·͢ http://docs.komagata.org/5241
• Ϩϯλϧαʔόʔ • Windowsɹ • Subversionɹ • ڞ௨։ൃαʔόʔ • खಈσϓϩΠ
• खಈςετ ϨΨγʔ1)1։ൃڥ
• ϨϯλϧαʔόʔɹˠɹΫϥυ • WindowsɹˠɹMac or Linux • SubversionɹˠɹGithub • ڞ௨։ൃαʔόʔɹˠɹݸਓ։ൃڥ
• खಈσϓϩΠɹˠɹܧଓతσϓϩΠ • खಈςετɹˠɹࣗಈςετ ϨΨγʔ1)1։ൃڥ ͜Μͳײ͡ʹม͍͖͍͑ͯͨΑͶ
Կ͔ΒखΛ͚ͭΔʁ
ݸਓ։ൃڥ͔ΒखΛ͚ͨ wڞ௨։ൃαʔόʔ༧Ҏ্ʹ͔͍ͬ w ίϯϑϦΫτ ʮ͜Ε͔Βࢲ͕৮ΔͷͰΈͳ͞Μ"""αΠτ৮Βͳ͍ͳ͍Ͱ͍ͩ͘͞ʯ w HJUʹͯ̍͠ਓ͕CSBODIมߋ͢ΔͱશһCSBODI͕มΘΔ w ωοτϫʔΫӽ͠ͷTWOPOTBNCB͍͍͢͝ w
͔ࣾΒ͔͠ݟ͑ͳ͍ w %#ͷ༰͕ൿͷλϨԽ w ͍Βͳ͍ϑΝΠϧͨ͘͞Μ
WBHSBOU BOTJCMFͰ ααͬͱ࡞Γ·ͨ͠
ӕͰ͢ windowsϚγϯങ͍·ͨ͠ɻ
ͦΜͳαΫοͱͰ͖ͯͳ͍ windowsϚγϯങ͍·ͨ͠ɻ ΤΠεʔε
TIJOYCMPHਆ vagrantansibleʹ͍ͭͯ@shin1x1͞Μͷϒϩάݟͨ΄͏͕ྑ͍Ͱ͢
XJONBD BOTJCMFͰͷ 1)1։ൃڥͷίπ ʢ˺ϋϚΓͲ͜Ζʣ
WBHSBOU Vagrant.configure(2) do |config| config.vm.box = "chef/centos-6.6" config.vm.network "private_network", ip:
"192.168.33.10" config.vm.provision "shell", inline: <<-SHELL yum -y install epel-release yum -y install ansible ansible-playbook /vagrant/vagrant.yml --connection=local SHELL end ansibleΛΘͣɺshellͰansibleΛΠϯετʔϧͯ͠ ࣗࣗΛprovisionɻ ʢwindows൛ansibleແ͍ͷͰʣ
BOTJCMF VagrantfileͱplaybookΛಉ͡reposͰཧ
େྔαΠτ ཧ͍ͯ͠ΔαΠτ͕े͋ΔͷͰɺڥΛ࡞Δͷ͕ େมɻ ྫʣ 1.VirtualHostͷઃఆΛՃ͢Δ 2.HostsʹυϝΠϯɾIPΛઃఆ͢Δ αΠτ͕૿͑Δͨͼʹશһ͕͜ΕͷઃఆΛ͢Δ
7JSUVBM%PDVNFOU3PPU NameVirtualHost *:80 <VirtualHost *:80> VirtualDocumentRoot /srv/%0 </VirtualHost> <directory /srv/*>
Order allow,deny Allow from all </directory> foo.jpͰΞΫηε͞ΕͨΒ/srv/foo.jpΛDocumentRootͱ͢Δ ศརػೳɻ ʢapacheͷɻnginxͰͬͱී௨ʹͰ͖Δʣ
EPDSPPUIBDL NameVirtualHost *:80 <VirtualHost *:80> VirtualDocumentRoot /srv/%0 php_admin_value auto_prepend_file /srv/set_docroot_hack.php
</VirtualHost> VirtualDocumentRoot͏ͱPHPͷDOCUMENT_ROOT͕ ਖ਼͘͠ઃఆ͞Εͳ͍ͷճආɻ ʢnginxͰུ <?php $_SERVER['DOCUMENT_ROOT'] = str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['SCRIPT_FILENAME']);
YJQJPͰWJSUVBMIPTU
YJQJPͰWJSUVBMIPTU DNSઃఆ͍ΒͣͰࣗ༝ʹsubdomain͑Δɻ subdomainʹipΛೖΕΔͱͦΕΛฦ͢ɻ ipͷsubdomainʹԿ͔ೖΕͯແࢹͯ͘͠ΕΔɻ ͜ΕΛ͑virtualboxͷprivate networkͷhostʹର ͯ͠ઃఆແ͠ʹsubdomainΛউखʹ࡞ΕΔɻ 192.168.33.10.xip.io -> 192.168.33.10
foo.192.168.33.10.xip.io -> 192.168.33.10 bar.192.168.33.10.xip.io -> 192.168.33.10
XJOEPXTͷ ύοέʔδϚωʔδϟʔ homebrewΈ͍ͨͳͷɻΫοιศརɻ
DIPDPMBUFZ ඞཁͳ͕ҰൃͰͦΖ͏ɻΫοιศརʢೋʣ > @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object
net.webclient).DownloadString('https://chocolatey.org/ install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin ίϚϯυϓϩϯϓτ͔ΒΠϯετʔϧ > choco install googlechrome firefox curl git virtualbox vagrant -y PowerShellͱ͔NuGetͱ͔windowsͷྲّྀʹैͬͯ ΔͷͰ҆৺ʂ
.BD8JOڞ௨ͷ 1)1։ൃڥ͕Ͱ͖ͨ $ git clone
[email protected]
:komagata/php-development.git $ cd php-development $
vagrant up
ϨΨγʔ1)1վળͷ͝༻໋ ฐࣾ·Ͱ
Ҏ্Ͱ͢ɻ ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ