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.3k
Mac・Windows共通のPHP開発環境
vagrant + ansibleでPHP開発環境
komagata
April 28, 2015
Tweet
Share
More Decks by komagata
See All by komagata
FBCの紹介@RailsGirls
komagata
0
77
フィヨルドブートキャンプの紹介
komagata
0
250
プログラミングスクールでのOSS教育
komagata
0
230
FBCの紹介@RailsGIrls
komagata
0
2.1k
FBCのご紹介
komagata
0
290
Unlimited Web Services
komagata
1
1.4k
漬け水に浸かる
komagata
13
6k
迷わない道案内を簡単に作る Kulku
komagata
1
240
交換型インターンシップ
komagata
4
4.1k
Other Decks in Programming
See All in Programming
Ethereum_.pdf
nekomatu
0
460
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
現場で役立つモデリング 超入門
masuda220
PRO
15
3.2k
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
320
Amazon Qを使ってIaCを触ろう!
maruto
0
400
subpath importsで始めるモック生活
10tera
0
300
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
230
CSC509 Lecture 11
javiergs
PRO
0
180
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
600
Jakarta EE meets AI
ivargrimstad
0
530
Featured
See All Featured
A better future with KSS
kneath
238
17k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Practical Orchestrator
shlominoach
186
10k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
Optimizing for Happiness
mojombo
376
70k
Music & Morning Musume
bryan
46
6.2k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Into the Great Unknown - MozCon
thekraken
32
1.5k
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վળͷ͝༻໋ ฐࣾ·Ͱ
Ҏ্Ͱ͢ɻ ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ