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
83
フィヨルドブートキャンプの紹介
komagata
0
260
プログラミングスクールでのOSS教育
komagata
0
240
FBCの紹介@RailsGIrls
komagata
0
2.1k
FBCのご紹介
komagata
0
300
Unlimited Web Services
komagata
1
1.4k
漬け水に浸かる
komagata
13
6k
迷わない道案内を簡単に作る Kulku
komagata
1
250
交換型インターンシップ
komagata
4
4.1k
Other Decks in Programming
See All in Programming
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
130
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
Spatial Rendering for Apple Vision Pro
warrenm
0
110
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
7
1.3k
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
Kaigi on Railsに初参加したら、その日にLT登壇が決定した件について
tama50505
0
100
たのしいparse.y
ydah
3
120
テストコード書いてみませんか?
onopon
2
130
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
260
Effective Signals in Angular 19+: Rules and Helpers @ngbe2024
manfredsteyer
PRO
0
140
useSyncExternalStoreを使いまくる
ssssota
6
1.1k
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
Documentation Writing (for coders)
carmenintech
66
4.5k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Facilitating Awesome Meetings
lara
50
6.1k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Music & Morning Musume
bryan
46
6.2k
Speed Design
sergeychernyshev
25
670
Faster Mobile Websites
deanohume
305
30k
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վળͷ͝༻໋ ฐࣾ·Ͱ
Ҏ্Ͱ͢ɻ ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ