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
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
340
as(型アサーション)を書く前にできること
marokanatani
10
2.7k
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
イベント駆動で成長して委員会
happymana
1
330
Remix on Hono on Cloudflare Workers
yusukebe
1
300
Jakarta EE meets AI
ivargrimstad
0
670
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
190
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
480
flutterkaigi_2024.pdf
kyoheig3
0
150
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Faster Mobile Websites
deanohume
305
30k
Docker and Python
trallard
40
3.1k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
KATA
mclloyd
29
14k
A better future with KSS
kneath
238
17k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
130
Bash Introduction
62gerente
608
210k
YesSQL, Process and Tooling at Scale
rocio
169
14k
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վળͷ͝༻໋ ฐࣾ·Ͱ
Ҏ্Ͱ͢ɻ ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ